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

# Execute Programmatic • AI Agent SDK

> execute_programmatic: Execute handoff programmatically (not via LLM tool call).

# execute\_programmatic

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**Handoff**](../classes/Handoff) class in the [**handoff**](../modules/handoff) module.

Execute handoff programmatically (not via LLM tool call).

This is the unified programmatic handoff API that replaces Agent.delegate().

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def execute_programmatic(source_agent: 'Agent', prompt: str, context: Optional[Dict[str, Any]]) -> HandoffResult
```

## Parameters

<ParamField query="source_agent" type="Agent" required={true}>
  The agent initiating the handoff
</ParamField>

<ParamField query="prompt" type="str" required={true}>
  The task/prompt to pass to target agent
</ParamField>

<ParamField query="context" type="Optional" required={false}>
  Optional additional context
</ParamField>

### Returns

<ResponseField name="Returns" type="HandoffResult">
  HandoffResult with response or error
</ResponseField>

## Uses

* `time.time`
* `logger.info`
* `chat`
* `HandoffResult`
* `logger.error`

## Used By

* [`Agent.handoff_to`](../functions/Agent-handoff_to)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/handoff.py#L367">
  `praisonaiagents/agent/handoff.py` at line 367
</Card>
