Basic Usage
Consumption Strategies
Listen for One Event
Wait for a single specific event:Listen for Any Event
Complete when any of the specified events arrive:Listen for All Events
Wait until all specified events have been received:Complete Examples
Order Approval Workflow
Multi-Stage Document Collection
IoT Sensor Monitoring
Event Correlation
Configuration
to (required)
Defines which events to listen for:one- Wait for a single specific eventany- Wait for any one of multiple eventsall- Wait for all specified events
with
Event matching criteria (CloudEvents attributes):type- Event typesource- Event sourcesubject- Event subjectdata- Filter expression evaluated against event data
read (optional)
Specifies what to include in output:data(default) - Event data onlyenvelope- Full event envelope (context + data)raw- Raw event data
until (optional)
Defines an alternative exit condition:timeout (optional)
Maximum time to wait for events:Event Filtering
Use thedata filter to match event payload:
Error Handling
Timeout Handling
Output Format
Listener output is always an array containing the consumed events:onestrategy: Array with single eventanystrategy: Array with first matching eventallstrategy: Array with all matching events
Best Practices
- Always set timeouts - Prevent workflows from waiting indefinitely
- Use correlation - Filter events by correlation ID or subject
- Handle timeouts - Wrap Listen in Try/Catch to handle timeout errors
- Filter precisely - Use
datafilters to match exact event criteria - Use until for cancellation - Provide alternative exit conditions
- Choose appropriate read mode - Use
datafor payload,envelopefor metadata - Document event contracts - Clearly define expected event formats
Common Patterns
Request-Response via Events
Human Task Waiting
Related Topics
- Emit Task - Publish events
- Try/Catch - Handle timeout errors
- Switch Task - Branch based on received events