IF node misbehaving in specific cases

Describe the issue/error/question

“If node” doesn’t route properly on the output.
it triggers both false and true output when its preceded by HTML Extract node.

The below screenshot is the part of the workflow where the issue happens.

The workflow is way too big and contains sensitive data so I’ll just share that part.

I found a temporary fix that consists of putting a function node returning items between the HTML Extract node and the If node as such:

Information on the n8n setup

  • n8n version: 0.152.0
  • Database: Postgresql
  • Running n8n via [Docker]: hosted on a server

Hi @TheFSilver, I’m sorry to hear you’re running into this behaviour. I’ve copied the example you have provided, but it doesn’t include any data suggesting the IF node might not work as expected.

Would you be able to share a workflow including mock data using which the behaviour can be seen?

Thanks for your quick answer @MutedJam !

Let’s try with this:

The culprit might not be the IF node but the Merge node as the issue disappears here:

Hi @TheFSilver, many thanks for sharing this example!

You’re quite right here, it’d be the Merge Node causing this behaviour and this is the expected behaviour I am afraid. The Merge node is implemented in a way where when it receives data on one input it’ll go up the chain and also execute the nodes connected to the other input.

Is there a way to disable this behaviour on a needed basis from the Merge node?

Hi @TheFSilver, sorry for the late reply - I am afraid that’s not currently possible as confirmed here (you might want to vote on this feature request to make your voice count when it comes to changing this though):

However, as suggested in this feature request, would you need the merge node in your case? In many cases you can consider directly connecting to the node afterwards.

1 Like

Thanks @MutedJam !
I voted and yes, I need that merge.

I actually got several other merge nodes right after that one :rofl: