Skip to content

Lazy Conditional

Selects and returns the first value whose paired condition is true, evaluating inputs lazily. Only the first satisfied branch (or the else branch if none are true) is computed and pulled, saving time and resources. Supports up to 10 condition/value pairs.
Preview

Usage

Use this node to route data based on multiple boolean conditions without computing every branch. Connect condition1/value1 through condition10/value10 in priority order. The node checks condition1 first, then condition2, and so on, returning the corresponding value for the first true condition. If no conditions are true, the else input is returned if provided.

Inputs

FieldRequiredTypeDescriptionExample
value1FalseWILDCARDValue to output if condition1 is true. Evaluated only if condition1 is true.An image, text, model, or any data type
condition1FalseBOOLEANFirst boolean condition (highest priority). Must be provided via a connection.True
value2FalseWILDCARDValue to output if condition2 is true and condition1 is false.Alternative data to route
condition2FalseBOOLEANSecond boolean condition. Checked only if condition1 is false.False
value3FalseWILDCARDValue to output if condition3 is true and all prior conditions are false.Another branch output
condition3FalseBOOLEANThird boolean condition. Checked only if condition1 and condition2 are false.False
value4FalseWILDCARDValue to output if condition4 is true and all prior conditions are false.Branch 4 output
condition4FalseBOOLEANFourth boolean condition.False
value5FalseWILDCARDValue to output if condition5 is true and all prior conditions are false.Branch 5 output
condition5FalseBOOLEANFifth boolean condition.False
value6FalseWILDCARDValue to output if condition6 is true and all prior conditions are false.Branch 6 output
condition6FalseBOOLEANSixth boolean condition.False
value7FalseWILDCARDValue to output if condition7 is true and all prior conditions are false.Branch 7 output
condition7FalseBOOLEANSeventh boolean condition.False
value8FalseWILDCARDValue to output if condition8 is true and all prior conditions are false.Branch 8 output
condition8FalseBOOLEANEighth boolean condition.False
value9FalseWILDCARDValue to output if condition9 is true and all prior conditions are false.Branch 9 output
condition9FalseBOOLEANNinth boolean condition.False
value10FalseWILDCARDValue to output if condition10 is true and all prior conditions are false.Branch 10 output
condition10FalseBOOLEANTenth boolean condition.False
elseFalseWILDCARDFallback value returned if all conditions are false. Evaluated only when needed.Default or safe output

Outputs

FieldTypeDescriptionExample
valueWILDCARDThe selected output: the first value whose condition is true, or the else value if no conditions are true.The routed data corresponding to the satisfied branch

Important Notes

  • Order matters: The node checks conditions from 1 to 10 and returns the first matching value.
  • Lazy evaluation: Only the required branch (and its value) is computed/fetched based on the conditions.
  • Optional inputs: All inputs are optional in the interface, but conditions must be connected for branches you intend to use.
  • Else fallback: If no conditions are true and no else is provided, the output will be empty/null.
  • Type flexibility: Values are WILDCARD; ensure the downstream node can handle the selected value's type.
  • Limit: Supports up to 10 condition/value pairs.

Troubleshooting

  • Node requests a specific condition or value input: Connect the indicated conditionN or valueN. The node lazily asks only for what is needed to resolve the first true branch.
  • Unexpected null/empty output: All conditions may be false and no else input was provided. Connect an else value or ensure at least one condition becomes true.
  • Wrong branch selected: Verify the order and logic of your conditions; the node selects the first true condition in sequence.
  • Performance concerns: Large or heavy value branches not selected are not evaluated. If you still see overhead, check upstream nodes for unnecessary pre-computation.
  • Downstream type mismatch: Since outputs are WILDCARD, ensure the chosen branch produces a type compatible with the next node.