03/Flow Routing
Rule Router
Deterministic if-then branching on request features.
The rule router assigns AND-ed conditions to each outgoing edge; the first matching edge in document order wins. If none match, a mandatory "else" edge fires. It uses a safe fixed field+operator catalog, not free-form expressions.
Available signals
- input_chars
- Character count of the input text (length).
- message_count
- Number of messages in the conversation.
- has_vision
- Whether the request includes images.
- has_tools
- Whether the request includes tool/function definitions.
- stream
- Whether it is a streaming request.
- plan
- The user's subscription plan.
- username
- The requesting user.
rule router
# document order — first match wins
if has_vision == true → vision-model
if input_chars >= 8000 AND plan == "pro" → big-context-model
else → default-modelEntry
routerRuleif-then
Vision
Big context
Default
Every rule router must have exactly one "else" edge. Both the panel and the backend enforce this — so a request is never left unrouted.