Open History to see the last commit
1---
2id: SubagentRouteOptions
3title: SubagentRouteOptions
4---
5
6Defined in: [packages/ai/src/activities/chat/agents/route.ts:8](https://github.com/TanStack/ai/blob/main/packages/ai/src/activities/chat/agents/route.ts#L8)
7
8## Type Parameters
9
10### TAgents
11
12`TAgents` *extends* `ReadonlyArray`\<[`DefinedAgent`](DefinedAgent.md)\>
13
14## Properties
15
16### then?
17
18```ts
19optional then?: readonly TAgents[number]["name"][];
20```
21
22Defined in: [packages/ai/src/activities/chat/agents/route.ts:22](https://github.com/TanStack/ai/blob/main/packages/ai/src/activities/chat/agents/route.ts#L22)
23
24Agents that run after the other selected agents. The lead group starts
25together. The `then` agents then run one after another in list order, and
26each reads the text so far. Used only when the router picks at least one
27agent from each group. Otherwise `pick` returns `{ names, order }`.
28
29***
30
31### when?
32
33```ts
34optional when?: { [K in string]: string };
35```
36
37Defined in: [packages/ai/src/activities/chat/agents/route.ts:15](https://github.com/TanStack/ai/blob/main/packages/ai/src/activities/chat/agents/route.ts#L15)
38
39Question text for every agent. The key is the agent name.
40Omit this and each question uses that agent's description.