Create nested data processing loops using n8n sub-workflows
Ready for 3.0What this workflow does
This workflow has 8 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). It uses only n8n's built-in nodes.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).
- Colors (Code): runs custom JavaScript code
- Integers (Code): runs custom JavaScript code
- Loop Over Colors (Loop Over Items (Split in Batches)): loops over the items in batches
- Loop Over Integers (Loop Over Items (Split in Batches)): loops over the items in batches
- Execute Sub-workflow: calls another n8n workflow
- Edit Fields (Edit Fields (Set)): sets 1 field: result
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (6)
- Manual Trigger
n8n-nodes-base.manualTrigger - Code
n8n-nodes-base.code - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Edit Fields (Set)
n8n-nodes-base.set - Execute Sub-workflow
n8n-nodes-base.executeWorkflow
From the author
Nested Loops with Sub-workflows Template Description This template provides a practical solution for a common n8n challenge: creating nested loops. While a powerful feature, n8n's standard Loop nodes don't work as expected in a nested structure. This template…