I have nested loops in n8n. The inner loop can’t properly access items from the outer loop due to index mismatches. This causes duplicate labels and wrong data being used. How can I handle nested loops correctly so each iteration gets the right data?
In my case the large loop (image to the left) obviously passes on one item but within that loop the Code node Extract Proposed Labels creates 1-3 items and the second loop I have tried to reference them with $json. or .all()[$itemIndex].json.Link … in every case it does the same thing for the number of runs that was passed on from the first loop. How can I solve that to reference the actual item from the first loop and not always the first?
- n8n version: 1.10
- Database (default: SQLite): SQLite
- n8n EXECUTIONS_PROCESS setting (default: own, main): main
- Running n8n via (Docker, npm, n8n cloud, desktop app): docker
- Operating system: Win11
