IF condition issues

please why does my IF condition suddenly stopped matching valid users and nothing changed.

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

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

The workflow hasn’t changed, but the data or type enforcement has.

Ideally, you should send more details such as the n8n version, data structure, and condition configuration; however, see if the information below helps you in any way.

Possible causes:

1. Type mismatch (most common after n8n updates)

n8n v1.x enforces strict typing in IF conditions. If you are comparing a numeric field with a string value (for example, userId == "123" instead of userId == 123), the comparison will silently fail. Solution: open the IF node, check the data type dropdown next to your value, and make sure it matches the actual type of your input data.

To inspect the type at runtime, add a code node before the IF with:

console.log(typeof $input.first().json.yourField);

return $input.all();

**2. Change in the format of upstream data
If an API, database query, or webhook recently returned data in a slightly different structure (for example, nested differently), the field you are referring to may now be undefined. In your IF node, hover over the field—if it shows undefined or is blank, the path is incorrect.

Quick check: Add a Set node before the IF and map {{ $json }} to a field—examine the complete JSON to find the correct path to your user field.

**3. Whitespace or encoding issues
Sometimes, data from external sources introduces invisible characters. If your condition is email == "``user@example.com``", but the received value is " user@example.com" (leading space), there will be no match.

Correct with an expression: {{ $json.email.trim() }}

4. Confusion between Expression and Fixed Value
Make sure the comparison value in the SE node is set to an Expression (and not a Fixed Value) if you are referencing another field dynamically. Enable the {} button next to the value input field.

5. Verify the SE node with a valid input
Use the “Run node” button in the SE node with the test data pane open—this allows you to see exactly which branch each item follows and why.

Recommended debugging flow:

  1. Fix the data in the node before the SE (right-click → Fix data)
  2. Open the SE node and use the expression editor to view the values
  3. Check {{ typeof $json.yourField }} to confirm that the types match

For reference: If | n8n Docs

I hope this helped in some way. If this solved your problem, please mark this answer as a solution and click the heart button. Thank you! :slight_smile:

Hi @Abistel_Finance Welcome!
Consider checking if there is some change in the incoming data, and please send us your flow for us to see, make sure to pin some data before sending so we could see the possible issue. You can consider taking the level 1 & 2 courses just in case if you do not get some concepts clearly:

Something did change here, just in a very subtle way.

Most likely it’s one of these small differences:

“active” became “Active”
“true” became a boolean true instead of a string
or maybe there are hidden trailing spaces you can’t easily see

And that’s the real issue as external data is almost never perfectly consistent.

Even a tiny change like capitalization, data type, or an extra space is enough to break comparisons or logic checks without you realizing it.

So even though it looks “the same” at first glance, the system treats it as completely different.