Skip to content

Simple If

Evaluates a boolean condition and conditionally routes one or more input values to paired True/False outputs. The node supports truly dynamic inputs and outputs: each connected value_N input generates two outputs (value_N_true and value_N_false). Actual branch selection is handled by the Salt engine at runtime; this node emits both branches while storing the condition for downstream routing.
Preview

Usage

Use this node to branch execution based on a condition. Connect one or more value_N inputs you want to route. For each connected value, wire value_N_true to the nodes that should run when the condition is True and value_N_false to the nodes that should run when the condition is False. The engine will execute only the branch that matches the evaluated condition. This node is also suitable for loop patterns by feeding outputs back to earlier steps.

Inputs

FieldRequiredTypeDescriptionExample
conditionTrueBOOLEANBoolean condition that controls routing. True selects the True branch; False selects the False branch. Non-boolean values are coerced to boolean.True
value_1False*First value to route based on condition. Connecting this reveals value_2. Up to 100 values are supported.Any data type (text, number, object, image, etc.)
value_2False*Second value to route based on condition. Appears after value_1 is connected.Any data type
value_3 ... value_100False*Additional routed values. Inputs appear progressively as the previous value_N is connected.Any data type

Outputs

FieldTypeDescriptionExample
value_1_true*Routed output for value_1 when condition is True. Only the matching branch is executed downstream.Same type as value_1
value_1_false*Routed output for value_1 when condition is False. Only the matching branch is executed downstream.Same type as value_1
value_2_true*Routed output for value_2 when condition is True.Same type as value_2
value_2_false*Routed output for value_2 when condition is False.Same type as value_2
value_N_true / value_N_false*For each connected input value_N, two outputs are created: value_N_true and value_N_false.Same type as corresponding value_N

Important Notes

  • Engine requirement: This node requires the Salt engine's dynamic I/O support.
  • Dynamic I/O: Outputs are generated only for connected value_N inputs. Each input creates two outputs (True/False).
  • Routing behavior: The node returns both True and False outputs; the engine uses the stored condition to execute only the matching branch.
  • Condition coercion: Non-boolean condition values (including strings like "true"/"false") are coerced to boolean; unexpected types may log warnings.
  • Scalability: Supports up to 100 routed inputs (value_1 to value_100).
  • Branch merging: To join branches after conditional execution, use the Merge If Branches node (SaltConditionalMerge).

Troubleshooting

  • Outputs not visible: Connect value_1 (and subsequent values) to reveal the corresponding True/False outputs. Outputs only appear for connected inputs.
  • Wrong branch runs or no execution: Verify the condition input resolves to the expected boolean at runtime. Check upstream nodes and ensure the condition is wired correctly.
  • Unexpected data type warnings: If you see logs about non-boolean condition values, ensure the condition input provides a BOOLEAN, or provide a clean True/False value.
  • Downstream node still runs on the other branch: Confirm your downstream connections are wired to the correct value_N_true or value_N_false outputs. The engine will skip the non-matching branch based on the stored condition.
  • Need to rejoin branches: Insert a Merge If Branches node after the conditional paths and wire each branch into a different input on the merge node.