Publish message action in the Kafka package
- Updated: 2026/05/15
Publish message action in the Kafka package
The Publish message action in the Kafka package enables you to send a message to a specified Apache Kafka topic within an active session. It also supports optional partition targeting and message key routing, and receives data as a dictionary output for use in downstream automation steps.
Prerequisites
- An active Kafka session established using the Connect action. See Connect action in the Kafka package.
- The target Kafka topic exists on the broker and the authenticated user has producer permissions for that topic.
Settings
Use the Publish message action to send a message to an Apache Kafka topic within an active session. The action accepts an optional partition number and message key for routing. When no partition is specified, the broker uses the default partitioner. The action returns a dictionary containing data — including topic name, partition number, offset, and timestamp — that you can use in downstream steps for logging, auditing, or conditional branching.
- Session name: Select one of the following options to
specify the Kafka session to be used:
- Session name: Select the active Kafka session returned by the Connect action, or accept the default session name Default.
- Variable: Select a session variable that includes the active Kafka session configuration.
- Topic: Enter the exact name of the Kafka topic to consume from. For example, transactions-data.
- (Optional) Partition: Enter a non-negative integer (0 or greater) to target a specific partition. If you leave this field empty, the broker uses the default partitioner to determine the partition based on the message key or random assignment.
- (Optional) Message key: Enter a message key used by the broker's partitioner to route messages consistently. Messages with the same key are always sent to the same partition. Use a meaningful identifier such as a customer ID or order ID. For example, customer-id-7271.
- Message: Enter the message content to publish. Multi-line
input is supported. The value might be plain text, JSON, XML, or any string
format accepted by the consuming application. For example,
{"orderId": "ORD-9912", "status": "fulfilled", "amount":
149.99}. Note: Avoid including unescaped special characters that could invalidate the message format expected by the consumer.
- Assign output to a variable: Specify the variable where the Publish message action stores the result. The Publish message action returns a dictionary containing delivery metadata for the published message, including the topic name, partition number, offset, and server-assigned timestamp. Use this variable in downstream steps to access keys such as topic, partition, offset, and timestamp for logging, auditing, or conditional branching.