Guides

Events & Signals


Events (also called signals) enable workflows to receive asynchronous messages from external systems and other workflows. A workflow can pause execution with wait_for_event(), and an external caller — a REST API handler, another workflow, or a cron job — delivers the event with send_event(). The workflow resumes from exactly where it left off.

Key Characteristics

  • Asynchronous — Events are delivered without blocking the sender
  • Buffered — Events sent before the workflow calls wait_for_event() are queued and delivered immediately when the workflow is ready
  • Durable — Event delivery is journaled and survives crashes and replays
  • Type-Safe — Events carry strongly-typed payloads that are deserialized automatically
  • Named — Events are identified by string names, allowing a workflow to wait for different event types at different points
Senders
REST API
external
Workflow B
inter-workflow
Cron Job
scheduled
send_event
►
send_event
►
send_event
►
Workflow A
Execute tasks
wait_for_event("approval")
paused · zero resources
event arrives ortimeout
Resume execution

Buffered: events sent before wait are queued


Topics