Low-code for Kafka

circle-info

Feature availability depends on the license and may not be available in all deployments.

Purpose

Enable sending messages to the specified Kafka instance and topic directly from requests (scripts) and BPMN processes (script tasks).

Usage examples

  • Updating data in the data warehouse

  • Notifying CRM about process status changes

  • Communication with external systems (e.g., bank systems)

Usage in a script/script task

api.events.v1.publishAsync(
    "kafkaid",                  // name of the Kafka instance (configured by the administrator, lowercase only, no special characters)
    "topicName",                // name of the topic (configured by the administrator)    
    {                           // message content – must be valid JSON
      "id": "123",
      "status": {
        "code": "OK",
        "message": "Everything is fine!"
      },
      "list": [1, 2, 3],
      "boolean": true,
      "date": new Date()
    },
    "key",                      // message key (optional – must be provided if you need to preserve event order)
    {                           // headers (optional)
        "header1": "header1-value",
        "header2": "header2-value"
    }
);

Important information

  • Sending is asynchronous – the script does not wait for confirmation of message delivery

  • This implies there is no possibility to catch errors during sending

  • The message content must be valid JSON – the passed object is serialized automatically

  • The key is optional but recommended when you care about the order of messages within a partition

  • The send timeout is configured by the administrator – it cannot be changed from the script

  • Topics are created and managed by administrators

  • kafkaId must match the name of the Kafka instance configured in the application

Last updated

Was this helpful?