🎬 Loop over items — beginner example

4,794 views · 🎬 Content Creation & Video

Description

This workflow introduces beginners to one of the most fundamental concepts in n8n: looping over items. Using a simple use case—generating LinkedIn captions for content ideas—it demonstrates how to split a dataset into individual items, process them with AI, and collect the output for review or export.


✅ Key Features


🧰 What You’ll Need


🔧 Step-by-Step Setup

1️⃣ Run Workflow


2️⃣ Create Random Data

return [
  {
    json: {
      row_number: 2,
      id: 1,
      Date: '2025-07-30',
      idea: 'n8n rises to the top',
      caption: '',
      complete: ''
    }
  },
  {
    json: {
      row_number: 3,
      id: 2,
      Date: '2025-07-31',
      idea: 'n8n nodes',
      caption: '',
      complete: ''
    }
  },
  {
    json: {
      row_number: 4,
      id: 3,
      Date: '2025-08-01',
      idea: 'n8n use cases for marketing',
      caption: '',
      complete: ''
    }
  }
];

3️⃣ Loop Over Items


4️⃣ Create Captions with AI

idea: {{ $json.idea }}
You are a helpful assistant creating captions for a LinkedIn post. Please create a LinkedIn caption for the idea.

5️⃣ Inject Creativity (Optional)


6️⃣ Output Table


💡 Educational Value

This workflow demonstrates:

Beginners will understand how item-level processing works in n8n and how powerful looping combined with AI can be.


📬 Need Help or Want to Customize This?

Robert Breen
Automation Consultant | AI Workflow Designer | n8n Expert
📧 robert@ynteractive.com
🌐 ynteractive.com
🔗 LinkedIn


🏷️ Tags

n8n loops OpenAI LangChain workflow training beginner LinkedIn automation caption generator

🔗 Nodes Used

AI Agent, OpenAI Chat Model, Think Tool

📥 Import

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

📖 Importing guide · 🔑 Credential setup