# Loop inside loop: Loop Node does not run over all the items

**URL:** <https://community.n8n.io/t/loop-inside-loop-loop-node-does-not-run-over-all-the-items/210435>\
**Category:** Questions\
**Tags:** loop-over-items\
**Created:** [October 23, 2025, 12:06pm UTC](https://community.n8n.io/t/loop-inside-loop-loop-node-does-not-run-over-all-the-items/210435 "2025-10-23T12:06:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sona\_Darbinyan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sona_darbinyan/32/59218_2.png) [@Sona\_Darbinyan](https://community.n8n.io/u/Sona_Darbinyan)\
**Post date:** [October 23, 2025, 12:06pm UTC](https://community.n8n.io/t/loop-inside-loop-loop-node-does-not-run-over-all-the-items/210435/1 "2025-10-23T12:06:04Z")

</div>

## Describe the problem/error/question: the loop node inside another loop does not ru over all items . It is looping only the first time. starting from the 2nd items it is not looping.

## What is the error message (if any)?

## Please share your workflow: {

“nodes”: [  
{  
“parameters”: {  
“assignments”: {  
“assignments”: [  
{  
“id”: “9aa7df86-846b-46d9-98c4-8fc5101750b0”,  
“name”: “ad\_library\_url”,  
“value”: “={{ $json.ad\_library\_url }}”,  
“type”: “string”  
},  
{  
“id”: “cadec2df-0c46-43ea-9943-dbbd00c2da6f”,  
“name”: “page\_name”,  
“value”: “={{ $json.page\_name }}”,  
“type”: “string”  
},  
{  
“id”: “2febee31-7991-4efd-97b4-70f74b8b709a”,  
“name”: “display\_format”,  
“value”: “={{ $json.snapshot.display\_format }}”,  
“type”: “string”  
},  
{  
“id”: “b33dc845-c73c-4136-ba85-a4320121b843”,  
“name”: “headline”,  
“value”: “={{ $json.snapshot.title }}”,  
“type”: “string”  
},  
{  
“id”: “20ec68a7-7e38-435a-83e8-de0294cc6f93”,  
“name”: “primary\_text”,  
“value”: “={{ $json.snapshot.body.text }}”,  
“type”: “string”  
},  
{  
“id”: “d82aec4d-027c-46be-996b-03994100dc64”,  
“name”: “link\_url”,  
“value”: “={{ $json.snapshot.link\_url }}”,  
“type”: “string”  
},  
{  
“id”: “ff13dc6d-a1f3-448b-9165-b2f00da5cbaf”,  
“name”: “cards”,  
“value”: “={{ $json.snapshot.cards }}”,  
“type”: “array”  
},  
{  
“id”: “90139302-cb93-4e92-a737-052e54e74db2”,  
“name”: “targets\_eu”,  
“value”: “={{ $json.aaa\_info.targets\_eu }}”,  
“type”: “number”  
},  
{  
“id”: “42ff6977-084f-4fdb-9f42-ff3ec7133759”,  
“name”: “eu\_total\_reach”,  
“value”: “={{ $json.aaa\_info.eu\_total\_reach }}”,  
“type”: “number”  
}  
]  
},  
“options”: {}  
},  
“type”: “n8n-nodes-base.set”,  
“typeVersion”: 3.4,  
“position”: [  
1744,  
3328  
],  
“id”: “0d2d55f3-b743-4f48-8f2f-e222264baead”,  
“name”: “Carousel Ads: Keeping Fields”  
},  
{  
“parameters”: {  
“rules”: {  
“values”: [  
{  
“conditions”: {  
“options”: {  
“caseSensitive”: true,  
“leftValue”: “”,  
“typeValidation”: “strict”,  
“version”: 2  
},  
“conditions”: [  
{  
“leftValue”: “={{ $json.video\_hd\_url }}”,  
“rightValue”: “null”,  
“operator”: {  
“type”: “string”,  
“operation”: “notExists”,  
“singleValue”: true  
},  
“id”: “03cb173b-4378-4cbe-b855-7117b68866c2”  
}  
],  
“combinator”: “and”  
},  
“renameOutput”: true,  
“outputKey”: “Image”  
},  
{  
“conditions”: {  
“options”: {  
“caseSensitive”: true,  
“leftValue”: “”,  
“typeValidation”: “strict”,  
“version”: 2  
},  
“conditions”: [  
{  
“id”: “a8ace343-6cc2-4a1a-80bb-0352f32a37d4”,  
“leftValue”: “={{ $json.original\_image\_url }}”,  
“rightValue”: “null”,  
“operator”: {  
“type”: “string”,  
“operation”: “notExists”,  
“singleValue”: true  
}  
}  
],  
“combinator”: “and”  
},  
“renameOutput”: true,  
“outputKey”: “Video”  
}  
]  
},  
“options”: {}  
},  
“type”: “n8n-nodes-base.switch”,  
“typeVersion”: 3.3,  
“position”: [  
2992,  
3360  
],  
“id”: “78dea684-ec6f-404a-b6f6-7a09e1a08024”,  
“name”: “Switch”  
},  
{  
“parameters”: {  
“options”: {}  
},  
“type”: “n8n-nodes-base.splitInBatches”,  
“typeVersion”: 3,  
“position”: [  
1920,  
3328  
],  
“id”: “4a539347-95c9-4f64-bd9f-0eb850280336”,  
“name”: “Loop Over Items”  
},  
{  
“parameters”: {  
“jsCode”: “// Input shape examples supported:\n// 1) [{ cards: […] } ] // your sample\n// 2) [{ cards: […] }, { … } ] // multiple ads (optional)\n\n// Get the first input item’s JSON\nconst root = items[0]?.json;\n\n// Normalize to an array of “ads”\nconst ads = Array.isArray(root) ? root : [root];\n\n// Flatten cards → one output item per card\nconst out = ;\nads.forEach((ad, adIndex) =\> {\n const cards = Array.isArray(ad?.cards) ? ad.cards : ;\n cards.forEach((card, cardIndex) =\> {\n out.push({\n json: {\n adIndex,\n cardIndex,\n totalCards: cards.length,\n …card, // includes body, caption, cta, urls, etc.\n }\n });\n });\n});\n\nreturn out.length ? out : [{ json: { warning: ‘No cards found’ } }];\n”  
},  
“type”: “n8n-nodes-base.code”,  
“typeVersion”: 2,  
“position”: [  
2384,  
3344  
],  
“id”: “81fe04ff-9434-477a-8234-7afac83af6bb”,  
“name”: “Code for separating the cards”,  
“alwaysOutputData”: false  
},  
{  
“parameters”: {  
“assignments”: {  
“assignments”: [  
{  
“id”: “bf24b0f9-2e59-4ddf-b043-c8754dab6328”,  
“name”: “cards”,  
“value”: “={{ $json.cards }}”,  
“type”: “array”  
}  
]  
},  
“options”: {}  
},  
“type”: “n8n-nodes-base.set”,  
“typeVersion”: 3.4,  
“position”: [  
2144,  
3344  
],  
“id”: “f27b43a0-f77c-4b45-a83c-5d35b3cb0219”,  
“name”: “Array of Cards”  
},  
{  
“parameters”: {  
“assignments”: {  
“assignments”: [  
{  
“id”: “48a2ae58-f424-48dc-91a0-e1c79ac7709f”,  
“name”: “ad\_library\_url”,  
“value”: “={{ $json.ad\_library\_url }}”,  
“type”: “string”  
},  
{  
“id”: “f63100ed-9c12-43c7-a94e-9642007e1bc9”,  
“name”: “page\_name”,  
“value”: “={{ $json.page\_name }}”,  
“type”: “string”  
},  
{  
“id”: “f06a6a33-2543-451d-909a-b4a653ae9443”,  
“name”: “display\_format”,  
“value”: “={{ $json.display\_format }}”,  
“type”: “string”  
},  
{  
“id”: “2ee8d2a2-2378-4ce5-acfa-1bce5ab83fdd”,  
“name”: “headline”,  
“value”: “={{ $json.headline }}”,  
“type”: “string”  
},  
{  
“id”: “19bc7948-b675-43db-bc13-f4bc3459cfa8”,  
“name”: “primary\_text”,  
“value”: “={{ $json.primary\_text }}”,  
“type”: “string”  
},  
{  
“id”: “89712548-6031-4b9f-81c0-86a0e0944c1e”,  
“name”: “link\_url”,  
“value”: “={{ $json.link\_url }}”,  
“type”: “string”  
},  
{  
“id”: “e21b2d17-bfd7-4bf8-aa82-c459a8529db7”,  
“name”: “creative\_url”,  
“value”: “={{ $json.cards[0].resized\_image\_url }}”,  
“type”: “string”  
},  
{  
“id”: “7d559126-ba62-4339-802e-875463251f20”,  
“name”: “targets\_eu”,  
“value”: “={{ $json.targets\_eu }}”,  
“type”: “boolean”  
},  
{  
“id”: “83f17cf1-b677-401f-a7cb-be01ff9d49db”,  
“name”: “eu\_total\_reach”,  
“value”: “={{ $json.eu\_total\_reach }}”,  
“type”: “number”  
}  
]  
},  
“options”: {}  
},  
“type”: “n8n-nodes-base.set”,  
“typeVersion”: 3.4,  
“position”: [  
1920,  
3568  
],  
“id”: “baf323b0-10d5-467c-93dc-0e2d472e26d5”,  
“name”: “Passing Carousel Ad Data”  
},  
{  
“parameters”: {  
“url”: “={{ $json.resized\_image\_url }}”,  
“options”: {  
“redirect”: {  
“redirect”: {  
“followRedirects”: false  
}  
}  
}  
},  
“type”: “n8n-nodes-base.httpRequest”,  
“typeVersion”: 4.2,  
“position”: [  
3376,  
3120  
],  
“id”: “a883bbf2-023c-4964-bd0e-663d63b344fc”,  
“name”: “HTTP Request2”,  
“alwaysOutputData”: true,  
“onError”: “continueErrorOutput”  
},  
{  
“parameters”: {  
“promptType”: “define”,  
“text”: “You are a senior advertising creative analyst. You will receive an image with this prompt. Analyze it thoroughly.\n\nTask:\nWhat’s in this image? Analyze it extremely comprehensively.\n\nReturn ONLY a valid JSON object (no prose, no markdown, no backticks) with this exact schema and keys:\n\n{\n “visual\_analysis”: “”,\n “hook\_elements”: ,\n “main\_offer”: “”,\n “psychological\_triggers”: \n}\n\nInstructions:\n- Base everything strictly on what is visible in the image. Do not guess. If a field is not clearly present, use “” or .\n\n- visual\_analysis: begin with a concise factual inventory of all visible elements (people/objects, product renders, logos, badges, UI, background, colors, lighting, and all on-image text verbatim). Then analyze how those elements work together:\n • Focal points & visual hierarchy (what captures attention first, second, third)\n • Composition & layout (placement/safe zones, spacing, balance, crops)\n • Color/contrast strategy and readability\n • Information flow and message framing (benefit, proof, urgency, social proof, etc.)\n • Brand cues (logos, typography, device/product presentation)\n • Likely effect on attention/comprehension and fit for placement (e.g., feed/story/mobile)\n Keep the analysis grounded in visible evidence.\n\n- hook\_elements: up to 3 short hooks the creative uses or implies; use exact on-image wording when applicable.\n\n- main\_offer: the core value proposition or offer exactly as written on the image; if none, return “”.\n\n- psychological\_triggers: 3 triggers supported by the visuals only (e.g., novelty, authority, scarcity, social proof, convenience, time saving, FOMO).\n\nFormatting rules:\n- Output must be valid JSON. No extra keys. No trailing commas.\n- Escape quotes inside strings. Keep arrays as flat strings.\n- Do not include any explanatory text outside the JSON.\n\nIf the image cannot be accessed or read, return the same JSON with empty values.\n”,  
“hasOutputParser”: true,  
“options”: {}  
},  
“type”: “@n8n/n8n-nodes-langchain.agent”,  
“typeVersion”: 2.2,  
“position”: [  
4048,  
3104  
],  
“id”: “5c785fb2-16e3-4994-adf6-ad5d13cb6d28”,  
“name”: “AI Agent2”,  
“retryOnFail”: true,  
“onError”: “continueRegularOutput”  
},  
{  
“parameters”: {  
“model”: {  
“\_\_rl”: true,  
“mode”: “list”,  
“value”: “gpt-4.1-mini”  
},  
“options”: {}  
},  
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,  
“typeVersion”: 1.2,  
“position”: [  
4048,  
3264  
],  
“id”: “531eb52d-282e-4a8b-a47d-fea90846ea8c”,  
“name”: “OpenAI Chat Model2”,  
“credentials”: {  
“openAiApi”: {  
“id”: “joTQ0lGTKum2MhtD”,  
“name”: “OpenAi Ads Formula Valid”  
}  
}  
},  
{  
“parameters”: {  
“jsonSchemaExample”: “{\n “visual\_analysis”: “string (1–1200 chars)”,\n “hook\_elements”: [“string (1–80 chars)”],\n “main\_offer”: “string (0–160 chars)”,\n “psychological\_triggers”: [“string (1–60 chars)”]\n}”  
},  
“type”: “@n8n/n8n-nodes-langchain.outputParserStructured”,  
“typeVersion”: 1.3,  
“position”: [  
4192,  
3264  
],  
“id”: “cc467362-b4f0-4c8b-bd26-8e90c7f434ee”,  
“name”: “Structured Output Parser2”  
},  
{  
“parameters”: {  
“amount”: 1  
},  
“id”: “9ae43f07-7d44-4da1-ab3e-75b6b0f3d40f”,  
“name”: “Wait 1 sec2”,  
“type”: “n8n-nodes-base.wait”,  
“position”: [  
5504,  
3872  
],  
“webhookId”: “1cda7407-6321-4d8d-b532-19f42514eb63”,  
“typeVersion”: 1.1  
},  
{  
“parameters”: {  
“mode”: “combine”,  
“combineBy”: “combineAll”,  
“options”: {}  
},  
“type”: “n8n-nodes-base.merge”,  
“typeVersion”: 3.2,  
“position”: [  
4448,  
3296  
],  
“id”: “64a64969-e7ab-4de3-bb23-3805a5260a9b”,  
“name”: “Merge Image Ad Details2”  
},  
{  
“parameters”: {  
“assignments”: {  
“assignments”: [  
{  
“id”: “11558f4e-7ab1-40d3-92f2-ed27e0f0d601”,  
“name”: “adIndex”,  
“value”: “={{ $json.adIndex }}”,  
“type”: “number”  
},  
{  
“id”: “6708d2d4-c98c-4ade-8266-b6cc74028894”,  
“name”: “cardIndex”,  
“value”: “={{ $json.cardIndex }}”,  
“type”: “number”  
},  
{  
“id”: “8f5cd132-6e40-4fe5-87ea-5edd7b0fd577”,  
“name”: “body”,  
“value”: “={{ $json.body }}”,  
“type”: “string”  
},  
{  
“id”: “3e68696c-99eb-4fa0-a8e6-1927b824ed60”,  
“name”: “title”,  
“value”: “={{ $json.title }}”,  
“type”: “string”  
},  
{  
“id”: “c070d84f-abe7-4c24-85cb-983184730f87”,  
“name”: “link\_url”,  
“value”: “={{ $json.link\_url }}”,  
“type”: “string”  
},  
{  
“id”: “f17549fd-b36c-473e-8196-005b0671905d”,  
“name”: “resized\_image\_url”,  
“value”: “={{ $json.resized\_image\_url }}”,  
“type”: “string”  
}  
]  
},  
“options”: {}  
},  
“type”: “n8n-nodes-base.set”,  
“typeVersion”: 3.4,  
“position”: [  
3376,  
3312  
],  
“id”: “f3240cc9-c2a7-4060-8060-9851223d0d20”,  
“name”: “Passing Image Card Data”  
},  
{  
“parameters”: {  
“operation”: “append”,  
“documentId”: {  
“\_\_rl”: true,  
“value”: “1AS2gzcXg2Gp5d4yNCpQcWulKrGq3BWJGKS5eUHB-FTw”,  
“mode”: “list”,  
“cachedResultName”: “Ads\_Library\_Analyzer”,  
“cachedResultUrl”: “[https://docs.google.com/spreadsheets/d/1AS2gzcXg2Gp5d4yNCpQcWulKrGq3BWJGKS5eUHB-FTw/edit?usp=drivesdk”](https://docs.google.com/spreadsheets/d/1AS2gzcXg2Gp5d4yNCpQcWulKrGq3BWJGKS5eUHB-FTw/edit?usp=drivesdk%E2%80%9D)  
},  
“sheetName”: {  
“\_\_rl”: true,  
“value”: 1561928389,  
“mode”: “list”,  
“cachedResultName”: “Carousel Cards”,  
“cachedResultUrl”: “[https://docs.google.com/spreadsheets/d/1AS2gzcXg2Gp5d4yNCpQcWulKrGq3BWJGKS5eUHB-FTw/edit#gid=1561928389”](https://docs.google.com/spreadsheets/d/1AS2gzcXg2Gp5d4yNCpQcWulKrGq3BWJGKS5eUHB-FTw/edit#gid=1561928389%E2%80%9D)  
},  
“columns”: {  
“mappingMode”: “defineBelow”,  
“value”: {  
“hook\_elements”: “={{ $json.output.hook\_elements }}”,  
“main\_offer”: “={{ $json.output.main\_offer }}”,  
“psychological\_triggers”: “={{ $json.output.psychological\_triggers }}”,  
“visual\_analysis”: “={{ $json.output.visual\_analysis }}”,  
“adindex”: “={{ $json.adIndex }}”,  
“cardindex”: “={{ $json.cardIndex }}”,  
“body”: “={{ $json.body }}”,  
“title”: “={{ $json.title }}”,  
“link\_url”: “={{ $json.link\_url }}”,  
“creative\_url”: “={{ $json.resized\_image\_url }}”  
},  
“matchingColumns”: ,  
“schema”: [  
{  
“id”: “adindex”,  
“displayName”: “adindex”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “cardindex”,  
“displayName”: “cardindex”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “body”,  
“displayName”: “body”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “title”,  
“displayName”: “title”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “link\_url”,  
“displayName”: “link\_url”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “creative\_url”,  
“displayName”: “creative\_url”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “visual\_analysis”,  
“displayName”: “visual\_analysis”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “hook\_elements”,  
“displayName”: “hook\_elements”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “main\_offer”,  
“displayName”: “main\_offer”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “psychological\_triggers”,  
“displayName”: “psychological\_triggers”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
}  
],  
“attemptToConvertTypes”: false,  
“convertFieldsToString”: false  
},  
“options”: {}  
},  
“id”: “437bb0ab-11b2-4fbd-be66-88bc3147ceec”,  
“name”: “Adding Cards Data”,  
“type”: “n8n-nodes-base.googleSheets”,  
“position”: [  
5456,  
3296  
],  
“typeVersion”: 4.6,  
“credentials”: {  
“googleSheetsOAuth2Api”: {  
“id”: “Gp6tqzdRRxGutUxf”,  
“name”: “Ads Formula”  
}  
}  
},  
{  
“parameters”: {  
“operation”: “append”,  
“documentId”: {  
“\_\_rl”: true,  
“value”: “1AS2gzcXg2Gp5d4yNCpQcWulKrGq3BWJGKS5eUHB-FTw”,  
“mode”: “list”,  
“cachedResultName”: “Ads\_Library\_Analyzer”,  
“cachedResultUrl”: “[https://docs.google.com/spreadsheets/d/1AS2gzcXg2Gp5d4yNCpQcWulKrGq3BWJGKS5eUHB-FTw/edit?usp=drivesdk”](https://docs.google.com/spreadsheets/d/1AS2gzcXg2Gp5d4yNCpQcWulKrGq3BWJGKS5eUHB-FTw/edit?usp=drivesdk%E2%80%9D)  
},  
“sheetName”: {  
“\_\_rl”: true,  
“value”: “gid=0”,  
“mode”: “list”,  
“cachedResultName”: “Visual Analysis”,  
“cachedResultUrl”: “[https://docs.google.com/spreadsheets/d/1AS2gzcXg2Gp5d4yNCpQcWulKrGq3BWJGKS5eUHB-FTw/edit#gid=0”](https://docs.google.com/spreadsheets/d/1AS2gzcXg2Gp5d4yNCpQcWulKrGq3BWJGKS5eUHB-FTw/edit#gid=0%E2%80%9D)  
},  
“columns”: {  
“mappingMode”: “defineBelow”,  
“value”: {  
“primary\_text”: "={{ $json.primary\_text }} ",  
“headline”: “={{ $json.headline }}”,  
“ad\_library\_url”: “={{ $json.ad\_library\_url }}”,  
“page\_name”: “={{ $json.page\_name }}”,  
“display\_format”: “={{ $json.display\_format }}”,  
“link\_url”: “={{ $json.link\_url }}”,  
“creative\_url”: “={{ $json.creative\_url }}”,  
“target\_eu”: “={{ $json.targets\_eu }}”,  
“eu\_total\_reach”: “={{ $json.eu\_total\_reach }}”  
},  
“matchingColumns”: ,  
“schema”: [  
{  
“id”: “ad\_library\_url”,  
“displayName”: “ad\_library\_url”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “page\_name”,  
“displayName”: “page\_name”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “display\_format”,  
“displayName”: “display\_format”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “headline”,  
“displayName”: “headline”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “primary\_text”,  
“displayName”: “primary\_text”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “link\_url”,  
“displayName”: “link\_url”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “creative\_url”,  
“displayName”: “creative\_url”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “target\_eu”,  
“displayName”: “target\_eu”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “eu\_total\_reach”,  
“displayName”: “eu\_total\_reach”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: false  
},  
{  
“id”: “visual\_analysis”,  
“displayName”: “visual\_analysis”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: true  
},  
{  
“id”: “hook\_elements”,  
“displayName”: “hook\_elements”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: true  
},  
{  
“id”: “main\_offer”,  
“displayName”: “main\_offer”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: true  
},  
{  
“id”: “psychological\_triggers”,  
“displayName”: “psychological\_triggers”,  
“required”: false,  
“defaultMatch”: false,  
“display”: true,  
“type”: “string”,  
“canBeUsedToMatch”: true,  
“removed”: true  
}  
],  
“attemptToConvertTypes”: false,  
“convertFieldsToString”: false  
},  
“options”: {}  
},  
“id”: “3771a266-9ba5-4268-b652-2d303f56fcd6”,  
“name”: “Adding Carousel Ad Data”,  
“type”: “n8n-nodes-base.googleSheets”,  
“position”: [  
1920,  
3808  
],  
“typeVersion”: 4.6,  
“credentials”: {  
“googleSheetsOAuth2Api”: {  
“id”: “Gp6tqzdRRxGutUxf”,  
“name”: “Ads Formula”  
}  
}  
},  
{  
“parameters”: {  
“options”: {}  
},  
“type”: “n8n-nodes-base.splitInBatches”,  
“typeVersion”: 3,  
“position”: [  
2592,  
3344  
],  
“id”: “5320e87c-5a45-4e25-a0e9-36bb9d193830”,  
“name”: “Loop Over Items1”  
}  
],  
“connections”: {  
“Carousel Ads: Keeping Fields”: {  
“main”: [  
[  
{  
“node”: “Loop Over Items”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“Switch”: {  
“main”: [  
[  
{  
“node”: “HTTP Request2”,  
“type”: “main”,  
“index”: 0  
},  
{  
“node”: “Passing Image Card Data”,  
“type”: “main”,  
“index”: 0  
}  
],  
  
]  
},  
“Loop Over Items”: {  
“main”: [  
,  
[  
{  
“node”: “Array of Cards”,  
“type”: “main”,  
“index”: 0  
},  
{  
“node”: “Passing Carousel Ad Data”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“Code for separating the cards”: {  
“main”: [  
[  
{  
“node”: “Loop Over Items1”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“Array of Cards”: {  
“main”: [  
[  
{  
“node”: “Code for separating the cards”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“Passing Carousel Ad Data”: {  
“main”: [  
[  
{  
“node”: “Adding Carousel Ad Data”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“HTTP Request2”: {  
“main”: [  
[  
{  
“node”: “AI Agent2”,  
“type”: “main”,  
“index”: 0  
}  
],  
[  
{  
“node”: “Loop Over Items1”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“AI Agent2”: {  
“main”: [  
[  
{  
“node”: “Merge Image Ad Details2”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“OpenAI Chat Model2”: {  
“ai\_languageModel”: [  
[  
{  
“node”: “AI Agent2”,  
“type”: “ai\_languageModel”,  
“index”: 0  
}  
]  
]  
},  
“Structured Output Parser2”: {  
“ai\_outputParser”: [  
[  
{  
“node”: “AI Agent2”,  
“type”: “ai\_outputParser”,  
“index”: 0  
}  
]  
]  
},  
“Wait 1 sec2”: {  
“main”: [  
[  
{  
“node”: “Loop Over Items1”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“Merge Image Ad Details2”: {  
“main”: [  
[  
{  
“node”: “Adding Cards Data”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“Passing Image Card Data”: {  
“main”: [  
[  
{  
“node”: “Merge Image Ad Details2”,  
“type”: “main”,  
“index”: 1  
}  
]  
]  
},  
“Adding Cards Data”: {  
“main”: [  
[  
{  
“node”: “Wait 1 sec2”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“Adding Carousel Ad Data”: {  
“main”: [  
  
]  
},  
“Loop Over Items1”: {  
“main”: [  
[  
{  
“node”: “Loop Over Items”,  
“type”: “main”,  
“index”: 0  
}  
],  
[  
{  
“node”: “Switch”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
}  
},  
“pinData”: {},  
“meta”: {  
“templateCredsSetupCompleted”: true,  
“instanceId”: “b4f80ba632bad682ebf8b1da401c7d3ce313277133387e4543f367f78a1da6b0”  
}  
}

```auto
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

```

## Share the output returned by the last node

## Information on your n8n setup

- **n8n version:**
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**
- **Operating system:**

---

<div class="post-metadata">

**Author:** ![mredodos](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mredodos/32/49280_2.png) [@mredodos](https://community.n8n.io/u/mredodos)\
**Post date:** [October 26, 2025, 6:11pm UTC](https://community.n8n.io/t/loop-inside-loop-loop-node-does-not-run-over-all-the-items/210435/2 "2025-10-26T18:11:41Z")

</div>

i have same issue some one can help us ?

---

<div class="post-metadata">

**Author:** ![Sona\_Darbinyan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sona_darbinyan/32/59218_2.png) [@Sona\_Darbinyan](https://community.n8n.io/u/Sona_Darbinyan)\
**Post date:** [October 26, 2025, 6:51pm UTC](https://community.n8n.io/t/loop-inside-loop-loop-node-does-not-run-over-all-the-items/210435/3 "2025-10-26T18:51:28Z")

</div>

Hi @mredodos , kindly check this question, the solution suggested by **[mohamed3nan](http://community.n8n.io/u/mohamed3nan)** worked for me : [Second nested Loop Over Items does not restart in each iteration of the outer loop](http://community.n8n.io/t/second-nested-loop-over-items-does-not-restart-in-each-iteration-of-the-outer-loop/202799)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/36532_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [January 24, 2026, 6:51pm UTC](https://community.n8n.io/t/loop-inside-loop-loop-node-does-not-run-over-all-the-items/210435/4 "2026-01-24T18:51:50Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
