RAiN — Rivium AI Network
Back to Help

Agents Route — send work to the right specialist

Most requests a business gets are not one kind of thing. An email arrives and it is either a billing question, a technical fault, or somebody who is upset. Each needs a different specialist and a different reply.

An Agents Route is the step that sorts them. It has as many named exits as the work has kinds, and each exit leads to the agent who deals with that kind.

Add one from the canvas toolbar: Add agents route.

What it looks like

                  Who handles this?
        ┌─────────────┬─────────────┬──────────────┐
     Billing      Technical     Complaint     Front desk
        │             │             │              │
   Refund agent  Support agent  Manager       A human

Each exit is a name you choose and a rule that decides when it applies. The last exit, Otherwise, is always there.

Setting it up

Right-click the node and choose Edit task.

What is being sorted — the words on the node, and what the run trace calls this step. "Who handles this?" is a fine default.

How it chooses — two ways:

  • By a rule — it looks at something (usually the step before) and compares it against each exit in turn. Free, instant, and it gives the same answer every time.
  • Ask a model — it asks a question and the model answers with one of your exit names. Use this for the judgement a comparison can't make. It costs a model call each time the step runs.

Exits — add as many as you need. Each has a name, a comparison, and a value:

Name
Billing contains invoice
Technical contains broken
Big order is greater than 1000

They are tried top to bottom, and the first match wins. So put the most specific ones first: if "Refunded" and "Refund requested" both match the same words, the one above wins.

And everything else — the fallback exit. Rename it to whatever it really means to you: "Front desk", "Needs a human", "No".

Giving it a supervisor

Join an agent to the left side of the route and that agent becomes the one deciding. Its role and goal frame the question — "You are the Front Desk Supervisor. Send each enquiry to the right team." — so the choice is made in the voice of whoever you'd actually put in charge of it.

It doesn't change which model does the choosing; the model picker still does that. And it doesn't let the supervisor improvise: the answer still has to be one of your exit names, and anything else takes Otherwise.

A route with no supervisor works fine. On the rule setting there's nothing for one to do.

Joining the exits up

Naming an exit doesn't send anything anywhere. Drag from the dot under each exit to the top of the step that should handle it — the same way you join any two steps on the canvas.

An exit that isn't joined to anything ends the run when it's taken. That is sometimes what you want and usually isn't, so it's worth checking each one.

What each exit can lead to

A whole sub-Sequence, not just one step. An exit leads to a step, that step leads on to the next, and so on — so "Billing" can be five steps run by your refunds agent while "Technical" is three steps run by someone else.

Exits can also lead to another route, which is how you sort twice: first by department, then by what kind of problem it is inside that department.

Two exits may point at the same step. Triage often sends three different kinds of request to the same apology.

Why Otherwise always exists

Because the request nobody planned for is the one you most need to see. Without a fallback, an unmatched request would stop halfway down the Sequence with no sign of what happened. With one, it arrives somewhere you chose — usually a human, or a step that files it for review.

Questions people ask

How is this different from a condition? A condition splits two ways on one test — yes or no. A route has as many exits as you need, each with its own rule. Use a condition for "did the payment succeed?" and a route for "which team handles this?".

Can I still use a condition? Yes. Nothing about conditions has changed, and for a genuine yes/no a condition is the clearer thing to read on the canvas.

What happens if two exits both match? The one higher up the list wins. Order them deliberately.

What if the model answers with something that isn't an exit name? It takes Otherwise. The model is told to reply with one of your exit names and nothing else, and anything else — including a helpful sentence explaining its choice — is treated as no answer rather than guessed at.

I renamed an exit. Did I lose where it goes? No. Joins remember the exit itself, not its name, so renaming "Billing" to "Payments" leaves the line exactly where you drew it.

Can a route send work back to an earlier step? Yes, and it's a normal thing to do — "not ready, go round again". A Sequence that loops is stopped after a fixed number of steps so it can't run forever.

Does a route cost anything to run? Not on the rule setting. "Ask a model" costs one model call each time the step runs, which is why the rule is the default.