Skip to content
Agentic Workflowdocs
v0.8.2Install free

concepts / flow

Splitting and branching

Send items down different paths with IF, Switch or Filter, so the workflow does different things depending on the data.

IF checks {{ $input.length }} is greater than 500 for three pages. Two long pages leave through True and go to the summary step. One short page leaves through False.

Example run: Pages, 3 items → IF · True, 2 items → IF · False, 1 item. Illustration of a run. The items are not changed, only routed.

Output of IF · True
#titlelength
0Annual report5400
1Pricing FAQ1800
Illustration of a run. The items are not changed, only routed.

A branch can look like this on the canvas:

flowchart LR
  T[Hotkey] --> A[Get All Text] --> B{"IF: longer than 500 characters?"}
  B -->|True| C[Summarization] --> D[Display Markdown]
  B -->|False| D2[Display Markdown]
  class T awf-trigger
  class A awf-data
  class B awf-flow
  class C awf-ai
  class D,D2 awf-io

Each condition compares a value, usually an expression such as {{ $input.price }}, with another value. Pick the type first (String, Number, Date-Time, Boolean, Array or Object): it decides which operators you get, such as Contains, Is Equal To or Is Not Empty. Link several conditions with AND (all must hold) or OR (one is enough).

IF and Switch outputs are named ports. Edges attach to a port by its name, so reordering Switch rules keeps every connection in place. See named outputs on branching nodes.

  • Leave a port unconnected to stop those items there. It’s the simplest way to say “do nothing otherwise”.
  • Join branches again with Merge when you need data from both, or with Funnel when either branch is enough to continue. See Merging.
  • Branch on an AI result with Text Classifier or Switch on its label. See Branching on AI results.
Nothing ran after the IF

Every item went out of the other port. Open the IF node’s output to see which port the items took, then check the condition’s type: comparing "10" as a String with 9 gives a different answer than comparing numbers.

An item went to Switch’s fallback branch

No rule matched it. In Rules mode, rules are tried from top to bottom and the first match wins, so put narrow rules above broad ones. A rule with no conditions never matches.

An item went down two Switch branches

On Multiple Matches is set to Every match. Set it back to the first match if each item should take one path.

A Merge after an IF outputs nothing

Only one branch ran, so the other Merge input is empty and an Inner Join finds no pairs. When the run should simply continue with whichever branch ran, join the branches with Funnel instead.

Ask Aria