03/Flow Routing

Router Types

The seven router types and when to use each.


Each router is a "decision unit" that picks one of its outgoing edges. There are two paradigms: condition-based branching (content, semantic, rule) and best-pick / split (score, weighted, canary).

RouterLooks atDecisionExample use
ContentMessage meaning (LLM)Branch by categoryTopic-based expert model
SemanticMessage meaning (embedding)Nearest categoryCheap/fast topic routing
RuleRequest featuresFirst matching rule (if-then)By size/vision/plan
ScoreNode metricsBest (min) scoreFastest/cheapest/idle
WeightedWeightsWeighted randomLoad spreading
CanaryPercent + traceA/B split + arm tagGradual rollout
Round RobinCounterCycle in orderEven distribution
Routers compose: one branch of a content router can lead to a score router, which leads to members. The power of the graph is this composability.
greetingcode
Entry
routerSemanticgreeting / code
Chat model
routerScoremetric: cost
Cheap coder
Coder B
Nested routers example