Skip to content


Use the If node to split a workflow conditionally based on comparison operations.

Examples and templates

For usage examples and templates to help you get started, refer to n8n's IF integrations list.

Add conditions#

Add comparison conditions using the Add Condition dropdown. The available comparison operations vary for each data type.


  • Equal
  • Not Equal

Date & Time:

  • Occurred After
  • Occurred Before


  • Smaller
  • Smaller or Equal
  • Equal
  • Not Equal
  • Larger
  • Larger or Equal
  • Is Empty
  • Is Not Empty


  • Contains
  • Not Contains
  • Ends With
  • Not Ends With
  • Equal
  • Not Equal
  • Regex Match
  • Regex Not Match
  • Starts With
  • Not Starts With
  • Is Empty
  • Is Not Empty

Match any or match all#

You can choose to split a workflow when the data meets any of the conditions, or all of the conditions, by setting Combine to ANY or ALL.

Branch execution with If and Merge nodes#

0.236.0 and below

n8n removed this execution behavior in version 1.0. This section applies to workflows using the v0 (legacy) workflow execution order. By default, this is all workflows built before version 1.0. You can change the execution order in your workflow settings.

If you add a Merge node to a workflow containing an If node, it can result in both output branches of the If node executing.

The Merge node is triggered by one branch, then goes and executes the other branch.

For example, in the screenshot below there's a workflow containing a Edit Fields node, If node, and Merge node. The standard If node behavior is to execute one branch (in the screenshot, this is the true output). However, due to the Merge node, both branches execute, despite the If node not sending any data down the false branch.

Screenshot of a simple workflow. The workflow has an Edit Fields node, followed by an If node. It ends with a Merge node.

View example workflows and related content on n8n's website.

Refer to Splitting with conditionals for more information on using conditionals to create complex logic in n8n.

If you need more than two conditional outputs, use the Switch node.