Overview
The Wait for Workflow Execution node pauses a running workflow until a specific workflow completes its execution. In this article, we'll be covering what the node does, how to configure it, and when to use it.
Use this node when your workflow depends on the result of another workflow that runs independently — for example, when an external trigger or a separate process fires the other workflow and your workflow needs to act on its outcome.
Understand how the node works
When the Wait for Workflow Execution node runs, it registers a listener for completed executions of the workflow you select. The parent workflow pauses at this node. Each time an execution of the target workflow completes successfully, the node evaluates it against a match function you define. When the function returns true, the node resumes and the matched execution's output becomes available downstream.
Only executions with a status of Success are evaluated. Failed or cancelled executions are ignored.
This node is designed for event-driven coordination — it does not start the other workflow. If you need to both start a workflow and wait for it, use the Start Workflow Execution node with fire and forget disabled instead.
Add the node to your workflow
- In the Graph View, click the + icon where you want to add the node.
- In the node picker, open the Workflows tab.
- Select Wait for workflow execution.
- In the node's side panel, configure the inputs described below.
Configure the node inputs
Wait for workflow (required)
Select the workflow whose completion you want to wait for. The dropdown lists all workflows in your account.
Match workflow execution function (required)
A TypeScript function that evaluates each completed execution of the selected workflow and returns true when the right execution has finished.
The function receives three arguments:
-
state— the current workflow's state at the time the Wait node started. -
completedWorkflowExecutionState— the full output state of the completed execution being evaluated. -
secretsandvariables— the current workflow's secrets and variables.
The function must return a boolean. Return true to match and resume; return false to keep waiting. Use fields from completedWorkflowExecutionState to identify the correct execution — for example, by matching an account ID, an order reference, or any other value present in that execution's output.
Example — match on account ID from the parent workflow's trigger input:
return completedWorkflowExecutionState.steps['get-account'].output?.id === state.input.accountId;
Initiating step (optional)
The slug of a previous node in the current workflow. When set, the node only considers executions of the target workflow that completed after that step ran. This prevents the node from matching a stale execution that completed before the current workflow reached this point.
Use this when the target workflow may have already run before the Wait node executes — for example, if an earlier node in the same workflow triggered or scheduled the other workflow.
Verify past workflow executions delay (milliseconds) (optional)
A time window in milliseconds, measured backwards from now. When set, the node immediately checks for any already-completed executions of the target workflow that finished within that window — before registering a listener and pausing.
This is useful when there is a race condition where the target workflow may complete just before or just as the Wait node starts, and you want to catch it rather than wait indefinitely.
For example, a value of 60000 (one minute) tells the node to look back one minute for a matching execution before waiting.
Access the node output
When the node resumes, it outputs the full output of the matched execution. If the target workflow defines a workflow-level output mapper on its End node, that output is available at:
state.steps['your-node-slug'].output
If the target workflow does not define a workflow-level output, the output will be empty. See Using Output Mappers for how to configure a workflow output.
Understand error codes
The node can fail with the following error codes:
-
WORKFLOW_NOT_FOUND— the selected workflow no longer exists. -
INVALID_WORKFLOW_ID— the workflow ID is malformed or could not be resolved. -
INVALID_INITIATING_STEP— the slug specified in Initiating step does not match any node that has already run in the current execution.
Common patterns
Waiting for an externally-triggered workflow
Your workflow starts a process that sends a request to an external system (via webhook or API call), and a separate webhook-triggered workflow handles the external system's callback when it responds. Use the Wait for Workflow Execution node to pause the original workflow until the callback workflow completes, then use its output to continue processing.
Combining with Start Workflow Execution
You can use Start Workflow Execution (with fire and forget enabled) followed by Wait for Workflow Execution when you need to start a workflow and then resume based on an independent completion signal — rather than waiting inline. Set the Initiating step to the Start Workflow Execution node's slug to ensure only executions started after that point are considered.
Writing precise match functions
Always match on a specific identifier — such as an account ID, order number, or execution ID — rather than returning true unconditionally. An unconditional match will resume on the first completed execution of the target workflow, regardless of whether it's the right one.
If the match function always returns false, the workflow will wait indefinitely. Make sure your match logic is reachable and that the target workflow will eventually complete in a way that satisfies it. Consider adding a node timeout to protect against unbounded waits.
Related to