Skip to main content

If Else Condition

Overview

The If Else Condition node routes an incoming value to one of two downstream paths. It evaluates a scripting expression and forwards the input through either the True or False output port.

Purpose

Use this node when a workflow needs a two-way branch, such as approved/rejected, valid/invalid, or high-priority/normal processing.

The node does not change the input payload. It only decides which output path receives it.

Configuration

FieldDescription
CodeRequired scripting code. The code must evaluate to a Boolean value: true or false.

The configuration dialog uses the General Node form with a scripting code editor. The editor supports autocomplete resources, scripting snippets and utilities, and the scripting guide.

Helpful tips for writing the script:

  • Use Ctrl+Space for autocomplete.
  • Use Node_ID when you need to read the node input object.
  • Use the available scripting utilities for common operations.

For full scripting language documentation, see Scripting Documentation.

Inputs

InputData TypeInput TypeDescription
InputAnySingleAny Input

Outputs

OutputData TypeCollectionDescription
TrueAnyFalseReceives the original input when the script returns true.
FalseAnyFalseReceives the original input when the script returns false.

Processing Logic

  1. The node receives an input on the Input port.
  2. The configured code is evaluated as a Boolean scripting expression.
  3. If the result is true, the input is sent through the True port.
  4. If the result is false, the input is sent through the False port.

If workflow execution is stopped while the script is running, the script evaluation is cancelled.

Examples

Route records based on a property:

return properties.get("ORDER_STATUS") == "APPROVED";

Route based on a data object input:

var input = CustomScript_1.asDataObject();
return input != null;

Notes / Limitations

  • The script must return a Boolean value. Other result types can cause execution to fail.
  • The input is passed through unchanged; only the selected output path changes.
  • For more than two branches, use the Switch Case node.