---
title: If
description: Route items to different branches based on conditions
---

*Formerly **IF**. The step was renamed in AWFlow 0.9; searching for the old name still finds it.*

Send each item down a **True** or a **False** branch, depending on conditions you set.

## Try it

## What it does

IF checks its conditions for every item that arrives. When they hold, the item leaves through the **True** port; otherwise it leaves through **False**. The item itself is not changed.

Each condition compares a value (usually an expression such as `{{ $input.price }}`) with another value, using an operator that fits the type you pick: **String**, **Number**, **Date-Time**, **Boolean**, **Array** or **Object** (for example **Contains**, **Is Equal To** or **Is Not Empty**). With several conditions, choose **Match all** (all must hold) or **Match any** (any one is enough).

### Conditions in AWFlow 0.9

New If steps (version 2) build conditions as cards, one rule per card:

* **Match all** or **Match any** applies to a whole group of rules, and **Add group** nests a group inside another, so "A and (B or C)" is easy to read. AND / OR between cards is shown for you.
* Operators have plain names, grouped by type: *is equal to*, *contains*, *matches pattern (advanced)*, *length is…* and so on. Lists and objects are compared by their content.
* **Options › Type check**: **Loose** converts values when it can (with a warning), **Strict** fails the step and names the rule and the item when a value has the wrong type. **Ignore case** compares texts without caring about capitals (an **Aa ignored** chip shows it).
* An empty date or number never counts as a date or as 0: the rule is false and the run log says why. An invalid pattern or date fails with "Condition N: …".

Steps saved before 0.9 keep their rows, read **top to bottom** with each row's own AND/OR. **Update** in the step's header converts them to groups with exactly the same meaning. **XOR** means "exactly one of the two" (it used to behave like OR); it is only offered on rows that already use it.

## When to use it

* Do something only for some items: "only send a message when the price dropped".
* Take one of two paths: save new contacts, update existing ones.
* Stop a branch early: leave the **False** port unconnected and those items simply go no further.

For more than two paths, use [Switch](/nodes/builtin/flow/switch/). To drop items without branching, use [Filter](/nodes/builtin/flow/filter/).

## Inputs and settings

## Outputs

Each output item has these fields:

```json title="Shape of an output item"
{
  "result": true,
  "inData": null
}
```

Port **True** is the top one and **False** the bottom one. Connect either or both.

Each output carries only its own items: the step on **False** gets the items that failed, never the true ones.

## Dependencies and credentials

None. This node needs no connection and has no slots for other nodes.

## Example workflow

1. [RSS Feed Read](/nodes/builtin/core/rss-feed-read/) fetches new posts.
2. IF checks that `{{ $input.title }}` (**String**) **Contains** `release`.
3. **True** goes to a [Slack](/nodes/builtin/integration/slack/) node that posts the link. **False** is left unconnected.

## Common issues

* **"IF needs at least one condition."** Add a condition, or remove the node.
* **Every item goes to False.** Check the operator type. A number stored as text compares as text, so pick the type that matches the data (**Number** for prices), or convert it first with [Edit Fields](/nodes/builtin/datatransformation/editfields/).
* **The expression is empty.** Open the input panel and pick the field instead of typing it, so the path matches the data that actually arrives.

## Recipes with this node

## Related nodes

* [Switch](/nodes/builtin/flow/switch/): any number of named branches.
* [Filter](/nodes/builtin/flow/filter/): keep only the items that match.
* [Loop](/nodes/builtin/flow/loop/): repeat steps while a condition holds.
* [Merge](/nodes/builtin/flow/merge/): bring two branches back together.