Files
conductor-oss--conductor/docs/devguide/cookbook/event-driven.md
2026-08-20 12:52:15 -07:00

1.9 KiB

description
description
Copy-and-paste EVENT and event-handler recipes using canonical fixtures.

Event-driven recipes

Read Event orchestration first for action support, provider configuration, delivery, and idempotency semantics.

Publish an internal event

--8<-- "docs/devguide/cookbook/examples/events/publish-internal-event-workflow.json"

Register and run the workflow. Its conductor:order-status sink expands to conductor:publish_order_event:order-status.

Start a workflow from the event

Register the target workflow first:

--8<-- "docs/devguide/cookbook/examples/events/fulfill-order-workflow.json"
--8<-- "docs/devguide/cookbook/examples/events/start-workflow-handler.json"
curl -sS -X POST 'http://localhost:8080/api/event' \
  -H 'Content-Type: application/json' \
  --data-binary @docs/devguide/cookbook/examples/events/start-workflow-handler.json

The payload expression is rooted directly at the Event task's published JSON.

Wait for an external approval

Workflow:

--8<-- "docs/devguide/cookbook/examples/events/wait-for-approval-workflow.json"

Handler:

--8<-- "docs/devguide/cookbook/examples/events/complete-wait-handler.json"

Representative broker payload:

--8<-- "docs/devguide/cookbook/examples/events/approval-event.json"

Replace the representative workflowId with the ID returned when the waiting workflow starts. A correlation ID alone cannot target the WAIT task.

Use an external provider

Change event/sink to a registered provider identifier and its provider-specific URI, for example kafka:order-approvals, sqs:https://sqs.us-east-1.amazonaws.com/123/order-events, nats:orders.ready, jsm:orders.ready, nats_stream:orders.ready, amqp_queue:orders, or amqp_exchange:orders. Enable the matching module and properties described in the guide.