Skip to content
Agentic Workflowdocs
v0.9.0Install free

nodes / builtin / flow

Route by value

Route items to any number of named branches, with a fallback for the rest

Flow ExtensionWeb app

Formerly Switch. The step was renamed in AWFlow 0.9; searching for the old name still finds it.

Send each item down one of several named branches, with a fallback branch for the rest.

workflow · classify-and-route.awf 8 steps

Classify and Route: a workflow with 8 steps, starting with Run now and ending with Other branch, with 1 branching point.

Open in AWFlow

Switch has one output per rule you add, named after the rule, plus a fallback output for items that match no rule. If gives you two branches; Switch gives you as many as you need, without nesting IF nodes.

There are two ways to pick the branch, set with Mode:

  • Rules: each rule has its own Conditions, built like the ones in IF. Rules are tried from top to bottom, and by default the first one that matches wins, so put narrow rules above broad ones. A rule with no conditions never matches.
  • Expression: one value, Value To Match, is compared with each rule’s Output Name. The item goes to the branch whose name is exactly that value. The comparison is done as text, so the number 200 matches a branch named 200.

Items that match nothing go to the fallback branch (Anything else by default). Turn off Add A Fallback Branch and they are dropped instead. Set On Multiple Matches to Every match to send an item to every branch it matches.

New Route by value steps (version 2) build conditions as cards, one rule per card:

  • Match all or Match any applies to a whole group of rules, and Add group nests a group inside another, so “A and (B or C)” is easy to read. AND / OR between cards is shown for you.
  • Operators have plain names, grouped by type: is equal to, contains, matches pattern (advanced), length is… and so on. Lists and objects are compared by their content.
  • Options › Type check: Loose converts values when it can (with a warning), Strict fails the step and names the rule and the item when a value has the wrong type. Ignore case compares texts without caring about capitals (an Aa ignored chip shows it).
  • An empty date or number never counts as a date or as 0: the rule is false and the run log says why. An invalid pattern or date fails with “Condition N: …”.

Steps saved before 0.9 keep their rows, read top to bottom with each row’s own AND/OR. Update in the step’s header converts them to groups with exactly the same meaning. XOR means “exactly one of the two” (it used to behave like OR); it is only offered on rows that already use it.

  • Route items to Billing, Bug or Other depending on words in their title (Rules mode).
  • Split a list by a status or category field whose values are the branch names (Expression mode).
  • Handle three or more cases where you would otherwise chain IF nodes.

For two branches, If is simpler. To drop non-matching items, use Filter.

SettingTypeWhat it does
Mode ChoiceDecide the branch by conditions, or by matching a value to a name. Options: Rules, Expression. Default: Rules
Rules List of entriesOne per branch, tried from top to bottom.
Rules (each entry) › Output Name (required)TextName of the branch items matching this rule are sent to.
Rules (each entry) › Conditions ConditionsWhen these hold, the item takes this branch.
Value To Match ValueCompared against each output name, in Expression mode.
On Multiple Matches ChoiceWhether an item takes only the first matching branch, or every one. Options: First match only, Every match. Default: First match only
Add A Fallback Branch ToggleSend items matching no rule to an output of their own. Default: On
Fallback Name TextName of the branch for items matching no rule. Default: Anything else
  • In Expression mode, rules only need an Output Name; their conditions are ignored. Set Value To Match to the field to compare, for example {{ $input.status }}, and name the rules after the possible values (open, closed). Matching is case-sensitive.
  • A rule left without a name is called Rule 1, Rule 2, and so on. Two rules with the same name get a suffix, such as Urgent (2).
  • Anything else

More ports appear as you add them in the settings (one per rule).

Items leave unchanged through the branch they took. Connections are tied to the branch name: reordering rules keeps every connection in place, but renaming a rule removes the connection that left it, and the canvas tells you so.

None. This node needs no connection and has no slots for other nodes.

Handle support tickets by status:

  1. Http Request gets https://api.example.com/tickets, which returns a list of tickets.
  2. Split Out with Field To Split Out data and Output field name ticket makes one item per ticket.
  3. Switch with Mode Expression, Value To Match {{ $input.ticket.status }}, and two rules named urgent and open. Keep the fallback named Anything else.
  4. From urgent: Slack posts {{ $input.ticket.title }} to your support channel. From open: Todoist creates a task. Leave Anything else unconnected to ignore the rest.
  • “Switch needs at least one rule. Add one, and name the branch it routes to.” Add a rule under Rules.
  • “No source node is connected to this node.” Connect a node to the Switch input.
  • Everything goes to the fallback. In Rules mode, a rule without conditions never matches, so check each rule has its conditions. In Expression mode, the value must equal an Output Name exactly, including capital letters and spaces.
  • A connection disappeared after editing a rule. You renamed the rule, which disconnects its branch. Reconnect it from the new name.
  • An item went down only one branch although it matched two. On Multiple Matches is First match only. Switch it to Every match.
  • If: two branches, true or false.
  • Filter: keep only matching items.
  • Funnel: bring the branches back together afterwards.
  • Text Classifier: let an AI model pick the category first.
Edit page

Last updated:

Was this page useful?
Ask Aria about Route by value