Linea Docs

Router Node

Multi-branch routing node that evaluates a list of Jexl conditions and routes to the first matching branch.

Router Node

The router node evaluates a prioritized list of conditions and routes execution to the first branch whose condition is true. If no condition matches, the fallback branch none is taken.

Configuration Fields

FieldTypeDescription
routesarrayOrdered list of { id, label, condition } route objects

Each route object:

FieldTypeDescription
idstringUnique branch identifier — must match the edge's source handle
labelstringHuman-readable label shown on the canvas
conditionstringJexl expression evaluated against current state

Output

{ "branch": "high_priority", "label": "High Priority" }

If no route matches:

{ "branch": "none" }

Expression Context

Same as if-else: input, lastOutput, variables.

Wiring

Each outgoing edge must set its source handle to the id of the corresponding route. Add a none edge as a fallback to handle the no-match case.

Routes are evaluated in order. The first matching route wins. If you need mutual exclusion, order your conditions from most specific to least specific.

Example Config

{
  "routes": [
    { "id": "critical",  "label": "Critical",  "condition": "lastOutput.severity == 'critical'" },
    { "id": "high",      "label": "High",       "condition": "lastOutput.severity == 'high'" },
    { "id": "low",       "label": "Low / Info", "condition": "true" }
  ]
}

On this page