n8n-subworkflows
Installation
SKILL.md
n8n Sub-workflows
Sub-workflows are reusable functions. The Execute Workflow Trigger declares input parameters, the body does work, the last node returns output. Callers invoke it like any other node.
That framing opens up the function-shaped wins: encapsulation, reuse, testability, replaceability. It's the primary reuse mechanism in n8n, and unfortunately underused.
Without sub-workflows, the same logic gets duplicated across workflows. Bug fixes happen in multiple places, one gets missed, and "identical" copies drift.
Non-negotiables
- Search before you build. Before writing logic that handles a generic problem, check if a sub-workflow already exists. Use
search_workflows({ query: 'Subworkflow' }),query: '<keyword>', etc. The MCP can't filter by tags, so naming is the discovery mechanism. Execute Workflow Triggeruses "Define Below" with typed fields, not passthrough. Define Below is the only mode that lets agent tools (fromAi) and structured callers pass values in. Two exceptions: (a) the sub-workflow specifically needs to receive binary (then it can't be wired as an agent tool directly), or (b) the sub-workflow takes no inputs at all (Define Below requires at least one field). See "Sub-workflow inputs and outputs" below.