Merge node suggestion: add option to disable triggering of previous nodes

The idea is:

The Merge node has a unique behavior in which it activates connected nodes independently (please also add an explanation in the documentation here: Merge | Docs). I think it’s something that should be configurable in the node.

My use case:

I had multiple cases in which the Merge node triggered nodes that were not supposed to be triggered (usually in an unused path of an IF node).

I think it would be beneficial to add this because:

It gives more control of the Merge node, in my personal experience it caused some really unexpected workflow behavior which was not consistent. By disabling this behavior the Merge node can be used more reliably.

Totally agree about the documentation.

However one short question regarding your use case. Would you really need a Merge-Node in this case? It sounds to me right now like in this case simply removing the Merge-Node and rather connecting directly to the node afterward is what you want and need.

Hi @Tuckan & @jan !

Gotta agree with Tuckan on this.
I encountered the problem several times myself and even blamed the IF node for it until I noticed the Merge node was the one messing up my workflow.

Pretty please. ahah !!
Cheers

Hi @jan thank you for the quick response.

For your question I tend to prefer using a single execution, it’s easier to keep track of and has less potential for bugs. (This may require a different thread but multiple executions in a Merge execute only once)
It also makes logical sense to use IF nodes to split a branch and use the Merge nodes to combine them together afterwards.

I have 2 examples of bugs occurring in relation to the Merge node and an IF node:

  1. In this simplified workflow there the if node output is a single empty item on the true path. The merge node triggers the bottom node to activate and creates an extra unwanted entity in the system.
  1. My 2nd example is a real use case which is more complex - I get a list of items to create/delete and my implementation requires that I first delete and then create. The nodes from from the IF to the Merge are set to always pass data and the delete node is set to continue on fail.
    I tested a case with a single item that go to the false path on the IF and somehow the node on the true path used information that was only on the false path of the IF.

Hi @Tuckan

I actually got solutions for your two cases.

Case 1:

  • Remove everything but one Create Entity
  • put your conditions directly in there as follows:
{{ yourCondition ? "result if condition true" : "result if condition false" }}

If it’s an experssion just remove the quotation marks.

Case 2:

  • Disconnect the Spreadsheet file and the Merge 2nd input
  • Connect the IF true branch to the Merge 2nd input

That should do it!

But I still request that node improvement !!

1 Like

Hi @TheFSilver,

Thank you for the tips!

I mainly presented these cases to show potential bugs.
For case 1 it’s true it will work for a simple IF but if I’ll have more complex conditions it will start to get messy to try and find a workaround for each case. I wanted to present a case that Merge node always triggers a node that is on a situational path.

As for case 2 upon further testing it appears to be an issue with the SuiteCRM node ignoring a query when getting an empty value. For future reference the workaround was to add a Function Item node that set an empty string to the value if the item is empty.

Thanks a lot for providing some background information. Will be very helpful for us when we look into that further.

Hi @Tuckan,

Anytime. :slight_smile:

Just to be clear: I just provided those temporary quickfix while we wait for @jan & the team to implement the merge node improvement. :wink:

I need them too ahah.

@jan is there a suggested general workaround for this? I’m currently struggling with a flow that is triggering twice due to this

@chrisgereina is actually working on a workflow for me, so any insight from @jan or others would be greatly appreciated. Cheers.

1 Like

Still working through this issue

I know that by default n8n nodes run once for each item, is there a way to get all output items of a node at once?

If I’m able to do that then at least I can process all of the items at once in a function so that when the merge node does actually call the node it all comes as it should

@jan
@MutedJam
@RicardoE105

@chrisgereina I’m not sure if you are talking about combining executions to a single item but this thread may help you:

Fyi there is also an open PR about the Merge-Node behavior which will fix that issue once merged (planned with n8n version 1.0).

1 Like

New version [email protected] got released which includes the GitHub PR 4238.