Skip to content

If

Evaluates a specified condition between inputs A and B and returns either a boolean result or one of two provided inputs based on the outcome. Supports a wide range of comparisons and a custom expression mode. Implements lazy evaluation so only inputs required to resolve the condition are computed.
Preview

Usage

Use this node to branch workflow logic. Choose a condition (e.g., equality, inequality, membership, logical ops) or provide a custom expression. If 'Return Inputs' is enabled, the node forwards TRUE_IN or FALSE_IN depending on the condition result; otherwise it outputs a boolean. Ideal for gating downstream tasks, selecting between alternative inputs, or performing dynamic checks using custom expressions.

Inputs

FieldRequiredTypeDescriptionExample
conditionTrueCHOICEThe condition to evaluate. Options include: 'A is TRUE', 'B is TRUE', 'A is NONE', 'B is NONE', 'A == B', 'A != B', 'A > B', 'A >= B', 'A < B', 'A <= B', 'A is B', 'A is not B', 'A in B', 'B in A', 'A & B', 'A \| B', 'A ^ B', 'CUSTOM'.A == B
require_inputsTrueBOOLEANIf enabled, forwards TRUE_IN or FALSE_IN to the output based on the evaluated result. If disabled, outputs a boolean instead.true
NOTTrueBOOLEANInvert the result after evaluation. Use with care when comparing non-boolean types.false
custom_expressionTrueSTRINGExpression evaluated when condition is set to CUSTOM. May reference A, B (also a, b) and named global variables from Memory Storage nodes. Most standard Python-like expressions are supported.2*a == 5*b + 2
AFalseANYFirst input value to evaluate. Only computed if the chosen condition or custom expression requires it (lazy evaluation).5
BFalseANYSecond input value to evaluate. Only computed if the chosen condition or custom expression requires it (lazy evaluation).5
TRUE_INFalseANYValue to forward if the evaluated result is True and 'Return Inputs' is enabled.Path A selected
FALSE_INFalseANYValue to forward if the evaluated result is False and 'Return Inputs' is enabled.Path B selected

Outputs

FieldTypeDescriptionExample
*ANYIf 'Return Inputs' is enabled: forwards TRUE_IN or FALSE_IN based on the condition. If disabled: returns a boolean representing the evaluation result.true

Important Notes

  • This node uses lazy evaluation: only inputs necessary for the chosen condition or custom expression are computed.
  • When condition is CUSTOM, A and B referenced in the expression must be provided (not None).
  • If 'Return Inputs' is enabled, ensure TRUE_IN and FALSE_IN are connected; otherwise the output may be None depending on the branch taken.
  • The NOT option inverts the evaluated result. With non-boolean types, inversion behavior follows the underlying type's semantics; prefer boolean outputs when unsure.
  • Membership checks ('A in B', 'B in A') require B or A, respectively, to be a container supporting membership tests.
  • Logical operations ('A & B', 'A | B', 'A ^ B') expect types supporting these operators (e.g., booleans, bitwise-capable types).

Troubleshooting

  • Condition always returns False: Verify A and B are provided and of compatible types for the chosen comparison. For CUSTOM, confirm variables (A/a, B/b) are correctly referenced.
  • Output is None while 'Return Inputs' is enabled: Ensure the corresponding TRUE_IN or FALSE_IN is connected for the branch taken.
  • Type error or unexpected behavior on logical/bitwise ops: Confirm A and B support the selected operator ('&', '|', '^'). Convert or adjust types as needed.
  • CUSTOM expression not evaluated: Make sure condition is set to CUSTOM and custom_expression is non-empty. Check syntax and that referenced variables exist.
  • Membership tests fail: Ensure the right-hand operand of 'in' is a valid container (e.g., list, dict, string) and types are comparable.