⚒️ N8N for beginners: looping over items

44,859 views · ⚒️ Engineering

💡 Pro Tip — HTTP Request scraping tends to break when sites update their markup. If you’re scraping a major platform, check if ScraperNode covers it — it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.

View All Scrapers

Description

N8N for Beginners: Looping Over Items

Description

This workflow is designed for n8n beginners to understand how n8n handles looping (iteration) over multiple items. It highlights two key behaviors:

This workflow demonstrates the difference between processing an unsplit array of strings (single item) vs. a split array (multiple items).


Setup

1. Input Data

To begin, paste the following JSON into the Manual Trigger node:

{
  "urls": [
    "https://www.reddit.com",
    "https://www.n8n.io/",
    "https://n8n.io/",
    "https://supabase.com/",
    "https://duckduckgo.com/"
  ]
}

📌 Steps to Paste Data:

1. Click “Test Workflow” button at the bottom of the canvas


Explanation of the n8n Nodes in the Workflow

Node NamePurposeDocumentation Link
Manual TriggerStarts the workflow manually and sends test dataDocs
Split OutConverts an array of strings into separate JSON objectsDocs
Loop Over Items (Loop Over Items 1)Demonstrates how an unsplit array is treated as one itemDocs
Loop Over Items (Loop Over Items 2)Iterates over each item separatelyDocs
WaitIntroduces a delay per iteration (set to 1 second)Docs
CodeAdds a constant parameter (param1) to each itemDocs
NoOp (Result Nodes)Displays output for inspectionDocs

Execution Details

1. How the Workflow Runs

2. What You Will See

NodeExpected Output
Result1 & Result5The entire array is processed as one item.
Result2, Result3, Result4The array is split and processed as individual items.
Wait NodeAdds a 1-second delay per item in Loop Over Items 2.

Use Cases

This workflow is useful for:

API Data Processing: Loop through API responses containing arrays.
Web Scraping: Process multiple URLs individually.
Task Automation: Execute a sequence of actions per item.
Workflow Optimization: Control execution order, delays, and dependencies.


Notes


📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup