How can I merge multiple branches into one and wait for all of them to finish executing?


I currently have a flow that receives images from an IF node that I want to process, and on the other side, text that I also want to process.

What I want is for both branches to merge into one once they’ve finished processing, and combine all the data into an array, string, or whatever works.

I’ve tried everything with the merge node and the aggregate node, but what they do is execute the node as many times as the processed data is received from the branch—3, 4, 5, 6 times, etc.

In the example image, you can see that I receive 2 items from one branch and 4 from the other. After being processed, when I try to merge them, what happens is that it executes all the code behind the merge or aggregate node, then loops back to the IF node as many times as there are items, which doesn’t work for me.

Any idea how to do this?

Sounds like you would want to reduce the input to the merge into 1 item on both inputs, and set the merge to Combine → By Position.

1 Like

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