Linea Docs

If-Else Node

Branch execution based on a boolean Jexl expression evaluated against the current workflow state.

If-Else Node

The if-else node evaluates a boolean expression and routes execution to one of two branches.

Configuration Fields

FieldTypeDescription
conditionstringJexl expression that resolves to a boolean

Expression Context

The condition is evaluated with Jexl (not raw JavaScript) with these context variables:

VariableValue
inputvariables.input — the original trigger payload
lastOutputvariables.lastOutput — output of the previous node
variablesAll variables set during the current execution

Output

{ "condition": true, "branch": "if" }

or

{ "condition": false, "branch": "else" }

Wiring

Connect the outgoing edge from the if source handle to the node that runs when the condition is true. Connect the else handle to the alternative path. Both handles must be connected for the graph to be valid.

Expression Examples

lastOutput.score > 0.8
input.status == "approved"
variables.retryCount < 3
lastOutput.items.length > 0
input.role == "admin" && lastOutput.verified == true

Jexl uses == and != for equality (not ===). It does not support typeof, template literals, or destructuring. For complex logic, use a Transform node first to reshape the data, then pass the result into the if-else condition.

Example Config

{
  "condition": "lastOutput.confidence > 0.75"
}

On this page