n8n-subworkflows
Skill by czlonkowski
Teaches an AI assistant how to build reusable n8n sub-workflows with typed inputs, clear return contracts, and correct all-vs-each execution. Aimed at people building n8n automations who want shared, modular logic.
Install n8n-subworkflows
Built from the published package, never by AI.
git clone --depth 1 https://github.com/czlonkowski/n8n-mcp /tmp/n8n-mcp && mkdir -p ~/.claude/skills && cp -r /tmp/n8n-mcp/data/skills/n8n-subworkflows ~/.claude/skills/n8n-subworkflowsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/czlonkowski/n8n-mcp /tmp/n8n-mcp && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/n8n-mcp/data/skills/n8n-subworkflows ~/.gemini/antigravity-cli/skills/n8n-subworkflowsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill is a guide for building reusable sub-workflows in n8n. It explains that a sub-workflow works like a function: an Execute Workflow Trigger declares typed inputs, the body does the work, and the last node returns the output. It covers when to extract logic into a sub-workflow, how to search for existing ones before building new ones, and how to use the Define Below input mode with typed fields.
The skill also covers stateless versus stateful design, the contract rules for inputs and outputs, and the mode settings (all versus each) and waitForSubWorkflow on the Execute Workflow node. It recommends verb-first naming so workflows can be found later. It is written for n8n builders who want modular workflows, and it refers to other skills and files for related patterns.
Written from the project's SKILL.md and checked against it.
What it can do
- Decide when to extractGuides whether logic should become a sub-workflow based on reuse, size and coupling.
- Define typed inputsSets up the Execute Workflow Trigger with Define Below typed fields such as string, number, boolean, array and object.
- Choose all or each modeExplains when an Execute Workflow call should run once with all items or once per item.
- Design return contractsDescribes returning consistent output shapes and returning errors for expected failures.
- Name for discoveryRecommends verb-first workflow names so they can be found by search before rebuilding.
- Split by input shapeDescribes separating sub-workflows whose input paths have genuinely different contracts.
What you need
- n8n with Execute Workflow nodes
- n8n MCP access token for testing pinned sub-workflows
Try asking
- Extract this date parsing logic into a reusable n8n sub-workflow
- Check whether a sub-workflow already exists before I build this step
- Should I run this Execute Workflow node in all mode or each mode?
Good to know
- Define Below requires at least one input field, so no-argument operations need passthrough
- Typed input fields are JSON only, so binary data needs passthrough
- The community MCP cannot filter workflows by tag
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: data/skills/n8n-subworkflows/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
NAMING_AND_DISCOVERY.md6 KB -
README.md8 KB -
SKILL.md20 KB -
SUBWORKFLOW_PATTERNS.md9 KB
Alternatives to n8n-subworkflows
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
n8n-subworkflows: common questions
When should I use an n8n sub-workflow?
Use one when logic could be needed in another workflow, such as auth, retry, parsing or formatting. The source advises against extracting a single HTTP call with no logic around it.
What is the difference between mode all and mode each in n8n?
With all, the sub-workflow runs once with all items. With each, it runs once per item, which suits bodies that assume a single item.
Why should sub-workflow inputs use Define Below?
Define Below gives callers a typed schema, which lets an AI agent fill values through $fromAI and lets structured callers map fields cleanly.
How do I install n8n-subworkflows?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is n8n-subworkflows free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is n8n-subworkflows safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to n8n-subworkflows?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
