Learn how to use the IF node in n8n with clear steps, tips, and examples to build smarter, automated workflows.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
The IF node in n8n lets you split your workflow into two branches — true and false — based on conditions you define. You tell the IF node what to check (for example: “is the field status equal to active?”), and depending on the result, only the matching branch will execute. This is how you add real logic and decision‑making to your automation.
The IF node checks the incoming JSON data from the previous node. For each incoming item, it evaluates your condition. Items that match the condition go to the true output; all others go to the false output. Only the output that has data will continue running downstream nodes.
{{$json.fieldName}}.
Here’s the simplest and most production‑useful way to set it up:
{{$json.status}}
active
Imagine the API node before the IF returns this JSON per item:
{
"userId": 12,
"status": "inactive",
"name": "Jonas"
}
You want to run an action only for users with status = active.
In the IF node:
{{$json.status}}activeThe result:
status is active
data.user.status), use:
{{$json.data.user.status}}
Sometimes you want to preprocess data and then check it. For example:
// This runs inside a Function Item node in n8n
// It adds a new boolean you might test in an IF
item.isAdult = item.age >= 18
return item
Then in the IF node, you simply test:
{{$json.isAdult}}true
Use the IF node whenever you need branching logic. It reads incoming JSON, checks the condition you define, and sends items to either the true or false output. Use expressions like {{$json.field}} to reference real data. Keep conditions simple, and always verify your incoming fields using the node preview — that’s the most common source of mistakes.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.