The IF node is how n8n says "if this is true, do this; otherwise do that." It splits a workflow into two paths: a true branch and a false branch.

Drop an IF node after any node that produces data, open it, and add a condition. A condition compares one value to another. n8n groups the comparison operators by data type, so you pick the type first, then the operator:

  • Number: "is greater than", "is less than", "is equal to"
  • String: "contains", "starts with", "ends with", "matches regex"
  • Date & Time: "is after", "is before"
  • Boolean: "is true", "is false"

Real example: order triage. You have a Webhook node receiving orders as JSON. Each order has a total. Orders over $100 should alert your team in Slack; smaller orders go straight to your fulfillment API.

  1. Webhook node receives {"total": 120, "email": "a@b.com"}.
  2. IF node, condition: field {{ $json.total }} (Number), "is greater than", value 100.
  3. Drag the true output to a Slack node that posts "Order for $120 needs review".
  4. Drag the false output to an HTTP Request node that sends the order to fulfillment.

Only one branch runs. n8n evaluates the condition and follows one path.

You can combine conditions with AND or OR. "total is greater than 100 AND status is equal to paid" only goes true when both hold. Use AND when every condition must be true, OR when any one is enough.

Three things that trip people up.

The IF node routes the whole execution. It does not filter individual items. Whatever data arrives goes down one branch or the other; nothing is discarded. If you want to remove non-matching items from the data, that's the Filter node's job.

You can leave the false branch empty. The workflow just ends when the condition is false. You don't have to wire up a do-nothing node.

If you need three or more outcomes, stop chaining IF nodes and use a Switch node. Switch gives you one output per rule, which is easier to read than a chain of IFs.

If you need both branches to feed the same downstream node later, rejoin them with a Merge node.

The IF node is the control structure you'll use more than any other. Learn to read a condition and predict which branch fires, and most n8n workflows stop looking like a mystery.

NodeQuest teaches this same branching logic as a puzzle you play in the browser: https://nodequest.io/?utm_source=devto&utm_medium=article&utm_campaign=if-node-explained