IF node results in the wrong branch

Describe the problem/error/question

When checking for a condition if the IF node, always ending up with the False branch in the output, even though both conditions (connected by AND) are True.

What is the error message (if any)?

no error messages

Please share your workflow

Share the output returned by the last node

As you can see from the screenshot, the value for .getHours() for me right now is 13, which is greater than 8 and less than 14, which makes the whole thing “True AND True”, and should in theory result in a True branch, but somehow the workflow takes the False branch out.


The same happens for when I check the hour as boolean:

Another thing I tried was setting the value of the hour with an Edit Fields node before entering the IF node like so:

This attempt showed another (or a part of the same really) problem:

Result and output do not match.

Information on your n8n setup

  • n8n version: 1.94.1
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: MacOS

I am not really sure the issue.

But I suggest use the {{ $now.hour }} and everything will be fine.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.