Docs / Workflows / Actions / Wait for event
Wait for event
Hold a run until another event matches a configured type and values or a required deadline passes. The deadline fails the run or continues it without a match.
Matching incoming events
Each awaited event names an event type and optional equality conditions. Conditions can compare properties with values from the original input, such as the order ID being tracked. AND and OR groups combine those equality checks. Any one configured awaited event can resolve the wait.
The wait listens for events arriving after it is registered. It does not search previously stored events. If a confirmation already arrived, check that state before starting the wait. Matching uses the event type and configured values, rather than requiring the event’s own timestamp to be newer than the wait.
Wait for an order confirmation
For example, an order-submitted event starts a job for order ORD-104. The wait looks for e:orders/confirmed with orderId equal to {{ properties.orderId }}. A confirmation for ORD-105 leaves this run waiting.
Set a deadline of 86,400 seconds and Continue with expired result. The wait can then publish an order-checked event with the original order ID, a status and the matching event’s data. A later job handles confirmed orders, while another sends a reminder for an expired wait.
{
"orderId": "{{ properties.orderId }}",
"status": "{{ action.wait.status }}",
"confirmation": "{{ action.matchedEvent }}"
}Deadline and result
- matchedEvent
- The matching event’s uuid, eventTypeIdentifier, timestamp, properties, files and hasFiles. It is null when the deadline continues without a match.
- wait.status
- matched means an event resumed the run. expired means the deadline continued it without a match. A test with Publish Events off returns would-wait and skips the real wait.
- wait.startedAt and wait.resolvedAt
- Record when the wait began and when it resolved. A real wait also returns its deadline in wait.deadlineAt and wait.deadlineBehavior.
Every wait has a deadline of at most 30 days (2,592,000 seconds), counted from when this action starts. The editor starts a new Wait for Event job with one week and Fail on deadline. Fail on deadline ends the action without a continuation event. Continue with expired result publishes the configured continuation with no matched event.
Later jobs should check status before reading fields inside confirmation. An expired result has no event properties to inspect. The continuation uses the output mapping saved when the wait began.