IF

Branch your flow based on conditions

Overview

The IF utility creates conditional branches in your flow. Based on conditions you define, the flow will take one of two paths: the True branch when conditions are met, or the False branch when they are not.

You can define multiple conditions and combine them with AND/OR logic for complex branching.

Configuration

Conditions

Each condition consists of:

  • Value 1 - The value to compare (use templates)
  • Operator - The comparison type
  • Value 2 - The value to compare against (optional for some operators)
  • Case Insensitive - Toggle for text/array comparisons

Operator Types

Text Operators:

  • Equal to, Not equal to
  • Contains, Not contains
  • Starts with, Ends with
  • Matches pattern (regex)
  • Exists, Not exists

Numeric Operators:

  • Equal to, Not equal to
  • Greater than, Less than
  • Greater or equal, Less or equal

Date Operators:

  • Equal to, Not equal to
  • After, Before

Array Operators:

  • Contains, Not contains
  • Length equal, Length greater, Length less

Boolean Operators:

  • Is true, Is false

Multiple Conditions

Add multiple conditions and combine with AND orOR. Conditions are evaluated left to right.

Output

The IF utility routes data to two separate branches:

True Branch

Executed when the condition evaluates to true.

False Branch

Executed when the condition evaluates to false.

Output fields:

  • result - Boolean result of the condition (true/false)
  • branch - Which branch was taken ("true" or "false")

Examples

Example 1: Check API Response Status

Route based on whether an API call was successful:

Value 1:{{#1.success}}
Operator:Boolean: Is true

True: Process the response data
False: Handle the error

Example 2: Numeric Comparison

Apply discount for orders over $100:

Value 1:{{#1.data.orderTotal}}
Operator:Number: Greater than
Value 2:100

Example 3: Multiple Conditions

Check if user is premium AND has an email:

Condition 1:

Value 1: {{#1.user.tier}}

Operator: Text Equal to

Value 2: premium

AND

Condition 2:

Value 1: {{#1.user.email}}

Operator: Text Exists

Tips

Tip: Use the Merge utility after IF branches if you need to continue with a single flow path after conditional processing.

Tip: Enable "Case Insensitive" for text comparisons when you don't care about uppercase/lowercase differences.

Note: Use the appropriate operator type for your data. Numeric operators convert values to numbers, text operators compare as strings.

IF Utility - Flows Guide - Serenities