Lazy Conditional¶
Evaluates up to 10 boolean conditions in order and returns the first corresponding value whose condition is true. It is lazy: only the value for the first true condition (or the else value) is computed/requested; all other branches are not evaluated.

Usage¶
Use this node to select among multiple alternative inputs based on boolean conditions without incurring the cost of computing all branches. Connect condition1/value1 for the highest-priority branch, followed by condition2/value2, and so on. If no conditions are true, the node outputs the 'else' input if provided.
Inputs¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| value1 | False | WILDCARD | Value to output if condition1 is true. Evaluated lazily only when condition1 is true. | any supported type (e.g., text, image, number, dict) |
| condition1 | False | BOOLEAN | First condition tested. If true, value1 is selected. | true |
| value2 | False | WILDCARD | Value to output if condition2 is true and condition1 was false. | any supported type |
| condition2 | False | BOOLEAN | Second condition tested, after condition1. | false |
| value3 | False | WILDCARD | Value to output if condition3 is true and all prior conditions were false. | any supported type |
| condition3 | False | BOOLEAN | Third condition tested. | true |
| value4 | False | WILDCARD | Value to output if condition4 is true and all prior conditions were false. | any supported type |
| condition4 | False | BOOLEAN | Fourth condition tested. | false |
| value5 | False | WILDCARD | Value to output if condition5 is true and all prior conditions were false. | any supported type |
| condition5 | False | BOOLEAN | Fifth condition tested. | false |
| value6 | False | WILDCARD | Value to output if condition6 is true and all prior conditions were false. | any supported type |
| condition6 | False | BOOLEAN | Sixth condition tested. | false |
| value7 | False | WILDCARD | Value to output if condition7 is true and all prior conditions were false. | any supported type |
| condition7 | False | BOOLEAN | Seventh condition tested. | false |
| value8 | False | WILDCARD | Value to output if condition8 is true and all prior conditions were false. | any supported type |
| condition8 | False | BOOLEAN | Eighth condition tested. | false |
| value9 | False | WILDCARD | Value to output if condition9 is true and all prior conditions were false. | any supported type |
| condition9 | False | BOOLEAN | Ninth condition tested. | false |
| value10 | False | WILDCARD | Value to output if condition10 is true and all prior conditions were false. | any supported type |
| condition10 | False | BOOLEAN | Tenth condition tested. | false |
| else | False | WILDCARD | Fallback value if none of the conditions are true. Evaluated only if reached. | any supported type |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| value | WILDCARD | The selected value from the first true condition, or the 'else' value if no conditions are true. | the chosen branch output (e.g., an image, text, number, or object) |
Important Notes¶
- Order matters: Conditions are evaluated from condition1 to condition10; the first true condition wins.
- Lazy evaluation: Only the selected branch's value (or 'else') is computed. Unselected branches are not executed.
- Up to 10 branches: Supports at most 10 condition/value pairs.
- Boolean inputs: Each condition input must be provided for correct evaluation. The node may request missing conditions when needed.
- Type consistency downstream: The output type is WILDCARD; ensure downstream nodes can handle the type from whichever branch is selected.
- Fallback behavior: If no condition is true and 'else' is not connected, the output will be null/empty.
Troubleshooting¶
- No output produced: If the result is null, ensure at least one condition is true or connect the 'else' input.
- Unexpected branch selected: Verify the boolean values and remember that evaluation stops at the first true condition.
- Downstream type errors: Align the types of all possible branch outputs to what downstream nodes expect.
- Performance not improved: Confirm heavy computations are placed in branch values and that only the intended condition triggers them.
- Missing input requested: If the node asks for a specific condition or value, connect that input; the node requests only what is required for the chosen path.