Merge (wait) seems broken

Describe the issue/error/question

When a merge node is added to the workflow in wait or passthrough mode ill will execute nodes that shouldn’t be executed. Like a node behind an IF node would execute the false branch even when the condition is true.

What is the error message (if any)?

There’s no specific error message from the node itself. I have HTTP nodes that are actually firing he API calls when they shouldn’t.

Please share the workflow

Share the output returned by the last node

400 - {“Fault”:{“Error”:[{“Message”:“Invalid ID”,“Detail”:“Id should be a valid number. Supplied value:”,“code”:“2030”,“element”:“Id”},{“Message”:“Invalid Number”,“Detail”:"Invalid Number : ",“code”:“2090”,“element”:“SyncToken”}],“type”:“ValidationFault”},“time”:“2022-10-15T16:27:08.942-07:00”}

Information on your n8n setup

  • n8n version: 1.6.0 (1.6.0)
  • Database you’re using SQLite: SQLite
  • Running n8n via [desktop]:

Hi @Carlos_De_Jesus, welcome to the community!

I am so sorry to hear you’re having trouble. Unfortunately, this is the expected behaviour. I know it’s confusing and I have stumbled over this myself several times. It’s documented here in the context of an IF node specifically.

My understanding from the various conversations around this is that a change would require several in-depth changes to n8n’s core logic and would also break existing workflows relying on this behaviour. So it’s unlikely to happen anytime soon, but perhaps @sirdavidoff can share additional insights around this.

2 Likes

Actually changing that is already wip (I created at least a PR around that). We will probably introduce a new “workflow version” to make sure only new workflows behave differently and old ones keep on working as they did before:

3 Likes

Woah, I did not know this. That’s awesome!

@MutedJam and @jan Thanks for the info. I did read several of the other tickets that are similar to this one and figured it might be the case of “this is expected behavior”. I did end up finding a work around by making the workflow more “sequential” and removing as many of the merge nodes as possible since the behavior really is a bit counter intuitive to what I expect to happen in the shared scenario. I’ll keep my eyes out for this new workflow version over the next few months as it would really simplify advanced workflow building.

I should note that this whole issue started with the need of the Item Lists node to have direct input from the stripe webhook in my workflow. I suppose a cool feature could be to be able to use expressions as the source of the items to split in that node. I ended up using a function node that outputs the items of the webhook node to the item lists node. It gets the job done but Im trying to minimize he use of javascript so that the non-coders in my org have a chance at maintaining the workflow.

This is the first workflow I am building with n8n so I’m still learning the system. Could you provide me with some docs for contributors. Like learning he inner workings of nodes, etc so that I can possibly contribute in the future? I wouldn’t mind implementing some of the things I am asking for when I get the time.

1 Like

I ended up using a function node that outputs the items of the webhook node to the item lists node. It gets the job done but Im trying to minimize he use of javascript so that the non-coders in my org have a chance at maintaining the workflow.

You might be able to get this done using a Set node and an n8n expression, so that you don’t have to write JS code.

This is the first workflow I am building with n8n so I’m still learning the system. Could you provide me with some docs for contributors. Like learning he inner workings of nodes, etc so that I can possibly contribute in the future? I wouldn’t mind implementing some of the things I am asking for when I get the time.

That is quite an impressive workflow for being the first one! When going through n8n with new users, the first workflow I build is usually much simpler, like so:

As for contributing, you might want to check out our documentation on the topic: Contributing - n8n Documentation. If you’re curious how a specific node works behind the scenes, check out the n8n/packages/nodes-base/nodes folder in our repo. It’s where all of the default n8n nodes live.

You might be able to get this done using a Set node and an n8n expression, so that you don’t have to write JS code.

Thanks, I’ll give that a try.

That is quite an impressive workflow for being the first one. When going through n8n with new users, the first workflow is usually much simpler, like so:

:rofl: I wish I could get away with simple workflows like that, I would have much less gray hairs.

Thanks for the time.

2 Likes