I have a workflow where I want the subsequent nodes to execute even if only one of the input nodes (Markdown or Fill Markdown) provides data. Currently, it seems that the Merge node (set to “Combine by Position”) waits for both inputs before passing data to the next node.
I set the Fill Markdown to always output data which works in this cases, but if the lower branch is more complex, it won’t work.
How can I set up the workflow so that the execution continues as soon as one of the branches produces a result, without needing the other branch to be executed?
I’m pretty sure it’s answered/explained somewhere, but i struggle to find it.
What is the error message (if any)?
No error, just clarification.
Please share your workflow
Information on your n8n setup
n8n version: 1.75.2
Database (default: SQLite): Postgres
n8n EXECUTIONS_PROCESS setting (default: own, main): own
Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
Hey @laschmu , your approach is valid. Though, if it is also valid to continue as soon as one brach completes, then remove Merge and have all the connections lead to the same input of the next node that you currently have after Merge. This however, will result in more than one processing of that node if more than one branch succeeds (produces output).
thank you for your answer, which still confuses me somehow in terms of the n8n behavior…
Maybe the screenshots help to make it a bit clearer where i’m confused…
So, in my case Wf Constants should be executed, either I’m coming from Markdown or Fill Markdown;
I’ve stepped through in this case
Markdown path is gone
Executing Wf - Constants
→ Expected here only Markdown-Path stays green
→ Result: Fill Markdown is executed as well,
In this case the Wf-Constants doesn’t work properly for me:
Here in this case the merge works fine as a workaround (Fill Markdown is marked with Always Output Data).
I tried the same thing later in the workflow, where i have 2 different AI Agents for different routes, merging them after execution doesn’t work…
It sounds like your IF node might not have been configured correctly. I do not expect both branch to run at the same time unless the condition is satisfied for true and false at the same time somehow.
What is the value of $json.body.contentType when you have both branches executed.
Could you share the whole workflow in case some other part of it forses the part you showed already to execute inappropriately.
@ihortom Right? I didn’t expect it as well - that’s why I’m confused…
Pretty sure that the node is configured properly and it behaves properly…
I’ve extracted the part, but i also found out what is happening…
This happens only if i step through the workflow (Executing node by node for debugging/testing). Using test workflow or active workflow - it is executed as expected and i got only irritated while stepping through… Knowing this, it’s handable and just a minor bug…