> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Route • Rust AI Agent SDK

> Route: Route pattern - conditional branching

# Route

> Defined in the [**workflows**](../modules/workflows) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Route pattern - conditional branching

## Fields

| Name        | Type                                               | Description                        |
| ----------- | -------------------------------------------------- | ---------------------------------- |
| `condition` | `Box&lt;dyn Fn(&str) -&gt; bool + Send + Sync&gt;` | Condition function                 |
| `if_true`   | `Arc&lt;Agent&gt;`                                 | Agent to use if condition is true  |
| `if_false`  | `Option&lt;Arc&lt;Agent&gt;&gt;`                   | Agent to use if condition is false |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/workflows/mod.rs#L332">
  `praisonai/src/workflows/mod.rs` at line 332
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Routing" icon="route" href="/docs/rust/routing" />

  <Card title="Rust Router" icon="arrows-split" href="/docs/rust/router" />

  <Card title="Rust Conditions" icon="code-branch" href="/docs/rust/conditions" />
</CardGroup>
