Skip to main content
The condition node provides if/else-if/else branching. It evaluates conditions in order and executes the first matching branch.

Configuration

{
  "id": "check_amount",
  "type": "condition",
  "config": {
    "conditions": [
      {
        "if": "{{request.body.amount}} > 1000",
        "then": ["high_value_flow"]
      },
      {
        "if": "{{request.body.amount}} > 100",
        "then": ["medium_value_flow"]
      }
    ],
    "else": ["standard_flow"]
  }
}

Config Fields

FieldTypeRequiredDescription
conditionsarrayYesArray of condition objects
conditions[].ifstringYesBoolean expression to evaluate
conditions[].thenstring[]YesNode IDs to execute if condition is true
elsestring[]NoNode IDs to execute if no condition matches

Expression Syntax

Conditions use template expressions that evaluate to boolean values.

Comparison Operators

OperatorDescriptionExample
==Equal{{status}} == "active"
!=Not equal{{status}} != "deleted"
>Greater than{{amount}} > 100
<Less than{{count}} < 10
>=Greater or equal{{age}} >= 18
<=Less or equal{{score}} <= 100

Comparison Type Detection

The executor automatically detects value types for comparison:
TypeDetectionExample
NumbersBoth values are numeric{{amount}} > 100
DatesISO 8601 format strings{{expires_at}} > {{now}}
StringsAll other values{{status}} == "active"

Logical Operators

OperatorDescriptionExample
&&AND{{amount}} > 100 && {{status}} == "active"
||OR{{role}} == "admin" || {{role}} == "moderator"

Examples

"if": "{{request.body.amount}} > 100"        # Simple comparison
"if": "{{user.status}} == active"            # String equality
"if": "{{amount}} > 100 && {{currency}} == USD"  # Combined conditions
"if": "{{user.email}} != null"               # Null check
"if": "{{user.verified}} == true"            # Boolean check
"if": "{{subscription.expires_at}} > {{now}}"  # Date comparison

Output

The condition node outputs information about the evaluation:
{
  "result": true,
  "branch": "conditions[0]",
  "matched_index": 0
}
FieldTypeDescription
resultbooleanWhether any condition matched
branchstringWhich branch was taken: "conditions[N]" or "else"
matched_indexnumberIndex of matched condition (-1 if else branch)

Examples

Basic If/Else

{
  "id": "check_auth",
  "type": "condition",
  "config": {
    "conditions": [
      {
        "if": "{{request.headers.Authorization}} != null",
        "then": ["process_request"]
      }
    ],
    "else": ["unauthorized_response"]
  }
}

Multiple Conditions (If/Else-If/Else)

{
  "id": "route_by_tier",
  "type": "condition",
  "config": {
    "conditions": [
      {
        "if": "{{user.tier}} == enterprise",
        "then": ["enterprise_handler"]
      },
      {
        "if": "{{user.tier}} == pro",
        "then": ["pro_handler"]
      },
      {
        "if": "{{user.tier}} == basic",
        "then": ["basic_handler"]
      }
    ],
    "else": ["free_handler"]
  }
}

Complex Condition

{
  "id": "check_eligibility",
  "type": "condition",
  "config": {
    "conditions": [
      {
        "if": "{{user.age}} >= 18 && {{user.verified}} == true && {{user.balance}} > 0",
        "then": ["approve"]
      }
    ],
    "else": ["reject"]
  }
}

Checking HTTP Response

{
  "id": "check_api_response",
  "type": "condition",
  "config": {
    "conditions": [
      {
        "if": "{{fetch_data.output.success}} == true && {{fetch_data.output.status_code}} == 200",
        "then": ["process_data"]
      }
    ],
    "else": ["handle_error"]
  }
}

Execution Behavior

  1. Conditions are evaluated in order
  2. The first matching condition’s then branch executes
  3. If no condition matches, the else branch executes (if defined)
  4. Unmatched branches are skipped

Branch Merging

Branches can merge back by pointing to the same subsequent node:
         Condition
             |
    +--------+--------+
    |                 |
  (then)           (else)
    |                 |
  Node A           Node B
    |                 |
    +--------+--------+
             |
          Node C (merge point)