Control - If
Type identifier:
control:ifCategory: 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 |
|---|---|---|---|
|
| Yes | Execution trigger input |
|
| Yes | Boolean value to evaluate |
Data Mode (ifType: "data")
Handle | Data Type | Required | Description |
|---|---|---|---|
|
| Yes | Boolean value to evaluate |
|
| No | Value to output if condition true |
|
| No | Value to output if condition false |
Output Handles
Control Mode (ifType: "control")
Handle | Data Type | Description |
|---|---|---|
|
| Triggered when condition is truthy |
|
| Triggered when condition is falsy |
Data Mode (ifType: "data")
Handle | Data Type | Description |
|---|---|---|
|
| The selected value (then or else input) |
Configuration Options
Property | Type | Required | Default | Description |
|---|---|---|---|---|
|
| Yes |
| Display label for the node |
|
| No |
| 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:
- Node receives trigger on the
triggerinput handle - Resolves the
conditioninput value - Evaluates truthiness of the condition
- Triggers either
iforelseoutput 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:
- Resolves the
conditioninput value - Based on condition, resolves either
thenorelseinput - Outputs the selected value on the
valuehandle
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 | Control: triggers |
Condition is | Control: triggers |
Condition is | Treated as falsy, follows |
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 UIelse(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 connectedthen/elsehandles
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]