Wait & resume
Pausing a workflow execution until an external event or timer triggers it to continue.
Some Workflow nodes pause execution until something external happens — a communication event (email opened, link clicked), a human approval in Slack, or a timer expiring. While paused, the Job status is set to WAITING and the full execution state is saved so the run can resume exactly where it left off.
How execution is paused
When a node enters a WAITING state:
-
The execution engine serialises the current execution context into a
ResumeWorkflowSnapshotrecord. The snapshotidis thetrackingIdpropagated through the run. -
A
CommWaitPoolrecord is created to track what the run is waiting for:Field What it records internalCorrelationIdUnique identifier linking this wait slot to the expected event communicationTypeThe channel being waited on (e.g. email, WhatsApp) eventThe specific event to wait for (e.g. email opened, link clicked) expiresAtWhen the wait times out alreadyExecutedSet to trueonce the event arrives to prevent duplicate resumestrackingId/jobIdLinks back to the paused Job nodeId/workflowIdThe exact node and Workflow to resume -
The Job's status is updated to
WAITINGand execution halts. No process or thread is held open while waiting.
How execution resumes
When the awaited event arrives:
- EzFlow matches the incoming event to the
CommWaitPoolentry viainternalCorrelationId. - The
CommWaitPoolrecord is markedalreadyExecuted = trueto prevent double-resume. - The
ResumeWorkflowSnapshotis loaded bytrackingId. - The orchestrator rehydrates the snapshot and continues the DAG from the waiting node, injecting the event result as input.
- When the run completes, the Job's status is updated to
COMPLETED(or a failure status).
Nodes that use wait & resume
WAIT_FOR_EVENT
WAIT_FOR_EVENT pauses until a communication tracking event arrives or a timeout elapses. Configure the event type (e.g. email opened) and a timeout duration. The node outputs result: true when the event arrives in time, or result: false when the timer expires first.
SLACK_APPROVAL
SLACK_APPROVAL posts an Approve / Reject message to a Slack channel and pauses until a team member clicks one of the buttons. When the Workflow resumes it outputs approved (boolean), approvedBy, approvedAt, and status ("approved" or "rejected"). A timeoutMinutes setting caps how long the Workflow waits.
Timeout behaviour
When the expiresAt time on the CommWaitPool record passes without the awaited event arriving, EzFlow resumes the Workflow with the timeout outcome — result: false for WAIT_FOR_EVENT, or the equivalent rejection path for SLACK_APPROVAL.
Related
- WAIT_FOR_EVENT — waits for a communication event or timer
- SLACK_APPROVAL — waits for a human approval in Slack
- Run history — find WAITING Jobs and inspect their state
- Executions & Jobs — overview of Job statuses and the execution lifecycle