Buni.aiDocs
USSDChatbotVoice (IVR)Automation

Router

Sends the flow down one of several paths based on conditions you define, checked top to bottom, with an optional fallback path.

Router picks one path out of several. It checks each path's condition from top to bottom and sends the flow down the first one that is true. A fallback path catches everything that matches none of them.

When to use it

  • Branch on a USSD menu reply: input == 1 goes to one screen, input == 2 to another.
  • Branch on a value an earlier node saved, such as {{state.tier}} or an API response.
  • Combine several checks on one path with AND or OR.
  • If you only need to stop the flow when something is false, Filter is simpler.
  • For logic that is easier to write as code, compute a value in a Function node and route on it here.
Router settings panel in Builder mode with two paths and the fallback path switched on

Settings

Prop

Type

A new Router starts with one path, input == 1, and the fallback path.

What you can test

In a condition, input is whatever the previous node passed on. On USSD it is the user's reply to the menu. state.<name> reads any variable an earlier node saved. In Expression mode you can write any JavaScript expression that returns true or false:

state.balance >= 100 && state.kycStatus === 'verified'

Outputs

HandleWhen the flow takes it
One per path, labelled with its conditionThat path's condition is the first to be true.
defaultFallback path is on and no path matched.

The router does not change the data passing through it: the next node receives the same input the router did.

Example

A USSD main menu offers 1. Check balance, 2. Buy airtime. A Router after it sends each reply to the right screen and everything else to an Error node that shows "Invalid choice" and returns to the menu.

PathConditionConnects to
1input == 1Balance screen
2input == 2Airtime amount screen
default(fallback)Error node, then back to the menu

Tips and limits

  • Connect every path, including the fallback. USSD and chatbot projects refuse to publish a router with an unconnected path. Automation projects publish it, but the paths below the gap are then matched to the wrong connections.
  • Keep a router to 10 paths or fewer on USSD, chatbot and automation projects. Paths are matched to their connections in text order of the handle number, so from an 11th path onward the pairing breaks. Split a long list across two routers.
  • The fallback path must be last, and there can be only one. The editor keeps it last for you.
  • A USSD menu reply arrives as text. The builder's is operator quotes the value for you (input === '1'). In Expression mode, write input === '1' or the loose input == 1; input === 1 never matches.
  • On voice projects, a path whose condition is true but has no connection is skipped, and the router keeps checking the paths below it.
Last reviewed 24 September 2026

On this page