How can I combine results from two branches/runs into a single output in one n8n workflow?
(I have one branch returning 59 items and another returning 9, and I’d like to get a combined total of 68 items in one result.)
Assume the Aggregate node returned a var called data, you could use a code node like this to loop over all the executions and merge them in. In your case it’s probably the Merge 1 node’s output
Yes it should be after merge if you are trying to merge the 2 runs
That Code node returns this error : Code doesn’t return items properly
Please return an array of objects, one for each item you would like to output.
@Rohit_Gurav (unrelated to this post so please everyone else ignore), saw your previous post about Apollo integration which was already closed and curious to hear if you found a solution as I am trying to do the same. If you are keen to share, my email is [email protected], would appreciate if you could share if/how you figured out it before I go down that rabbit hole. Thanks mate!
To everyone else, sorry for “abusing” the thread, unfortunately there is no direct chat.
Hi tried that function it didn’t work it the one called “code in javascript3” this multiple run is effecting my combine big time all my data collection is useless when combine is going to have 9 strokes in this case
Hi @Shant please can you share your workflow in a code block. A simple screenshot does not give me enough context. The code node should be outside of any loops
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.


