Routing
Routing rules decide which agent handles each incoming broker event — deterministic rules first, an LLM fallback second.
When a broker receives an event (a PR opens, an alert fires), routing decides which agent picks it up.
broker event ──► routing rules ──► agent inbox ──► agent runs
(unrouted) match (matched) (claims & acts)
│
└─ no rule matched ──► LLM fallback names an agentWhat a rule matches on
| Filter | Field | Example |
|---|---|---|
| Source broker | definitionId | github (omit = any source) |
| Event type | eventType | issue.opened (omit = any event) |
| Payload predicate | predicateExpression | $.repository.name == "api" |
- The predicate is an
and/or/nottree of{ path, cmp, value }leaves over the event payload. Operators:==,!=,contains,matches,in. Paths are JSONPath ($.a.b,$.items[0]). - A rule targets one agent (or a workflow, with inputs mapped from the event).
How an event flows
- New broker messages sit unrouted.
- Each active rule is checked against each message; a match drops it into the target agent's inbox (
routed_by: rule). - One event can match multiple rules → it lands in multiple agents' inboxes (deduped per agent).
- If no rule matches, an LLM fallback names an agent (
routed_by: llm). - The agent's runner claims the inbox item and acts on it.
Priority is display-only
priority just orders rules in your list — it does not decide matching. Every
active rule is evaluated against every message.
Manage rules
Any org member with write access manages routing — no platform-admin needed. Ask your connected agent, or call the tools:
| You want to… | Tool |
|---|---|
| List rules | routing_rules_list |
| Create / update / delete | routing_rules_create · routing_rules_update · routing_rules_delete |
| Turn a rule on / off | routing_rules_activate · routing_rules_deactivate |
| Fix a mis-route | routing_corrections_create |
Route GitHub issues labelled "bug" in repo
apito @triage-agent.
A correction reassigns one specific message to the right agent (routed_by: correction) — use it when a rule (or the LLM) sent something to the wrong place. It's a one-off fix, not a rule.
Agents can author rules too — but only disposable ones (they must set an expiry), and an agent can only edit rules it created.