Library / Building Blocks & Utilities
Building Blocks & Utilities
Learn Looping over Items in n8n for Beginners
When you run it, this tutorial shows how n8n loops through array items automatically and how the Loop Over Items node works explicitly.
What it does
# 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: - Built-In Looping: By default, most n8n nodes iterate over each item in an input array. - Explicit Looping: The Loop Over Items node allows controlled iteration, enabling custom batch processing and multi-step workflows. 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: json { "urls": [ "https://www.reddit.com", "https://www.n8n.io/", "https://n8n.io/", "https://supabase.com/", "https://duckduckgo.com/" ] } 📌 Steps to Paste Data: - Double-click the "Manual Trigger" node. - Click "Edit Output" (top-right corner). - Paste the JSON and Save. - The node turns purple, indicating that test data is pinned. --- ## Explanation of the n8n Nodes in the Workflow ### Manual Trigger This node starts the workflow manually and sends test data. Documentation: Manual Trigger Node ### Split Out (Split Array of Strings into Array of Objects) Extracts the urls array and splits it so that each URL becomes a separate JSON object. Documentation: Split Out Node ### Loop Over Items (Loop Over Items 1) Demonstrates how an unsplit array is treated as one item, processing it as a single unit. Documentation: Loop Over Items Node ### Loop Over Items (Loop Over Items 2) Processes the split array one item at a time. This demonstrates individual iteration and controlled looping. Documentation: Loop Over Items Node ### Wait Node Introduces a 1-second delay per iteration to demonstrate sequential execution. This can be removed for faster performance. Documentation: Wait Node ### Code Nodes (Add param1 to outputX) Each Code node adds a constant field (param1) to the data, ensuring that every item gets enriched with the same parameter. Documentation: Code Node ### NoOp Nodes (Result1, Result2, Result3, Result4, Result5) These nodes display the output at different stages of the workflow for inspection. Documentation: NoOp Node --- ## Execution Details ### 1. How the Workflow Runs - Manual Trigger starts execution with the pasted JSON data. - The workflow
The steps
- Result1
- Result2
- Split Array of Strings into Array of Objects
- Result3
- Result4
- Result5
- Paste JSON into this node
- Add param1 to output5
- Add param1 to output1
- Loop over Items 2
- Loop over Items 1
- Add param1 to output2
- Add param1 to output3
- Add param1 to output4
15 steps in total.
Similar automations
Building Blocks & UtilitiesLearn n8n Data Flow and Debugging Interactively53 stepsBuilding Blocks & UtilitiesLearn n8n Coding in an Interactive Game6 stepsCode, Git & Developer ToolsUse Slack as Debug Breakpoints for n8n Workflows7 stepsBuilding Blocks & UtilitiesLearn Data Sync with a Warehouse Inventory Audit10 steps