1.6 KiB
| contentType | description |
|---|---|
| howto | Call workflows from other workflows, and split large workflows into smaller components. |
Sub-workflows
You can call one workflow from another workflow. This allows you to build modular, microservice-like workflows. It can also help if your workflow grows large enough to encounter memory issues.
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.
- Select the Options
-
Add the Execute Workflow Trigger node.
-
Add other nodes as needed to build your sub-workflow functionality.
-
Save the sub-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.
!!! note "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.