Login
Free Sign Up
Docs
/

Control - If

Type identifier: control:if Category: Control Operations

Description

Conditional branching node that evaluates a boolean condition and directs the run down one of two paths. Supports both control flow mode (branching the run) and data mode (selecting between values).

Input Handles

Control Mode (ifType: "control")

Handle

Data Type

Required

Description

trigger

trigger

Yes

Execution trigger input

condition

boolean

Yes

Boolean value to evaluate

Data Mode (ifType: "data")

Handle

Data Type

Required

Description

condition

boolean

Yes

Boolean value to evaluate

then

any

No

Value to output if condition true

else

any

No

Value to output if condition false

Output Handles

Control Mode (ifType: "control")

Handle

Data Type

Description

if

trigger

Triggered when condition is truthy

else

trigger

Triggered when condition is falsy

Data Mode (ifType: "data")

Handle

Data Type

Description

value

any

The selected value (then or else input)

Configuration Options

Property

Type

Required

Default

Description

label

string

Yes

"Control - If"

Display label for the node

ifType

"control" | "data"

No

"control"

Operating mode of the node

Configuration Details

ifType

  • Type: "control" | "data"
  • Default: "control"
  • Notes:

    • "control": Branches the run based on condition
    • "data": Selects between two values based on condition

Behaviour

Control Mode

In control mode, the node branches the run based on the condition:

  1. Node receives trigger on the trigger input handle
  2. Resolves the condition input value
  3. Evaluates truthiness of the condition
  4. Triggers either if or else output handle

Truthy values: Any value that is not false, null, undefined, 0, "", or NaN

Data Mode

In data mode, the node acts as a ternary selector:

  1. Resolves the condition input value
  2. Based on condition, resolves either then or else input
  3. Outputs the selected value on the value handle

Note: In data mode, no trigger handles are used — the node is purely for data transformation.

Edge Cases

Scenario

Behaviour

No condition edge connected

Error: "control:if:... has no incoming edges."

Condition is true

Control: triggers if / Data: outputs then

Condition is false

Control: triggers else / Data: outputs else

Condition is null/undefined

Treated as falsy, follows else path

Condition is non-boolean value

Evaluated for truthiness

Examples

Control Mode - Simple Branch

{
  "type": "control:if",
  "data": {
    "label": "Check Active",
    "ifType": "control"
  }
}

Input Handles:

  • trigger (trigger)
  • condition (boolean)

Output Handles:

  • if (trigger) — labelled "Then" in UI
  • else (trigger)

Data Mode - Value Selection

{
  "type": "control:if",
  "data": {
    "label": "Select Message",
    "ifType": "data"
  }
}

Input Handles:

  • condition (boolean)
  • then (any)
  • else (any)

Output Handles:

  • value (any) — type matches connected then/else handles

Usage Pattern - Control Mode

[trigger] → [condition: isActive] → control:if
                                         ├─ if → [process active user]
                                         └─ else → [send activation email]

Usage Pattern - Data Mode

[condition: isPremium] → control:if ← [then: "Premium Support"]
                              ↑
                        [else: "Basic Support"]
                              ↓
                         [value] → [display message]

Related pages