EzFlowEzFlow Docs
Jobs & Actions

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:

  1. The execution engine serialises the current execution context into a ResumeWorkflowSnapshot record. The snapshot id is the trackingId propagated through the run.

  2. A CommWaitPool record is created to track what the run is waiting for:

    FieldWhat 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 true once the event arrives to prevent duplicate resumes
    trackingId / jobIdLinks back to the paused Job
    nodeId / workflowIdThe exact node and Workflow to resume
  3. The Job's status is updated to WAITING and execution halts. No process or thread is held open while waiting.

How execution resumes

When the awaited event arrives:

  1. EzFlow matches the incoming event to the CommWaitPool entry via internalCorrelationId.
  2. The CommWaitPool record is marked alreadyExecuted = true to prevent double-resume.
  3. The ResumeWorkflowSnapshot is loaded by trackingId.
  4. The orchestrator rehydrates the snapshot and continues the DAG from the waiting node, injecting the event result as input.
  5. 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.

On this page