Wait for event
A Wait for event step pauses the run until an event with the right name, and the right customer or case values, arrives. It takes received when one does and timeout when none arrives in time. The event’s data is stored for later steps.
When to use it
Section titled “When to use it”- Wait until the borrower uploads documents before verification starts.
- Wait for a payment confirmation before dispatching an order.
- Wait for a lab system to report that test results are ready.
When not to use it
Section titled “When not to use it”- The event should start a new run. Use Business event.
- You only need time to pass. Use Wait.
- You are waiting for a form reply from the customer. Use Collect form.
Settings
Section titled “Settings”| Setting | What it does |
|---|---|
| Event name | Required. For example payment.received. |
| Correlation keys | Fields in the event’s data that must equal the run’s own value, for example applicationId. The run’s value comes from its correlation, or else its input. The event’s correlation only decides which runs are woken, so send each key in both correlation and data. |
| Only events where | An expression checked against each event as event, for example event.status == 'paid'. |
| If several arrived | first (default) or latest. |
| Time out after | Default: 48h. Empty waits with no limit. |
| Store event as | Also saves the event’s data under data.<name>. |
What it produces
Section titled “What it produces”- The
receivedortimeoutbranch. events.<event name>andsteps.<step id>: the event’s data.data.<name>when Store event as is set.
Events that reached the run before this step started also count. Inside a For each loop, each item waits for the event that carries its own value, such as its own loanRef. Send events to running workflows with the workflows API.
Example
Section titled “Example”A lender waits up to three days for documents.
Send message (upload link) → Wait for event (documents.uploaded, key applicationId, 3d) received → Human task (verify) → End timeout → Outbound call (document follow-up) → EndEvent data stored at events["documents.uploaded"]:
{ "applicationId": "LN-88213", "files": ["salary-slip.pdf", "pan.jpg"] }