Back to Blog

Try n8n free for 10 days

After trial, plans start from $7/mo. No charge until day 11.

n8ntutorialguideautomationworkflow

n8n Loop Over Items: Complete Guide to Iteration in 2026

n8nautomation TeamApril 28, 2026
TL;DR: The Loop Over Items node in n8n lets you process multiple items one at a time or in batches through recursive workflows. Perfect for API rate limits, sequential processing, or when you need complete control over how each item flows through your automation.

Understanding how n8n loop over items works is essential for building workflows that process multiple records, handle API rate limits, or need sequential execution control. Whether you're syncing hundreds of contacts, processing form submissions one by one, or building complex recursive workflows, the Loop Over Items node gives you complete control over iteration.

This guide covers everything from n8n's default item handling to advanced looping patterns you can build in production workflows.

How n8n Handles Items by Default

Before diving into loops, you need to understand how n8n processes multiple items automatically.

By default, when a node receives multiple items as input, n8n executes that node once for each item. This is called automatic iteration.

Here's what happens automatically:

  • A Google Sheets node returns 50 rows
  • Each row becomes one "item" in n8n
  • The next node (like HTTP Request) runs 50 times — once per item
  • All 50 requests happen in parallel

This works great for most workflows. But sometimes you need more control.

Tip: You can see how many items each node outputs in the workflow canvas. Look for the badge showing "X items" on each node.

When to Use Loop Over Items

The Loop Over Items node gives you control over iteration when automatic processing isn't enough.

Use Loop Over Items when you need to:

  • Respect API rate limits: Process items sequentially with delays between each iteration instead of hitting an API 100 times simultaneously
  • Control execution order: Ensure item 1 completes fully before item 2 starts
  • Build conditional loops: Skip or retry items based on results from previous iterations
  • Process batches: Handle 5 items at a time instead of all 500 at once
  • Implement recursive logic: Feed results from one iteration back into the loop
  • Manage memory usage: Process large datasets without overwhelming your n8n instance

If you're hitting rate limits, getting timeout errors, or need items processed in a specific order, Loop Over Items is your solution.

The Loop Over Items Node Explained

The Loop Over Items node is a special control node that creates a recursive workflow pattern.

Here's how it works:

  1. Input: The node receives multiple items (like 100 customer records)
  2. Output: It sends items through its "loop" output in batches you define (like 1 or 5 at a time)
  3. Recursion: After processing, items return to the Loop Over Items node via its second input
  4. Completion: When all items are processed, the workflow exits through the "done" output

The node has three connection points:

  • Input (top): Receives your data source (initial items to loop through)
  • Loop output (right): Sends current batch into your processing workflow
  • Done output (bottom): Exits when all items are processed

Key configuration options:

  • Batch Size: How many items to process per iteration (default: 1)
  • Pause Between Iterations: Add delays to respect rate limits (in milliseconds)

Build Your First Loop Workflow

Let's build a practical example: processing Airtable records one at a time to enrich them with API data.

Scenario: You have 50 customer records in Airtable. For each one, you need to call an external API to get company data, then update the Airtable record with enriched information.

Here's how to build it step by step:

  1. Add an Airtable node (set to "List" operation)
    • Configure your base and table
    • This returns all 50 records
  2. Add the Loop Over Items node
    • Connect it to the Airtable node output
    • Set Batch Size to 1 (process one record at a time)
    • Set Pause to 1000 (1 second delay between iterations)
  3. Add an HTTP Request node
    • Connect it to the Loop Over Items "loop" output
    • Configure your enrichment API endpoint
    • Use expressions to reference the current item: {{ $json.customer_email }}
  4. Add an Airtable node (set to "Update" operation)
    • Connect it to the HTTP Request output
    • Map the enriched data back to Airtable fields
    • Use {{ $('Loop Over Items').item.json.record_id }} to reference the original record ID
  5. Connect back to Loop Over Items
    • Take the Airtable Update output and connect it back to the Loop Over Items node's second input (the recursion point)
    • This tells the loop to continue with the next item
  6. Add a final notification node (optional)
    • Connect to the "done" output of Loop Over Items
    • Send a Slack message or email when all items are processed

When you execute this workflow, you'll see items process one by one with a 1-second pause between each. This prevents overwhelming the API and keeps your workflow stable.

Tip: Start with a small batch size (1-5 items) when testing. You can always increase it once you confirm the workflow works correctly.

Advanced Looping Patterns

Once you understand the basics, you can build more sophisticated loop workflows.

Pattern 1: Batch Processing with Progress Tracking

Process items in batches of 10 and track progress:

  1. Set Loop Over Items batch size to 10
  2. Add a Code node after your processing logic
  3. Calculate progress: const processed = $('Loop Over Items').itemIndex; const total = $('Loop Over Items').params.maxIterations; return { processed, total, percent: (processed/total*100).toFixed(1) };
  4. Send progress updates to Slack every batch

Pattern 2: Conditional Loop Exit

Stop the loop early when a condition is met:

  1. Add an IF node inside your loop
  2. Check if a specific condition is true (like "credits exhausted" or "error count > 5")
  3. If true, route to a NoOp node and skip the loop return
  4. If false, continue normal loop flow back to Loop Over Items

Pattern 3: Error Handling with Retry Logic

Retry failed items without restarting the entire loop:

  1. Add error handling to nodes inside your loop (enable "Continue On Fail" in node settings)
  2. Add an IF node after processing: check if the operation succeeded
  3. On failure: route to a Wait node (delay 5 seconds), then try again up to 3 times
  4. On success or after 3 failures: continue to loop return
  5. Log failed items to a Google Sheet for manual review

Pattern 4: Nested Loops

Process multiple levels of data (like customers → orders → line items):

  1. Outer loop: Loop Over Items for customers
  2. Inside customer loop: HTTP Request to fetch their orders
  3. Inner loop: Second Loop Over Items for each customer's orders
  4. Process each order, return to inner loop
  5. When inner loop completes, return to outer loop
Note: Nested loops can get complex quickly. Always test with small datasets first and consider if you can flatten your data structure instead.

Common Loop Pitfalls and How to Fix Them

Loop workflows can be tricky. Here are the most common issues and their solutions:

Issue 1: Infinite Loops

Problem: Workflow never exits the loop, runs forever.

Causes:

  • Forgot to connect the loop return wire back to Loop Over Items
  • Loop condition never becomes false
  • Loop Over Items node isn't receiving the completion signal

Solution: Always ensure every execution path inside your loop eventually connects back to the Loop Over Items node's second input. Add a maximum iteration safeguard using an IF node.

Issue 2: Wrong Item References

Problem: Nodes inside the loop use data from the wrong item.

Cause: Using {{ $json.field }} instead of specifying which node's data you need.

Solution: Inside loops, always reference the specific node: {{ $('Loop Over Items').item.json.field }} for the original input item, or {{ $('HTTP Request').json.response }} for data from inside the loop.

Issue 3: Memory Issues with Large Datasets

Problem: Workflow crashes or slows down when processing thousands of items.

Solution: Increase batch size to 20-50 items. This processes more items per iteration while still controlling execution. If you're on n8nautomation.cloud, your dedicated instance can handle larger workloads without memory constraints.

Issue 4: Rate Limit Errors

Problem: External API returns 429 errors even with loops.

Solution: Increase the pause duration between iterations. Start at 1000ms (1 second), increase to 2000ms or more if errors persist. Check the API's rate limit documentation for guidance.

Loop Performance and Best Practices

Loops add execution time to your workflows. Here's how to optimize them:

Choose the Right Batch Size

  • Batch size 1: Maximum control, slowest execution. Use for strict rate limits or when each item must complete before the next starts.
  • Batch size 5-10: Good balance for most use cases. Respects rate limits while maintaining reasonable speed.
  • Batch size 50+: Fast processing when rate limits aren't an issue. Only use when you've tested thoroughly.

Minimize Pause Durations

Don't add pauses "just in case." Test your workflow without pauses first. Only add delays if you encounter rate limit errors. Start with the minimum pause that prevents errors.

Use Loops Only When Necessary

Remember: n8n's automatic iteration is faster. Only use Loop Over Items when you specifically need sequential processing, rate limiting, or conditional logic.

If your workflow just needs to process all items without special control, let n8n handle it automatically.

Monitor Long-Running Loops

For workflows that process hundreds or thousands of items:

  • Add progress logging inside the loop (send count to Slack every 50 items)
  • Include timestamps to track execution speed
  • Set up error notifications so you know if the loop fails mid-execution
  • Consider splitting very large datasets into multiple workflow executions

Test with Small Datasets First

Always test loop logic with 5-10 items before running on your full dataset. Add an IF node at the start: {{ $itemIndex < 10 }} to limit test runs.

Tip: On n8nautomation.cloud, you get dedicated resources starting at $7/month, so your loop workflows run reliably without competing for resources with other users.

Document Your Loop Logic

Loops make workflows harder to understand at a glance. Add Sticky Note nodes explaining:

  • What the loop is processing
  • Why sequential processing is necessary
  • What the batch size and pause settings mean
  • Any special conditions that affect loop behavior

Your future self (and your team) will thank you.

Real-World Loop Performance Numbers

Here's what to expect when processing 100 items:

  • Automatic iteration (no loop): ~10-30 seconds (parallel execution)
  • Loop with batch size 1, no pause: ~2-5 minutes
  • Loop with batch size 1, 1-second pause: ~100+ seconds (1.6 minutes minimum)
  • Loop with batch size 10, 1-second pause: ~20-30 seconds

These are estimates. Your actual execution time depends on how long each item takes to process.

The Loop Over Items node is one of n8n's most powerful features for building production-grade workflows. It gives you complete control over how items flow through your automation — from respecting API rate limits to implementing complex conditional logic.

Start with simple one-item-at-a-time loops to get comfortable with the pattern. Once you understand the recursion concept, you can build sophisticated workflows that handle any data processing challenge.

Whether you're syncing thousands of records between systems, enriching data from external APIs, or building complex multi-step processes, the Loop Over Items node ensures your n8n workflows stay stable, predictable, and maintainable.

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.