What is the expected behavior of multiple end nodes on sub workflow?

I have a main workflow that is calling a sub workflow via Execute Workflow.

I’m aware of the expected behavior when you have a single end node inside the sub workflow: the output value of the end node is received at the end of the Execute Workflow node in the main workflow.

Ok, but what about when you have branches? If you have, say, 3 end nodes like the following (a dummy example):

I must expect the result to be a merge of the Postgres, Google Sheets and Set nodes, right? Because I’ve seen this behavior. But does it always behave like that? And if it does, does it wait for every output? Is there a chance for race conditions on the output?

And thinking about a slight variation:

Do I expect the result of this to be a merge of every last node? Say, Postgres and Google Sheets? Or only Postgres cause that’s the most nested node?

I’ve been trying to make straight forward linear sub workflows to avoid having to think about this, but I’m curious what is the expected behaviour on non linear workflows.

Actually will n8n simply return the data of the node which got executed last (not the combined result of all the different branches).

If you want to have the merged result or you want to make sure that data of a specific node gets returned you have to ensure that by for example using a Merge Node.

2 Likes