Event Scheduling
Trigger workflows based on time schedules or incoming events.- Cron Schedule
- Event-Driven Schedule
schedule-cron.yaml
- Time-based workflow scheduling with
schedule.cron - Standard cron expression format (
0 0 * * *= daily at midnight) - Automated recurring workflows
Listening to Single Events
Wait for a specific event before proceeding.listen-to-one.yaml
- Waiting for a single event with
listen.to.one - Event type filtering
- Workflow pauses until the event arrives
- Event data becomes available to subsequent tasks
Listening to Any Event (First Wins)
- Basic Any
- Filtered Any
listen-to-any.yaml
- Listening to any event without filters
- First event received triggers workflow continuation
- Catch-all event listener
Listening to All Events (Correlation)
Wait for multiple related events before proceeding.- All Events
listen-to-all.yaml
- Waiting for multiple events with
listen.to.all - Different event types in correlation set
- Data filtering per event type
- All conditions must be met before proceeding
Emitting Events
Publish events from within workflows.emit.yaml
- Publishing CloudEvents with
emit - Setting event metadata (source, type)
- Including structured data in events
- CloudEvents specification compliance
Continuous Event Processing
Process events in a loop until a condition is met.- Until Condition
- Consume Amount
listen-to-any-until-condition.yaml
- Consuming events repeatedly with
until - Conditional termination based on event data
- Processing stream of events until completion
Complex Event-Driven Example
Combining events with iteration and processing.for.yaml
- Combining iteration (
for) with event listening (listen) - Processing events for each item in a collection
- Building results incrementally with output transformation
- Conditional loop continuation with
while
Summary
Event-driven patterns enable:- Reactive Workflows - Respond to external events automatically
- Event Correlation - Wait for multiple related events
- Scheduled Execution - Run workflows on time-based or event-based triggers
- Event Publishing - Emit events to notify other systems
- Stream Processing - Continuously process event streams
- Asynchronous Coordination - Coordinate distributed, long-running processes