> ## 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.

# Routing Condition Protocol • AI Agent SDK

> RoutingConditionProtocol: Extended Protocol for conditions that support routing to targets.

# RoutingConditionProtocol

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

<Badge color="blue">AI Agent</Badge>

Extended Protocol for conditions that support routing to targets.

This extends ConditionProtocol with the ability to return target
tasks/steps based on the condition evaluation. Used primarily
by AgentTeam for task routing.

## Methods

<CardGroup cols={2}>
  <Card title="get_target()" icon="function" href="../functions/RoutingConditionProtocol-get_target">
    Get the target tasks/steps based on condition evaluation.
  </Card>
</CardGroup>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
class ApprovalCondition:
        def __init__(self, routes: Dict[str, List[str]]):
            self.routes = routes
        
        def evaluate(self, context: Dict[str, Any]) -> bool:
            decision = context.get("decision", "")
            return decision in self.routes
        
        def get_target(self, context: Dict[str, Any]) -> List[str]:
            decision = context.get("decision", "")
            return self.routes.get(decision, [])
```

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/conditions/protocols.py#L57">
  `praisonaiagents/conditions/protocols.py` at line 57
</Card>
