Branches and filters
A filter stops a run unless a condition holds. A branch splits a run into paths and sends it down the first path whose condition holds, like if, else if, otherwise. Both read fields that earlier steps and the trigger produced.
Neither one costs credits, calls a model or fails a run on its own. A run that a filter stops ends quietly, without failing: the steps after the filter show as skipped, with the reason "stopped by filter" and the filter's name.
Filter: carry on only when
- Console
- YAML
- Hover the line where the check belongs and click the +.
- Choose Filter.
- Under Condition, pick a field, an operator and a value. Click Done.
The panel says "The run carries on only when this is true. Otherwise it stops quietly, without failing."
A filter node has filter.when instead of stepRef:
- id: paid
title: Only paid orders
filter:
when: {field: order.status, op: eq, value: paid}
next: [size]
To keep an email out before a run even exists, use Start only when on the trigger instead. It costs nothing at all. See Triggers.
Branch: the first path that holds
A branch has up to 8 paths, checked in order. The first path whose condition holds runs, and the others do not. If none holds, the run takes the Otherwise path when there is one. With no Otherwise path, the run ends quietly on that branch.
So order matters: put the narrowest case first. If path 1 is total >= 5000 and path 2 is total >= 1000, an order of 6000 takes path 1 only.
- Console
- YAML
- Hover the line where the split belongs and click the +.
- Choose Branches. The branch appears with a path.
- Click the path's label (Path 1). Set its condition, then click Done.
- Use the branch's menu, Add a path, for more paths. Order them top to bottom.
- Optional: choose Add an "Otherwise" path for what runs when no path holds.
- Click the + on each path to add the steps that follow it.
Paths are drawn as colored lines out of the branch, each labeled with its condition. The paths can come together again at a later step.
A branch node has a branch list instead of stepRef. Each case has a when and its own next. The "otherwise" is branchDefault, a list of nodes, kept apart from the cases because a case with no condition is a case not set up yet. A branch has no next of its own.
- id: size
title: How big is the order?
branch:
- when: {expr: 'order.total >= 5000'}
next: [review]
- when: {field: order.total, op: gte, value: 1000}
next: [tell]
branchDefault: [done]
A complete example
A webhook receives orders. A filter drops anything unpaid. A branch tells the admins about large orders, tells them more quietly about medium ones, and lets small ones go straight on. All three paths meet at one last step.
First, the webhook connection the flow listens on:
apiVersion: lumen.ai/v1alpha1
kind: Connector
metadata:
name: branches-orders-hook
namespace: tenant-acme
spec:
classRef: {name: webhook}
config: {signature: none}
Then the flow:
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: branches-order-router
namespace: tenant-acme
spec:
displayName: Route paid orders by size
triggers:
- id: order
ref: {name: webhook-received}
connectorRef: {name: branches-orders-hook}
config:
mapping:
- {name: total, type: number, jsonPath: $.order.total}
- {name: status, type: string, jsonPath: $.order.status}
- {name: customer, type: string, jsonPath: $.order.customer}
next: [paid]
nodes:
- id: paid
title: Only paid orders
filter:
when: {field: order.status, op: eq, value: paid}
next: [size]
- id: size
title: How big is the order?
branch:
- when: {expr: 'order.total >= 5000'}
next: [review]
- when: {field: order.total, op: gte, value: 1000}
next: [tell]
branchDefault: [done]
- id: review
title: Ask the admins to review
stepRef: {name: notify-in-app}
config:
to: admins
title: Large order to review
body: "{order.customer}: {order.total}"
next: [done]
- id: tell
title: Tell the admins
stepRef: {name: notify-in-app}
config:
to: admins
title: Medium order
body: "{order.customer}: {order.total}"
next: [done]
- id: done
title: Log the order
stepRef: {name: notify-in-app}
config:
to: members
title: Order received
body: "{order.customer}"
For an order of 6000 that is paid, the run goes paid, size, review, done. For 1500 it goes through tell; for 200, size sends it straight to done by branchDefault. An unpaid order stops at paid.
Conditions
A condition is written one of two ways. Set one or the other, never both.
- A single comparison:
field,opandvalue. - An expression:
expr, a short text that can combine several comparisons.
A field is always <id>.<output>: a step or the trigger that comes before this node on every path to it, and one of its outputs. Two kinds of field are always available: the run's own (run.trigger, run.startedAt, run.date), and each.item and each.index inside a loop.
Operators
op | Console | Text form | Holds when |
|---|---|---|---|
eq | is | = | The field equals the value. Case counts. |
ne | is not | != | It does not. |
gt | greater | > | Number or date after the value. |
gte | at least | >= | |
lt | less | < | |
lte | at most | <= | |
contains | contains | ~ | The text, or the list, contains the value. Case does not count for text. |
exists | exists | EXISTS | The field has a value. Takes no value. |
The text form adds more:
| Text form | Console | Meaning |
|---|---|---|
!~ | doesn't contain | The text does not contain the value. |
IN (...), NOT IN (...) | in, not in | The field is one of a list of values. |
STARTS, ENDS | starts with, ends with | Case does not count. |
IS EMPTY, IS NOT EMPTY | is empty, is not empty | |
AND, OR, NOT, ( ) | Condition, Group | Combine comparisons. AND binds tighter than OR. Keywords are case-insensitive. |
order.total >= 1000 AND (order.customer ~ "acme" OR order.customer STARTS "Re:")
Values are numbers, "text" or 'text', true or false, or a date. A date is an RFC 3339 string such as 2026-12-24 or 2026-12-24T09:00:00+02:00, and two dates compare as times. A value can also be a placeholder like "{invoice.limit}" to compare two fields. In the console, Visual and Text show the same condition. The editor reports a syntax error with its column.
If a run does not have the field (the step that makes it did not run, or did not find it), every comparison on it is false, except IS EMPTY, which holds. In a branch that sends the run to the next path or to Otherwise. Use exists to test for presence on purpose.
The editor and the API check that a comparison fits the field: gt on a text field, or a text value against a number, is refused.
Skipped steps and joins
Steps on a path that was not taken are marked skipped in the run, with the reason ("no case of the branch held", "stopped by filter ..."). They cost nothing and make no fields.
A step that several paths lead to is a join. It runs once, after every path into it has either finished or been cut, on the combined documents of the paths that ran. Where two paths set the same field, the later one wins. If no path reached it, the join is skipped too. In the example above, done is a join of review, tell and the branch's default path, and only one of them ran.
Because a skipped step makes no fields, a step after a join should read only fields that every path makes, or test them with exists first.
A switched-off branch sends the run down its first path, and a switched-off filter lets everything through. See Steps.

