Kafka Producer step

  • Release version: Zurich
  • Updated July 31, 2025
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Kafka Producer step

    The Kafka Producer step in Workflow Studio enables you to create an action that publishes events to a Kafka topic within your Kafka environment. This step is designed for users with theactiondesignerrole and requires a Stream Connect subscription along with the ServiceNow Stream Connect Installer plugin.

    Show full answer Show less

    Key Features

    • Topic: Select the target Kafka topic to publish messages. Topics organize messages of the same type, such as "Payments".
    • Message: Define the text content of the message to be published.
    • Key: Specify a key to determine the message partition. Messages with the same key are stored in the same partition, facilitating organized message distribution.
    • Headers: Add message headers as name-value pairs, with support for static values or data pills.
    • Wait For Completion: Choose whether the workflow should wait for the step’s completion before proceeding.
    • Schema: Reference a schema to ensure the message structure complies with expected formats, enhancing message validation and consistency.
    • If this step fails: Configure error handling options to either stop the action and trigger error evaluation or continue to the next step while logging error details. Error evaluation runs regardless of continuation.

    Outputs

    • Step Status: Provides runtime details such as success or failure status.
    • Step Status > Code: Integer indicating success (0) or error (1) of the step execution.
    • Step Status > Message: String containing any error messages related to the step’s execution.

    Practical Use

    ServiceNow customers can leverage this step to integrate ServiceNow workflows with Kafka messaging systems, enabling event-driven communication such as publishing incident creation messages to Kafka topics. By correctly configuring the topic, message content, key, and schema, customers ensure reliable, structured, and partitioned event publishing. Error handling options allow workflows to manage failures gracefully depending on business needs.

    Create an action that publishes events to a topic in your Kafka environment.

    Roles and availability

    The Kafka Producer step is an Workflow Studio action step. Users with the action_designer role can create a custom action with one or more action steps.

    This step is requires a Stream Connect subscription. For more information, see https://www.servicenow.com/now-platform/workflow-data-fabric.html.

    This step requires the ServiceNow Stream Connect Installer [com.glide.hub.stream_connect.installer] plugin.

    Fields

    Field Description
    Topic

    Name of the topic to publish the message to. A topic stores messages of the same type. For example, a topic named Payments might store messages about recent payments.

    Select a topic from the drop-down list.

    Message Text of the message.
    Key Name of the key for a specific partition. Topics can be partitioned. Messages with the same key are stored in the same partition. For example, payment messages with a key of June would all be stored in the same partition of the Payments topic.
    Headers Headers for the message, in name-value pairs. For both the Name and Value fields, you can enter a value or use a data pill.
    Wait For Completion Option to require the flow to wait for the step to complete before continuing.
    Schema Reference to a schema table. Select a schema from the list. For information on schemas, see .
    Note:
    The message you're sending in the Message field must adhere to the structure of the selected schema.
    If this step fails Option to go to error evaluation or continue running the next step. This option has no effect on the Step Status. Select one of the following.
    • Stop the action and go to error evaluation: Stop running the action at the current step and go to error evaluation. The Step Status object contains the error information returned by the step.
    • Don't stop the action and go to the next step: Ignore the failure and continue running the action from the next step. The Step Status object contains the error information returned by the step. Action error evaluation runs regardless of whether the action continues running.

    Example

    In this example, the step sends a message recording the creation of an incident. The message includes an incident identifier, a description, and a message header. The message is sent to the incidents topic, and stored in the partition with the name of the incident identifier.

    Example Kafka Producer step.

    Outputs

    Field Description Data Type
    Step Status Object data pill containing runtime details about the step. Each step in an action returns a Step Status. Object
    Step Status > Code Integer data pill indicating whether the step produced an error. By default, a value of 1 indicates that the step produced an error. A value of 0 indicates that the step ran successfully. You can't customize these codes. Integer
    Step Status > Message String data pill containing the error message produced by the step or system operation. You can't customize this message. String