IF node appears to be broken

So forgive me if this is a dumb post, as Ive only recently started using n8n, but I believe Im not getting the desired behavior from the IF node. Anything I do results in a “true” output. In the first image, value 1 is set to 10, and value 2 is set to 0, and the comparison is set to “equals” and returns true. To the best of my knowledge 10 == 0 should be false.

In the second image, both values are set to 0, and the comparison is “not equal”, which also returns true.

(image not included since the site says “Sorry, new users can only embed a single image in their posts”)

Is there something Im missing about the IF node? How do I get it to actually compare two values?

Hi @sterling_baldwin, welcome to the community. No question is a dumb question, it usually means that the documentation is lacking and that we should work to improve it :slight_smile:

Regarding your question, I see in the screenshot that it shows Results: 0 on true since the Condition is false. That is expected. If you click on true and select false from the dropdown list, you should see Results: 1 or something similar depending on the workflow. I’ve recorded a GIF to showcase this.


You can see the IF node is action with some data in the workflow by following the Creating Your First Workflow tutorial. You can also learn more about the IF node in our documentation.

Hope that helps, have fun! :slight_smile:

1 Like

OK, I think the issue is I just dont understand what the meaning of the “results” count and the “output” drop down are. I added a couple execute nodes attached to “true” and “false” output, and ran the workflow.

After running it, it goes to the “false” branch, but then when I click on the IF node, it still shows “results: 0” and “output: true”.

The “Output” drop down decides which data to display (so really just decides what data to display, it does not change the behavior). Either the data which will be output on the “true” output or the data which will be output on the “false” output.

Behind “Results” it will display the number of items it will output. The number it displays depends on the “Output” selector. So it will change if you change from “true” to “false”.

1 Like