n8n Automation Workflows
5 min read Workflows

How To Use Loop Over Items In n8n (Easy Guide)

Processing multiple items individually is a common automation challenge. This guide shows you how to use n8n's loop node to handle batch operations without writing code - perfect for API integrations, data transformations, and repetitive tasks.

What Is Loop Over Items Node?

The Loop Over Items node is n8n's solution for processing multiple records sequentially. Unlike parallel processing where items are handled simultaneously, this node ensures each item is processed one after another - crucial for operations where order matters or when working with APIs that have rate limits.

Common use cases include:

  • Processing batches of customer records from a CSV
  • Sending personalized emails to a list of contacts
  • Making sequential API calls with dependency between requests

Setting Up Your Workflow

Before adding the loop node, you need a workflow with multiple items to process. The manual trigger lets you test immediately without waiting for external events:

Pro Tip: Always name your nodes clearly (e.g., "Customer Data Batch" instead of "Set") to make complex workflows easier to debug.

To create test data:

  1. Add a Set node after the trigger
  2. Configure multiple fields/entries in the node
  3. Each entry becomes one item the loop will process

Configuring the Loop Node

Connecting the data source to the loop node is straightforward:

  1. Add the "Loop Over Items" node from the node panel
  2. Connect your data node (Set node in our example) to the loop node
  3. The connection automatically passes all items into the loop

The loop node has two special outputs:

  • Loop Output: Processes items one at a time
  • Done: Runs once after all items complete

Processing Individual Items

After the loop node, add your processing logic. This could be:

  • Another Set node for simple transformations
  • HTTP Request node for API calls
  • Email node for sending messages

Connect this node to the Loop Output of the loop node. This ensures:

  1. Each item processes individually
  2. You can access all item data in your processing node
  3. Execution waits for completion before moving to next item

Completing the Loop

The final step connects back to the loop node to continue processing:

  1. Connect your processing node's output back to the loop node
  2. This tells n8n to proceed with the next item
  3. When all items finish, execution exits via the Done output

Remember: Any node connected to Done runs just once after all looping completes - perfect for summary emails or final database updates.

Watch the Full Tutorial

See the loop node in action with timestamped examples from the video:

  • 1:15 - Setting up test data with multiple items
  • 2:30 - Connecting nodes for sequential processing
  • 3:45 - Viewing execution data for each loop iteration

Key Takeaways

Loop Over Items is n8n's solution for sequential processing where order matters or when working with rate-limited APIs.

To implement successfully:

  1. Start with a node that outputs multiple items (Set, HTTP Request, etc.)
  2. Connect to Loop Over Items node
  3. Add your processing logic to the Loop Output
  4. Connect back to complete the cycle
  5. Use Done output for final actions

Frequently Asked Questions

Common questions about looping in n8n

Loop nodes process items sequentially one after another, while merge nodes combine multiple inputs simultaneously. Use loops when order matters or when processing depends on previous results.

Merge is better for operations where items can be handled independently in parallel.

Yes, you can add rate limiting to your loop. The simplest method is adding a Delay node after your processing logic but before connecting back to the loop.

For more precise control, use the Schedule Trigger node to activate your workflow at specific intervals.

n8n provides several error handling options:

  • Add Error Trigger nodes to catch and log failures
  • Use the If node to validate data before processing
  • Configure nodes to continue on error when appropriate

n8n doesn't impose hard limits, but practical constraints exist:

  • Memory limits based on your hosting environment
  • Execution timeouts (especially on cloud plans)
  • API rate limits when making external calls

For large datasets, consider processing in batches of 100-1000 items.

Yes, n8n supports nested loops for complex workflows. However, be mindful of:

  • Exponential growth in processing time
  • Increased memory usage
  • Potential for infinite loops if not designed carefully

Always test nested loops with small datasets first.

The loop node automatically adds two special variables:

  • $input.index - Current iteration (0-based)
  • $input.loopId - Unique identifier for the loop

You can reference these in any expression within your loop processing.

Effective debugging strategies include:

  • Using the Manual Trigger for controlled testing
  • Adding Debug nodes at key points
  • Examining execution data for each iteration
  • Starting with small datasets (2-3 items)

GrowwStacks specializes in n8n workflow automation for businesses needing:

  • Custom looping solutions for batch processing
  • API integration patterns
  • Error handling strategies
  • Performance optimization

Book a free consultation to discuss your specific looping requirements.

Automate Your Batch Processing Today

Manual data processing wastes time and introduces errors. Let GrowwStacks build you a custom n8n workflow that handles your repetitive tasks automatically - freeing your team for higher-value work.