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.
Manual Trigger (Run Workflow)Node : Create Random Data (Code)
What it does : Simulates incoming data with multiple content ideas.
Code :
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: '' } } ];
Loop Over Items (SplitInBatches)Node : Create Captions (LangChain Agent)
Prompt :
idea: {{ $json.idea }}
System Message :
You are a helpful assistant creating captions for a LinkedIn post. Please create a LinkedIn caption for the idea.
Model : GPT-4o Mini or GPT-3.5
Credentials Required :
Tool: Inject Creativity (LangChain Tool)Output Table (Set)idea: ={{ $('Create Random Data').item.json.idea }}output: ={{ $json.output }}This workflow demonstrates:
Beginners will understand how item-level processing works in n8n and how powerful looping combined with AI can be.
Robert Breen
Automation Consultant | AI Workflow Designer | n8n Expert
📧 [email protected]
🌐 ynteractive.com
🔗 LinkedIn
n8n loops OpenAI LangChain workflow training beginner LinkedIn automation caption generator


