Examples
Five examples demonstrating Event Wait in real event-driven workflow scenarios.
Example 1 — Wait for Payment Confirmation (Correlated)
An order processing workflow creates a pending order and then waits for the payment gateway to confirm the payment. Uses correlation by order ID to ensure each workflow instance resumes for its own payment event.
{
"node_type": "EventWait",
"name": "WaitForPayment",
"config": {
"event_name": "payment.confirmed",
"timeout_seconds": 1800,
"correlation_key": "{@ var.orderId }"
}
}
// success: event_payload = { transactionId, amount, currency }
// timeout: payment not confirmed within 30 minutes → cancel order branch
output.WaitForPayment.event_payload.transactionId to record the transaction and continue fulfilment. If no payment arrives within 30 minutes, the timeout port triggers order cancellation.Example 2 — Wait for User Email Verification
A new user registration workflow sends a verification email with a unique link. The workflow waits up to 24 hours for the user to click the link, which publishes the verification event.
{
"node_type": "EventWait",
"name": "WaitForEmailVerification",
"config": {
"event_name": "user.email_verified",
"timeout_seconds": 86400,
"correlation_key": "{@ var.userId }"
}
}
// success: activate account
// timeout: send reminder email or deactivate pending account
Example 3 — Wait for ERP Import Completion
A data sync workflow pushes records to the ERP system and then waits for the ERP to publish an import.complete event before generating the reconciliation report.
{
"node_type": "EventWait",
"name": "WaitForERPImport",
"config": {
"event_name": "erp.import.complete",
"timeout_seconds": 3600,
"correlation_key": "{@ var.importBatchId }"
}
}
// event_payload expected: { batchId, recordsProcessed, recordsFailed, completedAt }
event_payload.recordsFailed to determine if the reconciliation report should flag errors. A 1-hour timeout ensures the workflow doesn't wait forever if the ERP crashes.Example 4 — Wait for Shipping Label (Fulfilment Webhook)
After an order is submitted to the warehouse management system, wait for the WMS to publish a shipping label created event. Once the label URL is received, email it to the customer.
{
"node_type": "EventWait",
"name": "WaitForShippingLabel",
"config": {
"event_name": "fulfillment.label_created",
"timeout_seconds": 7200,
"correlation_key": "{@ var.warehouseOrderRef }"
}
}
// event_payload: { trackingNumber, labelUrl, carrier, estimatedDelivery }
event_payload.trackingNumber and event_payload.labelUrl to send the customer a shipment confirmation. A 2-hour timeout notifies the ops team if the label is not generated in time.Example 5 — Wait Indefinitely for Inventory Restock
When a product goes out of stock, a back-order workflow suspends indefinitely, waiting for the inventory system to publish a restock event for the specific SKU. When stock is available, notify all waiting customers.
{
"node_type": "EventWait",
"name": "WaitForInventoryRestock",
"config": {
"event_name": "inventory.restocked",
"timeout_seconds": 0,
"correlation_key": "{@ var.productSku }"
}
}
// event_payload: { sku, quantityRestocked, restockedAt, warehouseLocation }
event_payload.quantityRestocked determines how many back-orders can be fulfilled.