n8n Loop Over Items (Split in Batches): When You Need It and How It Works
By Abhishek Patoliya · 2026-08-16
Loop Over Items (still called Split in Batches in older workflows and in its internal name) takes a list of items and feeds it to the following nodes a batch at a time. The first thing to know is that most of the time you don't need it: n8n nodes already process every input item. This lesson covers the few cases where you do, how the loop works, rate-limit pacing and resuming after a failure.
Before you start: read the Aggregate node. Behaviour below follows n8n's Loop Over Items and "Looping" documentation as of 9 November 2026.
Do you need a loop at all?
An HTTP Request node that receives 500 items makes 500 requests; a Slack node receiving 20 items sends 20 messages. n8n's docs say that because nodes are built to process lists of items, you often don't need Loop Over Items. You do need it in these cases:
- Rate limits: you must pause between groups of requests (though the HTTP Request node has its own Batching option, below).
- Nodes that execute only once regardless of item count. n8n's documented list includes the Code node and the Execute Workflow node in "Run Once for All Items" mode, some database operations (for example Microsoft SQL insert/update/delete, MongoDB insert/update), Redis Info and RSS Read.
- Memory: you want to process a very large list in slices, for example calling a sub-workflow per batch.
- Repeating until a condition: for example paging through an API of unknown length (the node's Reset option, below). For ordinary pagination, try the HTTP Request node's built-in pagination first.
How the loop works
Get rows (2,000 items)
→ Loop Over Items (Batch Size: 50)
├─ loop → HTTP Request (50 calls) → Wait (2 s) ─┐
│ │ connect back to Loop Over Items
└─ done → Aggregate / Slack summary ◄──────────┘ (after the last batch)
- The node has two outputs. loop emits the next batch (Batch Size items) each time the node runs.
- The last node of the processing branch must connect back to Loop Over Items, which triggers the next batch.
- When all items have been sent, the node stops looping and done returns the combined results of every iteration. Put summaries and aggregation after done, not inside the loop.
The whole loop runs inside one workflow execution. Splitting 2,000 items into 40 batches doesn't create 40 executions, and it doesn't reset the execution's timeout or memory use. If you need separate, independently retryable executions, have the loop call a sub-workflow (Execute Workflow) per batch, or put batches on a queue that another workflow consumes.
Two expressions help inside the loop: {{ $('Loop Over Items').context['currentRunIndex'] }} (which batch this is, from 0) and {{ $('Loop Over Items').context['noItemsLeft'] }}.
Pacing for a rate limit
n8n's rate-limit guide gives two documented approaches. Pick the simplest that works:
- HTTP Request → Options → Batching: set Items per Batch and Batch Interval (ms). n8n describes this as equivalent to Loop Over Items plus Wait, with no extra nodes.
- Loop Over Items + Wait: put Loop Over Items before the node that calls the API, and a Wait node after it that connects back to the loop. Use this when several nodes per batch must be paced together.
Work the numbers out from the API's documented limit rather than guessing. For example, with 60 requests per minute and 20 items per batch, each batch is 20 requests, so allow at least 20 seconds per batch: 20 ÷ 60 × 60 s = 20 s, minus the time the requests themselves take. Add some margin, because other workflows may share the same API key. Rate limits are covered in depth in rate limiting in n8n.
Errors inside a batch
By default, one failing request stops the whole execution, including every remaining batch. For per-item tolerance, open the API node's Settings → On Error → Continue (using error output). Failed items leave on a separate error output that you can log or send to a review queue, while successful items continue around the loop. Add Retry On Fail (with Wait Between Tries) for transient errors. See error handling in n8n.
Resuming a long job after a failure
n8n won't resume a loop from batch 31 of 40 by itself. Make the job idempotent and resumable:
- Record each processed ID (or mark the source row as processed) as part of the batch, for example a database update after the API call succeeds.
- Select only unprocessed rows at the start:
SELECT … FROM invoices WHERE synced_at IS NULL LIMIT 2000.
- A rerun then continues where the last one stopped and never double-processes. For non-idempotent APIs (sending emails, charging cards), use an idempotency key if the API supports one.
Monitoring progress
A long loop is one execution, so the Executions list shows it as running until it finishes. For visibility, write a progress row every N batches (using currentRunIndex) to a table or a Slack thread, so a stalled job is noticed early.
Key takeaways
- Nodes already process all items; use Loop Over Items only for pacing, run-once nodes, memory or repeat-until logic.
- Connect the end of the branch back to the node; results arrive on done.
- The loop runs within one execution, so it doesn't reset timeouts or memory; use sub-workflows for separate executions.
- For simple API pacing, the HTTP Request node's Batching option is enough.
- Make long jobs resumable by recording processed IDs.
Exercise: generate 120 items with a Code node, loop in batches of 25 with a Wait of 1 second, and post currentRunIndex to a Slack or log node each pass. Confirm done outputs 120 items. Then replace the loop with the HTTP Request node's Batching option against a test API and compare. Next lesson: the Code node.
References (checked 9 November 2026)
Written by Abhishek Patoliya, Senior n8n Developer & Automation Architect, Surat, India. Verified n8n Creator.