Nested loop ( two loop over item loop) marked as done and bypassing new data

Describe the problem/error/question

I made an workflow to extract emails for any sub areas for any given place.
After the execution of inner loop (loop over item1) for the first sub area , the data for the other sub area generated is being skipped by the inner loop.

I think since the whole loop of the loop over item1 node is marked as done the workflow is considering that it is done (from the first sub area completion) and for all the sub areas it isnt processing the data anymore into the inner nested loop coz it remains marked as done so the workflow only continues through the loop over item node / outer loop only

What is the error message (if any)?

There is no error message , the workflow is simply skipping all the data relayed into the inner loop after the first execution since its marked as done i guess

Please share your workflow

The problem is in this part

This part

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:**1.72.1
  • **Database (default: SQLite):**Not sure , i am using Zep
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Windows 10

any help please?

Hey @3xOGsavage , nested looping is not supported in a sense it brings unexpected results. I also do not see the need in the 2nd loop.

Though if the nesting does work for your use case there is a reason why the new data is bypassed. You need to reset the Loop node for the new data set to be iterated. See Loop Node Only Processes the First Item - How to Fix? - #12 by Jon for details.

2 Likes

well there is the need of 2nd loop for the splitting and sending the array of email which are extracted and returned by the code1 node. If i try to put the whole array of email in a single cell of google sheet , it may miss out some email due to character limit of each cell so i thought its better to split them into single item ( each email) and using another loop to keep sending the emails into google sheet for all the queries generated . If you want me to explain the whole workflow i can explaining the function of each node in the same order as of the screenshot

Not seeing the actual data, I’m not convinced you need the 2nd loop. Each item in the set (aray) of items will be appended one by one without the Loop unless you do need to have Wait node in between to fight rate limit, for example.

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