Templates / Create nested data processing loops using n8n sub-workflows

Create nested data processing loops using n8n sub-workflows

Ready for 3.0

by Viktor Klepikovskyi ✓ · 533 views · created 2025-09-13 · Engineering

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What 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).

  1. Colors (Code): runs custom JavaScript code
  2. Integers (Code): runs custom JavaScript code
  3. Loop Over Colors (Loop Over Items (Split in Batches)): loops over the items in batches
  4. Loop Over Integers (Loop Over Items (Split in Batches)): loops over the items in batches
  5. Execute Sub-workflow: calls another n8n workflow
  6. 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)

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…

Excerpt from Viktor Klepikovskyi's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.