Skip to main content

Event-Driven Workflows

vNext can react to external pub/sub events in two independent ways:

  1. Start a new workflow instance — the event is declared on the workflow (attributes.event), delivered with ?action=start.
  2. Run a transition on an existing instance — the event is declared on a transition (transition.event with "triggerType": 3), delivered with ?action=transition&transitionKey=<key>. Event transitions are supported on state transitions and shared transitions only.

The mapping script implements the IEventMapping interface and returns an EventMappingResult — an InstanceKey + Body, or (when the payload carries no key) a Selector built with the fluent InstanceQuery and terminated with First()/Last(). CloudEvent envelopes are unwrapped before the script runs; selectors are automatically scoped to the target workflow.

Delivery infrastructure is domain-owned: a single generic runtime endpoint (POST /api/v1/{domain}/workflows/{workflow}/instances/events) receives everything, while topics, Dapr Subscription YAMLs, and the pub/sub component live with the domain — shipping a new event needs no runtime redeploy. The vnext helm chart supports global.pubsubComponents / global.subscriptionComponents values for rendering the Dapr resources.

A non-matching event returns 200 by design (no redelivery); mapping failures return 500 and are retried per resiliency policy; delivery to a non-event transition is rejected with NotAnEventTransition.

🚧 Full English translation is pending. See the Turkish page for the complete contract, correlation rules, Dapr Subscription examples, runtime behavior table, and testing guide.