I am trying to do what I consider something very simple - combine the output of two branches down to a single branch and act on the data - and it does not work the way I expect. This is almost certainly user error, but I can’t figure out what I’m doing incorrectly.
Consider the following example workflow:
We have a simple If statement whose decision sets a string variable, which is then passed to a REST call that creates a message in Slack.
However, in practice, with both the True and False branches connected to the REST call, the REST call will report Success but not actually do anything. As soon as we delete one of the paths, it works.
I feel like I am missing some fundamental way that n8n functions, which would explain why this workflow doesn’t function the way I think it should. This problem results in me having to create very convoluted, branched workflows in order to have multiple outcomes, when in theory I could have multiple branches converge to the same node. For example, I could have multiple branches to handle different conditions, but have them all converge to a REST node that sends a Slack message whose content is specified by a string in the input node.
I thought perhaps a Merge node would fix it:
… but that does exactly the same thing: if both paths are connected to the Merge node, the Merge node executes and reports success without returning any data. If only one node is connected, it works as expected.
I could use a Code node to make the choice - essentially moving the If statement into a code block and keeping a single workflow path - but I feel like this should work without resorting to Code node workarounds. This workaround also doesn’t help in more complex workflow situations, where I do legitimately need two or more branches that then converge down to one action.
What am I doing wrong?
- n8n version: 1.24.1
- Database (default: SQLite): SQLite
- n8n EXECUTIONS_PROCESS setting (default: own, main): default
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Linux
Edited to add the standard questions for posts in this forum. Sorry!