Skip to main content
Event-triggered workflows execute automatically when events are published to specific topics. Perfect for building reactive systems, webhooks, and event-driven architectures.

Defining event-triggered workflows

Use trigger_on_event to specify which topic should trigger the workflow:

Event payload structure

Event-triggered workflows receive the event in their payload:
Event structure:

Publishing events

Publish events from workflows or external systems:

From within a workflow

From external systems (API)

Batch events for processing

Process multiple events together for efficiency:
Batching behavior:
  • Workflow triggers when either batch_size is reached or batch_timeout_seconds elapses
  • If 10 events arrive in 5 seconds → triggers immediately with 10 events
  • If only 3 events arrive in 30 seconds → triggers with 3 events after timeout
Batch payload structure:

Multiple handlers for one topic

Multiple workflows can listen to the same topic:
When an event is published:
  • immediate-handler triggers once per event
  • batched-handler triggers once per batch (up to 5 events or 60 seconds)

Event filtering

Filter events by event_type:
Alternative approach: Use multiple topics

Event topic patterns

Use topic hierarchies for organization:

Key takeaways

  • Event-triggered workflows execute automatically when events are published
  • Use trigger_on_event to specify the topic
  • Publish events from workflows or external systems via API
  • Batch events for efficiency with batch_size and batch_timeout_seconds
  • Multiple handlers can listen to the same topic