Use the Execute Workflow node to run a different workflow on the host machine that runs n8n.
Examples and templates
For usage examples and templates to help you get started, refer to n8n's Execute Workflow integrations page.
The Execute Workflow node has two properties:
- Source: this field specifies from where to get the workflow's information.
- Local File
- Workflow: this field contains information about the workflow, such as the workflow ID, URL, or a file.
- Mode: choose whether to Run once with all items or Run once for each item. Selecting Run once for each item makes the node execute for every input item in turn.
Set up and use a sub-workflow#
This section walks through setting up both the parent workflow and sub-workflow.
Create the sub-workflow#
- Create a new workflow.
- Optional: configure which workflows can call the sub-workflow:
- Select the Options menu > Settings. n8n opens the Workflow settings modal.
- Change the This workflow can be called by setting. Refer to Workflow settings for more information on configuring your workflows.
- Add the Execute Workflow Trigger node.
- Add other nodes as needed to build your sub-workflow functionality.
- Save the sub-workflow.
Sub-workflow mustn't contain errors
If there are errors in the sub-workflow, the parent workflow can't trigger it.
Load data into sub-workflow before building
This requires the ability to load data from previous executions, which is available to Pro and Enterprise users.
If you want to load data into your subworkflow to use while building it:
- Create the subworkflow and add the Execute Workflow Trigger.
- In the subworkflow settings, set Save successful production executions to Save.
- Skip ahead to setting up the parent workflow, and run it.
- Follow the steps to load data from previous executions. You'll now have example data pinned in the trigger node, which allows you to work with real data when configuring the rest of the workflow.
Call the sub-workflow#
- Open the workflow where you want to call the sub-workflow.
- Add the Execute Workflow node.
In the Execute Workflow node, set the sub-workflow you want to call. You can choose to call the workflow by ID, load a workflow from a local file, add workflow JSON as a parameter in the node, or target a workflow by URL.
Find your workflow ID
Your sub-workflow's ID is the alphanumeric string at the end of its URL.
Save your workflow.
When your workflow executes, it will send data to the sub-workflow, and run it.
Find a workflow ID#
- Open the workflow for which you want to get the workflow ID.
- Copy the number after
workflow/in your URL and paste that in the Workflow ID field.
How data passes between workflows#
For example, there's an Execute Workflow node in Workflow A. The Execute Workflow node calls another workflow, Workflow B:
- The Execute Workflow node passes the data to the Execute Workflow trigger node of Workflow B.
- The last node of Workflow B sends the data back to the Execute Workflow node in Workflow A.