n8n sub-workflows with the Execute Sub-workflow node
Updated 2026-10-21 · 5 min read
- A sub-workflow starts with Execute Sub-workflow Trigger. Callers use Execute Sub-workflow.
- The output of the sub-workflow's last node comes back to the parent as items.
- Per n8n's docs, sub-workflow executions don't count towards your plan's limits.
A sub-workflow is an n8n workflow that another workflow calls. The caller (the parent) passes it data and gets a result back. This is n8n's version of a shared function. One "send invoice" or "enrich lead" workflow serves ten others, instead of ten copies of the same nodes.
This guide covers the two nodes involved, how data moves, and the settings that matter. It also shows how to rebuild Pipedream projects in which workflows called other workflows.
What to do now
- Find the calls between workflows. Search your exported Pipedream files for
m.pipedream.netand$.flow.trigger(). - Build the sub-workflow first. Start it with Execute Sub-workflow Trigger and declare its inputs.
- End it with an Edit Fields (Set) node. Return only what callers need.
- Call it from the parent. Add an Execute Sub-workflow node and pick the workflow from the list.
- Restrict who can call it. Do this for every sub-workflow that writes data or sends messages.
The two nodes
| Node | Where | Role |
|---|---|---|
| Execute Sub-workflow | Parent (calling) workflow | Calls the sub-workflow and receives its output |
| Execute Sub-workflow Trigger ("When Executed by Another Workflow") | First node of the sub-workflow | Receives the input and starts it |
Older templates and workflow JSON call them Execute Workflow and Execute Workflow Trigger. They are the same nodes.
Build the sub-workflow
- Create a new workflow and add Execute Sub-workflow Trigger.
- Choose the Input data mode (trigger docs):
| Input data mode | What the caller sees |
|---|---|
| Define using fields below | Named inputs with types, shown as a form in the calling node |
| Define using JSON example | Inputs taken from an example object |
| Accept all data | No declared inputs; the sub-workflow must handle whatever arrives |
- Add the nodes that do the work.
- Save. The docs note that a sub-workflow with errors can't be triggered by the parent.
Declared inputs are worth the extra minute. The calling node shows them as fields to fill in, with an option to Attempt to convert types. And anyone who reads the sub-workflow sees what it expects.
Who can call it
Open the sub-workflow's settings. This workflow can be called by limits which workflows may call it (workflow settings). Restrict it for anything that writes data or sends messages.
Call it from the parent
Add Execute Sub-workflow and set Source:
| Source | Loads the workflow from |
|---|---|
| Database | Your n8n instance, From list or by Workflow ID |
| Local File | A JSON file path on the n8n host |
| Parameter | Workflow JSON pasted into the node |
| URL | A URL that returns workflow JSON |
Database is the normal choice. The workflow ID is the string after /workflow/ in the workflow's URL.
Then pick a Mode:
- Run once with all items: all input items go into one sub-workflow execution.
- Run once for each item: each item gets its own sub-workflow execution.
Option: Wait for Sub-Workflow Completion. On: the parent waits and receives the result. Off: fire-and-forget. The parent starts the sub-workflow and continues right away.
You can jump between executions. The Execute Sub-workflow node has a View sub-execution link, and the sub-execution links back to the parent.
How data comes back
- The Execute Sub-workflow node sends its input to the sub-workflow's trigger.
- The last node of the sub-workflow returns its output to the Execute Sub-workflow node. That node outputs it as its own items.
So plan the end of each sub-workflow on purpose. If the last node sends a Slack message, the parent receives Slack's API response. Add an Edit Fields (Set) node at the end that returns exactly what callers need, such as { ok: true, invoiceId }.
Patterns
Shared utility
Example: a "normalize a contact" workflow, called from every lead source. Input: email, name, source. Output: a cleaned record. You fix a bug once, and every caller gets the fix.
Splitting a big workflow
Large workflows are hard to read. On self-hosted n8n they can also run into memory issues: the docs list memory as a reason to split.
Since n8n 1.97.0 you can select nodes and choose Convert to sub-workflow from the canvas menu (conversion docs). The rules:
- no trigger nodes in the selection,
- one entry node and one exit node,
- everything between them selected.
Afterwards, check expressions that use first(), last() and all(). n8n tries to rewrite them, but doesn't guarantee it.
Per-item isolation
Use Run once for each item. On the Execute Sub-workflow node, set On Error: Continue (using error output). Now a bad record fails only its own sub-execution and goes to the error output. Without that setting, a failed sub-execution fails the parent node. Add an error workflow for alerts.
Background jobs
Turn Wait for Sub-Workflow Completion off. A webhook workflow accepts the request, starts the heavy sub-workflow and responds right away.
Billing and limits
n8n's docs state that sub-workflow executions don't count towards your plan's monthly execution or active workflow limits (sub-workflows).
On n8n Cloud, plans are priced by executions. Splitting a workflow into a parent and helpers doesn't multiply the bill. So a design with many small sub-workflows is cheaper than it looks.
Sub-workflow vs alternatives
| Need | Use |
|---|---|
| Reuse logic inside n8n | Execute Sub-workflow |
| Call a workflow from outside n8n | Webhook node on the target workflow |
| Run something on failure | Error workflow (Error Trigger) |
| Let an AI agent call a workflow | Call n8n Workflow Tool node (it also starts the Execute Sub-workflow Trigger) |
You can also call your own workflows over HTTP. But then you lose typed inputs, the execution links and the billing exemption. And you have to secure the endpoint yourself.
From Pipedream: workflows calling workflows
Pipedream had no built-in sub-workflow node. Teams used three patterns instead:
| Pipedream pattern | n8n equivalent |
|---|---|
| One workflow POSTs to another workflow's HTTP trigger URL | Execute Sub-workflow (keep the Webhook trigger if outside systems still call it) |
$.flow.trigger() in code (alpha, per the Node.js docs) |
Execute Sub-workflow |
| Copy-pasted steps across workflows | One sub-workflow, called from each |
The URLs between workflows change during the move. Every *.m.pipedream.net URL that one workflow calls becomes one of two things: an Execute Sub-workflow node or a new n8n webhook URL. List them before you start.
How to find them:
- URLs. Search the exported JSON files for
m.pipedream.net. The converter report then shows, per workflow, which triggers and steps need manual work. $.flow.trigger()calls. The converter doesn't convert or flag them automatically. Search for them and rebuild them as Execute Sub-workflow nodes.
The Code node compatibility check shows what else a step uses. The report and 1 workflow are free. Full export: $3 per workflow, $1 each after 50, $19 minimum, one-off. Full process: migrate Pipedream to n8n.
Not affiliated with Pipedream or n8n.
FAQ
How do I call another workflow in n8n?
Start the called workflow with the Execute Sub-workflow Trigger (also listed as When Executed by Another Workflow). In the calling workflow, add an Execute Sub-workflow node and pick the workflow from the list or by ID.
How does a sub-workflow return data in n8n?
The output of the sub-workflow's last node goes back to the Execute Sub-workflow node in the parent workflow. That node outputs it as its own items.
Do sub-workflow executions count against my n8n plan?
No. n8n's docs say sub-workflow executions don't count towards the plan's monthly execution or active workflow limits.
Can the parent workflow continue without waiting for the sub-workflow?
Yes. Turn off the Wait for Sub-Workflow Completion option on the Execute Sub-workflow node.
Is Execute Workflow the same as Execute Sub-workflow?
Yes. The node was renamed. Older docs, templates and workflow JSON still use Execute Workflow and Execute Workflow Trigger.
Sources (6)
- https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow
- https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflowtrigger
- https://docs.n8n.io/build/flow-logic/break-workflows-into-smaller-parts
- https://docs.n8n.io/build/flow-logic/convert-to-sub-workflows
- https://docs.n8n.io/build/manage-workflows/configure-workflow-settings
- https://pipedream.com/docs/workflows/building-workflows/code/nodejs