'IF' node cannot get correct return

Describe the problem/error/question

Hi ,

Can any body help me?

When I put the input temperature=21.2 to the IF node , I cannot get the TRUE output return for 15<tempterature<25 . I have already convert the temperature to numeric.

n8n Version = 2.2.6

@Alan_Cheung1

Make sure what you pass(number, string) and what you compare(number, string)??

I think this is the problem mainly in this node.

I solved the problem.

My number temperature is 21.2 which is a number already.

The problem is this workflow is generated by Claude, when I remove the “IF” node and re-Drag the “IF” node from n8n, it works now.

refer to below screen, UI is very similar, the upper one is default n8n node, the lower one is generated by Claude. but the Condition button location is different…….:sad_but_relieved_face:

Not sure it is a bug or not.

@Alan_Cheung1

Set the IF Node Logic

  • Operation: Expression (not Number, not String)

  • Result: The node will return TRUE only if temperature is greater than 15 AND less than 25.


:white_check_mark: How it works:

  • temperature = 21.2 → TRUE

  • temperature = 14 → FALSE

  • temperature = 25 → FALSE

This avoids using multiple conditions and the AND toggle—everything is handled in a single line.

Hey @Alan_Cheung1 i know you have figured it out but let me give you some context over IF statements and AND | OR statements:

In n8n, IF statements are used to create conditional logic that determines which path a workflow follows based on specific conditions. Inside an IF node, you can use AND and OR operators to combine multiple conditions:

  • AND requires all conditions to be true for the overall condition to be true.
  • OR requires at least one conditon to be true for the overall condition to be true.

These operators help create more complex decision-making processes within your workflows.

Hope this brings little more clarify over low-code n8n node IF BLOCK.