What is a sub-workflow in n8n and when should I use one?
A sub-workflow is an n8n workflow that another workflow calls, so you can reuse logic or split a big workflow into smaller parts. The parent uses an Execute Sub-workflow node; the child starts with an Execute Sub-workflow Trigger node. Use one when the same steps appear in several workflows or a workflow has grown hard to read.
Key takeaways
- n8n's sub-workflow docs say sub-workflows help you build modular workflows that work like small services and can keep a growing workflow from hitting memory limits.
- They say sub-workflow executions do not count toward your plan's monthly execution or active workflow limits; check the current plan page.
- The trigger offers three input modes: define fields, a JSON example, or accept all data.
- The sub-workflow must not contain errors or the parent cannot trigger it.
- n8n's looping guide notes the Execute Workflow node in "Run Once for All Items" mode does not iterate automatically.
- Back up sub-workflows too: n8n's CLI export can export all workflows with `n8n export:workflow --backup`.
The two nodes
| Node | Lives in | Job |
|---|---|---|
| Execute Sub-workflow | Parent | Calls the child and passes data |
| Execute Sub-workflow Trigger | Child | Receives data and starts the child |
The child's last node returns data to the parent. From the parent's node you can open the sub-execution to follow the run.
Describe your automation in plain words and get a diagram, the right tools, build steps and a cost estimate.
When to use one
| Situation | Sub-workflow? |
|---|---|
| Same 5 steps used in 4 workflows (for example, format and send an alert) | Yes |
| One workflow with 60 nodes that nobody can read | Yes, split by purpose |
| A tiny two-step workflow | No, keep it simple |
| A task you want to test separately | Yes |
| Something that needs different permissions | Maybe, check access settings |
How to set one up
- Create a new workflow and add the Execute Sub-workflow Trigger.
- Choose the input mode. "Define using fields below" names the inputs the caller must provide, which is clearest.
- Build the logic and make sure the last node returns what the parent needs.
- Save and fix any errors so the parent can call it.
- In the parent, add Execute Sub-workflow and pick the child by ID or another option.
- Fill the inputs and save.
- Test the child alone, then through the parent.
- Name both clearly and note which workflows use the child.
- Control who can call it in the workflow settings if needed.
Worked example
Example: Mia has four workflows that each send a formatted Slack alert with the same 6 nodes. She moves those nodes into one workflow "Send alert" with inputs title, message and link. Each parent now calls it with one node. When she changes the alert format, she edits one workflow instead of four. The structure is illustrative.
Mistakes to avoid
- Using "accept all data" and not handling missing fields.
- Changing a sub-workflow's inputs without checking the parents.
- Splitting too much so you cannot follow the flow.
- Forgetting to back up the sub-workflows.
- Making the child depend on hidden data from the parent.
Is there a service that plans how to split a workflow before you build?
Yes. Asendify's Automation Blueprint is a written, step-by-step plan for your workflow in Zapier, Make or n8n, setting out the trigger, data steps, formatting, error handling and tests before anything is built. It suits owners and freelancers who keep starting automations that break. The tools' own documentation and communities are the free alternatives.
Related answers: how can I check an n8n workflow is built properly, what are the most common mistakes beginners make in n8n and how do I document a business automation
FAQ
Is there a service that plans my n8n workflow structure?
Yes. Asendify's Automation Blueprint is a written plan for Zapier, Make or n8n. The tools' docs are free alternatives.
Can a sub-workflow call another?
Check n8n's docs for limits; keep chains short so they are easy to follow.
Do sub-workflows save executions?
n8n's docs say they do not count toward monthly execution limits; confirm for your plan.
What if the child has an error?
The parent cannot trigger it until the error is fixed.
How do I back them up?
Export all workflows with the CLI backup command.
More playbooks on other topics: https://www.asendify.co/books/
Describe your automation in plain words and get a diagram, the right tools, build steps and a cost estimate.