Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

publish_kafka

Publishes a message to a Kafka topic through a Kafka connector. Requires Kafka to be enabled in config. If value is omitted, the full data context is published.

Synopsis

{
  "name": "publish_kafka",
  "input": {
    "connector": "events",
    "topic": "order.placed",
    "key": {
      "var": "data.order.id"
    },
    "value": {
      "var": "data.order"
    }
  }
}

Description

publish_kafka is a connector function. It names a connector for its credentials and endpoint. Orion validates its input when the workflow is saved, and the call runs through the connector’s circuit breaker.

Retry safety: unsafe_write. See Retry safety for what the answer costs.

Fields

FieldTypeRequiredDefaultDescription
connectorstring | JSONLogicyesName of the Kafka connector. A computed name is not yet supported
topicstring | JSONLogicyesTarget topic. Accepts an expression, so one task can route by message content
keyany | JSONLogicnoThe message key. Accepts the pre-1.0 name key_logic
valueany | JSONLogicnofull dataThe message value. Accepts the pre-1.0 name value_logic

Examples

{
  "name": "publish_kafka",
  "input": {
    "connector": "events",
    "topic": "order.placed",
    "key": { "var": "data.order.id" },
    "value": { "var": "data.order" }
  }
}

A computed topic is what lets one task fan a stream out by content: the tenant, the region, the event type. Before, that took one task per destination:

{
  "name": "publish_kafka",
  "input": {
    "connector": "events",
    "topic": { "cat": ["orders.", { "var": "data.region" }] },
    "value": { "var": "data.order" }
  }
}

Last verified 14 September 2026