Looping & Iteration

Process multiple items efficiently in N8N, Zapier, and Make

Looping allows you to process multiple items (arrays, lists, records) one at a time in your workflow. This is essential when working with bulk data, API responses with multiple results, or any scenario where you need to repeat actions for each item.

When You Need Loops

📧

Processing Multiple Records

Get 20 new leads from database → Send personalized email to each

🤖

Batch AI Processing

Analyze sentiment of each customer review individually

🔄

Data Transformation

Process each row from spreadsheet to update CRM records

📄

Document Processing

Extract data from multiple uploaded files one by one

🔵

Looping in N8N

N8N processes arrays automatically - each item flows through subsequent nodes

Automatic Item Processing

N8N's default behavior is to automatically loop through items. When a node outputs multiple items, the next node processes each one individually.

Example Flow:

1 Google Sheets → Returns 10 rows
2 OpenAI node → Automatically processes each of the 10 rows
3 Gmail node → Sends 10 individual emails

Split In Batches Node

For explicit loop control or when you need to process items in batches, use the Split In Batches node.

Configuration:

Batch Size: Number of items to process per batch (e.g., 5)

Options: Reset on each workflow execution

How It Works:

  • 1. Add Split In Batches node after your data source
  • 2. Process the batch with your action nodes
  • 3. Connect the output BACK to the Split In Batches node
  • 4. The loop continues until all items are processed
  • 5. Use the "Done" output to continue workflow after loop

Loop Over Items Node

The Loop Over Items node provides more advanced control over iteration.

  • • Loop through items from previous node
  • • Access current item and loop metadata
  • • Break out of loops conditionally
  • • Process nested arrays

Example: Process Multiple Leads

1

Airtable: Get all leads with status "New"

2

Split In Batches: Process 5 leads at a time (to respect API limits)

3

OpenAI: Generate personalized outreach for each lead

4

Wait: 2-second delay between API calls

5

Gmail: Send email to lead (loops back to step 2 until done)

6

Airtable: Update all leads to "Contacted" (from Done output)

Looping in Zapier

Zapier uses the Looping by Zapier app for explicit iteration

Understanding Zapier's Approach

Unlike N8N, Zapier doesn't automatically loop through arrays. You need to explicitly add the Looping by Zapier app to process multiple items.

⚠️

Important:

Each loop iteration counts as a separate task in your Zapier billing. A loop processing 100 items = 100 tasks.

Using Looping by Zapier

Step-by-Step:

1

Add Looping by Zapier Action

Choose "Create Loop from Line Items" action

2

Map Your Data

Select the field that contains your list of items (line items)

3

Add Actions for Each Item

Steps after the loop run once per item

4

Reference Loop Data

Use {{Loop Value}} to access the current item

Example Configuration:

Loop by Zapier: Create Loop from Line Items
↳ Values: {{1.emails}} (comma-separated list)

ChatGPT: Create Completion
↳ Prompt: Write email to {{Loop Value}}

Gmail: Send Email
↳ To: {{Loop Value}}
↳ Body: {{ChatGPT Output}}

Alternative: Multiple Triggers

Some triggers naturally handle multiple items without needing the Loop app:

  • New Row in Spreadsheet: Triggers once per new row
  • New Email: Triggers for each new email
  • New Record in Airtable: Triggers per record

This approach is more efficient as each trigger = 1 task, rather than 1 task per loop iteration.

Example: Bulk Email Personalization

1

Google Sheets: New Row (triggers for each row)

2

ChatGPT: Generate personalized message for {{Name}}

3

Delay: Wait 5 seconds (respect rate limits)

4

Gmail: Send email to {{Email}}

Note: This Zap runs automatically for each new row added to the sheet. No explicit loop needed!

🔮

Looping in Make

Make has powerful built-in tools for handling arrays and iteration

Automatic Array Handling

Like N8N, Make automatically processes arrays. When a module outputs multiple bundles (items), subsequent modules process each bundle individually.

Key Concept: Bundles

In Make, each item is called a "bundle". If a module outputs 10 bundles, the next module runs 10 times automatically.

Iterator Module

Use the Iterator module when you have an array nested inside a bundle and need to process each array element.

When to Use Iterator:

  • • An API returns an object with an array of items inside
  • • You need to process nested arrays
  • • You want to split one bundle into multiple bundles

Example Scenario:

API Response (1 bundle):
{
  "order_id": "12345",
  "items": [
    {"product": "Widget A", "qty": 2},
    {"product": "Widget B", "qty": 1},
    {"product": "Widget C", "qty": 5}
  ]
}

Add Iterator Module:
↳ Array: {{items}}

Result: 3 bundles (one per product)
↳ Bundle 1: Widget A
↳ Bundle 2: Widget B
↳ Bundle 3: Widget C

Array Aggregator Module

The Array Aggregator does the opposite - it combines multiple bundles back into a single array.

Use Cases:

  • • After processing items individually, combine results for bulk update
  • • Generate a summary report from multiple processed items
  • • Create a CSV file from multiple records

Pattern:

Iterator (split) → Process each item → Array Aggregator (combine) → Send combined result

Repeater Module

The Repeater module repeats an action a specific number of times, like a traditional for-loop.

  • • Set the number of repetitions (e.g., 10)
  • • Access the current iteration number
  • • Useful for pagination or scheduled retries

Example: Process Survey Responses

1

Google Sheets: Watch Rows (returns multiple rows)

2

OpenAI: Analyze sentiment (runs for each row automatically)

3

Array Aggregator: Combine all sentiment results

4

OpenAI: Generate summary report from aggregated data

5

Slack: Post summary to #customer-feedback channel

Best Practices for Looping

1. Respect Rate Limits

When looping through API calls (especially LLMs), add delays between iterations to avoid hitting rate limits.

  • N8N: Add a Wait node inside your loop
  • Zapier: Add Delay by Zapier action
  • Make: Add Sleep module between operations

2. Process in Batches

For large datasets, process items in smaller batches to improve reliability and manage costs.

Example:

Instead of: Process 1,000 items at once
Do: Process 50 items, wait 1 minute, repeat

3. Add Error Handling

Don't let one failed item break your entire loop. Implement error handling for individual items.

  • • Log failures to a separate spreadsheet or database
  • • Continue processing remaining items
  • • Send summary of failures after loop completes

4. Monitor Execution Time

All platforms have execution time limits:

  • N8N: Configurable timeout (default varies)
  • Zapier: 30 seconds for free, up to 2 minutes on paid plans
  • Make: 40 seconds to 15 minutes depending on plan

For long-running loops, split into multiple scenario runs or use async processing.

5. Track Progress

For long loops, track progress so you can resume if something fails:

  • • Mark processed items in your data source
  • • Use a "processed" flag or timestamp
  • • Store last processed item ID in a data store

6. Consider Cost

Looping affects your usage differently on each platform:

  • N8N (self-hosted): No additional cost per loop
  • Zapier: Each loop iteration = 1 task
  • Make: Each operation in the loop counts toward your limit

Common Looping Patterns

📧 Bulk Email Personalization

Get list → Loop through contacts → Generate personalized message → Send email

Add delay between sends to avoid spam filters

📄 Batch Document Processing

Get documents → Loop through files → Extract data with LLM → Store in database

Process in batches of 10-20 for reliability

🔄 Data Sync Operations

Get records from source → Loop and check if exists in destination → Create or update each

Track last sync timestamp to process only new items

📊 Multi-Item Analysis

Get items → Loop and analyze each → Aggregate results → Generate summary report

Use aggregator modules to combine individual results

Troubleshooting Loops

Problem: Loop not executing

Check that previous step is returning an array. Use a debug step to inspect data structure.

Problem: Loop runs too many times

Verify your array isn't nested. You may need to use an iterator to access the actual array.

Problem: Loop times out

Process in smaller batches or split into multiple workflow runs. Consider async processing for large datasets.

Problem: High task/operation usage

Each loop iteration counts toward your limits. Consider if bulk operations or API batch endpoints would be more efficient.