I’m fetching data from an API inside a loop in n8n. After each request, I’m merging the results using the Merge node. My goal is to wait until the entire loop finishes, then send the combined data to the Aggregate node.
However, right now, as soon as any data reaches the Merge node, it immediately continues to the Aggregate node — before the loop is fully complete.
How can I make sure the Aggregate node only receives data after all iterations of the loop are done?
The reason the Merge immediately goes to Aggregate is because the Aggregate follows the Merge node.
The Aggregate should follow the IF false output (that puts it outside the loop) and I think you want the Merge inside the loop (it’s currently outside the loop).
Are you trying to accumulate input for chat over multiple loops?
If so, you’ll need to use an external place to store the data (like Google Sheets or Docs) for each loop then get it back once you are done gathering data. There is no global variable you can add to.
Please show your workflow. It will help anyone looking at this understand exactly what you are trying to do.