Skip to content

Publish events with the Event task

EVENT publishes a JSON message through a registered event-queue provider.

Task parameters

Parameter Required Behavior
sink Yes provider:<provider-specific destination>; expressions resolve at runtime
inputParameters No User payload fields
asyncComplete No Defaults to false; when true the task remains IN_PROGRESS after publish

In Orkes Conductor, the sink format is message-broker-type:integration-name:topic/queue-name. The message-broker-type is the message broker where the payload is sent: amqp, sqs, azure, kafka, nats, gcp_pubsub, or ibm_mq. The integration-name is the name of the message broker integration added to the cluster. The topic/queue-name is the name of the queue or topic where the payload is sent.

Conductor sink expansion

  • conductor becomes conductor:<workflowName>:<taskReferenceName>.
  • conductor:<suffix> becomes conductor:<workflowName>:<suffix>.

The event handler must listen on the expanded name.

Published payload and output

The task begins with its resolved input parameters and adds workflow metadata:

Field Value
workflowInstanceId Parent workflow execution ID
workflowType Parent workflow name
workflowVersion Parent version
correlationId Parent correlation ID
taskToDomain Parent domain map

The task output also contains event_produced, the expanded sink. The published message is the task output without event_produced. The Event task uses its task ID as the broker message identity, so consumers can use that stable value for duplicate detection.

Completion behavior

With asyncComplete: false, a successful publish completes the task. With asyncComplete: true, publishing succeeds but the task remains IN_PROGRESS; an external task update or an event-handler complete_task/fail_task action must resolve it.

Example

{
  "name": "publish_order_status",
  "taskReferenceName": "publish_order_status",
  "type": "EVENT",
  "sink": "conductor:order-status",
  "inputParameters": {
    "orderId": "${workflow.input.orderId}",
    "status": "READY"
  },
  "asyncComplete": false
}

Publish to a Kafka topic

In this example, the Event task publishes the order status to a Kafka topic. Replace <INTEGRATION-NAME> with the name of your Kafka integration and <TOPIC-NAME> with the name of the topic.

{
  "name": "publish_order_status",
  "taskReferenceName": "publish_order_status",
  "type": "EVENT",
  "sink": "kafka:<INTEGRATION-NAME>:<TOPIC-NAME>",
  "inputParameters": {
    "orderId": "${workflow.input.orderId}",
    "status": "READY"
  },
  "asyncComplete": false
}

The sink is written as the message broker type, the integration name and the topic. For the other brokers, only the prefix and the destination change.

For a practical first-use walkthrough, see Publish events. Use Event-Driven Orchestration for the provider matrix, routing, webhooks, signals, and delivery observability.