I have 2 loops chained together. Iâm just trying to reference the first loopâs data output from the second loopâs done branch.
The first loop has all of the business info, and the second loop has just the summary and classification data.
I need to access both in order to add a row to my database with both the business and classification data. I just tried a merge node carrying the data forward, but itâs queueing up items in the input 1, and it results in a mismatched classification.
Whatâs the best way to fix this workflow so I can access all data at the same time?
Hi, @nosiremosacasar !
Iâm new using n8n, but hereâs my opinion.
Any data that the loop node gets from its loops, either the big or the small, itâs done, which means it donât get into any loop of the loop node again and just wait all other data to output through the âdoneâ.
If you want your concrete info and your summary info to go back the first loop node in a raw, you should not let the concrete info return once you get them, instead you let them continue in the loop, wait the summary info, and use a set node to get both to go back the first loop node finally.
From how the Loop node works in n8n: once an item exits a loop (big or small), itâs done and wonât re-enter the loop. That data will only move forward to the Done output while the loop waits for the remaining items.
So if you want both the concrete info and the summary info to return to the first loop together, you shouldnât send the concrete info out early. Let it stay inside the loop, wait until the summary is generated, and then use a Set (or Merge) node to combine both before sending them back to the first loop.
That way, everything returns as a single, consistent payload instead of splitting prematurely.
[email protected]