# Router (/workflows/blocks/router)





The **Router block** selects a path by matching context to route descriptions. Use it for intent or unstructured text. Use [Condition](/workflows/blocks/condition) for an exact boolean rule that needs no model tokens.

<BlockPreview type="router" />

## Triage a request [#triage-a-request]

<WorkflowPreview workflow="ROUTER_TRIAGE_WORKFLOW" />

Pass `<start.input>` as Context, describe Sales, Support, and Billing routes, and connect each port to its handler. Also connect the error port for requests that fit no route.

## Configuration [#configuration]

| Field | Behavior |
| - | - |
| **Context** | Text to analyze, often `<start.input>` or `<agent.content>`. |
| **Routes** | Each route has a title and a description of when to choose it. It adds a separate output port. |
| **Model** | Defaults to `claude-sonnet-5-5`. Select a supported model, including a compatible local Ollama or vLLM model. |

Make descriptions specific and distinguishable. For example, “Payments, invoices, and refunds” separates Billing from general product support. Test the routes on representative requests rather than assuming a larger model always routes more accurately.

Sim Cloud supplies credentials for supported hosted models. Other models and self-hosted deployments can require your own credentials.

### Fallback models [#fallback-models]

Under **Additional fields**, add up to five fallbacks. **Retry on fail** exhausts the selected model's attempts first; each fallback is then tried once using the same context and routes. This behavior also applies to legacy Router blocks.

Hosted models use workspace BYOK or platform credentials where available. Same-provider fallbacks reuse the selected model's key; a different provider can need a secret selected on its row. Auto cannot be a fallback. A completed `NO_MATCH` decision does not trigger another model request.

## Outputs [#outputs]

| Reference | Value |
| - | - |
| `<router.selectedRoute>` | Selected route ID |
| `<router.reasoning>` | Explanation of the decision |
| `<router.context>` | Analyzed context |
| `<router.model>` | Model that answered |
| `<router.tokens>` | Token usage |
| `<router.cost>` | Estimated cost in USD, as an object with `input`, `output`, and `total`; read `<router.cost.total>` for the total |
| `<router.selectedPath>` | Destination object with `blockId`, `blockType`, and `blockTitle` |

An unconnected route returns `selectedPath` with `blockId: ""`, `blockType: "unknown"`, and `blockTitle` set to the chosen route's title.

The Logs UI and run-resource API use credits. See [Costs](/platform/costs) for units and billing behavior.

Only the selected path runs. There is no fixed route-count limit, but overlapping descriptions become harder to distinguish as routes grow.

## Handle unmatched requests [#handle-unmatched-requests]

<Callout type="warn">
  If no route fits, the model's `NO_MATCH` decision raises a routing error. Connect the error port to a fallback handler; it is not a normal successful route output.
</Callout>

The model is instructed to prefer a fitting route and use NO\_MATCH when all routes are unrelated. This remains a model judgment, so validate routes before using them for consequential actions.

## Route to child workflows [#route-to-child-workflows]

<WorkflowPreview workflow="ROUTER_CLASSIFY_WORKFLOW" />

A Product route can call a product-intake workflow while Bug report calls bug triage. The same structure can separate enterprise leads from self-service onboarding.

## Related docs [#related-docs]

* [Condition](/workflows/blocks/condition)
* [Workflow](/workflows/blocks/workflow)
* [Connections](/workflows/connections)
