> For the complete documentation index, see [llms.txt](https://agpt.co/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://agpt.co/docs/integrations/block-integrations/route.md).

# Typesafe Route

Route unchanged data to one of five fixed output pins using a Jev choice.

## Jev Route

### What it is

Route data using Jev's typed choice. Plain-language option descriptions define each route; only the winning pin fires.

### How it works

Configure two to five options in the desired order. The first option corresponds to `option_1`, the second to `option_2`, and so on. Jev evaluates the question against the state; only the winning numbered pin emits the original `data`. The block also emits the selected option name, probabilities, and common request transparency.

Option descriptions define the decision criteria in plain language. The numbered pins are fixed even when fewer than five options are configured, and unused pins do not emit data. Calls are stateless and report any truncation of the supplied state. An API failure emits an error without firing a routing pin.

### Inputs

| Input    | Description                                                                                                                                     | Type            | Required |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | --------------- | -------- |
| state    | Text or JSON context shared by every question in this stateless call. JSON is compactly serialized; oversized context is truncated with a note. | State           | No       |
| question | Plain-language judgment deciding the route.                                                                                                     | str             | Yes      |
| options  | Two to five option names and qualifying descriptions; dictionary order assigns option\_1 to option\_5.                                          | Dict\[str, str] | Yes      |
| data     | Value forwarded unchanged on the winning route only.                                                                                            | Data            | No       |

### Outputs

| Output           | Description                                                                                                                                    | Type              |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
| error            | API failure details; emitted only when a call fails.                                                                                           | str               |
| request          | Verbatim JSON request body sent to Jev.                                                                                                        | str               |
| response         | Verbatim UTF-8 response body from Jev, or null if no response arrived. Invalid UTF-8 is preserved as a lossless Base64 data URL with an error. | str               |
| latency\_ms      | Wall-clock API call duration in ms.                                                                                                            | float             |
| input\_tokens    | Input tokens reported by the API, or null if unavailable on failure.                                                                           | int               |
| output\_tokens   | Output tokens reported by the API, or null if unavailable on failure.                                                                          | int               |
| request\_id      | TypeSafe request ID response header.                                                                                                           | str               |
| truncated        | Whether any input text was truncated.                                                                                                          | bool              |
| truncation\_note | Truncation details, or an empty string.                                                                                                        | str               |
| option\_1        | Data when the first configured option wins.                                                                                                    | Option 1          |
| option\_2        | Data when the second configured option wins.                                                                                                   | Option 2          |
| option\_3        | Data when the third configured option wins.                                                                                                    | Option 3          |
| option\_4        | Data when the fourth configured option wins.                                                                                                   | Option 4          |
| option\_5        | Data when the fifth configured option wins.                                                                                                    | Option 5          |
| choice           | Winning option name returned by Jev.                                                                                                           | str               |
| probabilities    | Probability for each configured option.                                                                                                        | Dict\[str, float] |

### Possible use case

**Team Routing**: Forward a support ticket to the branch corresponding to the responsible team.

**Resume Review Routing**: Send high-rated resume evaluations toward an email review branch and the remaining evaluations toward a sheet.

**Document Processing**: Send a classified document to its configured extraction or review workflow.

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://agpt.co/docs/integrations/block-integrations/route.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
