> ## 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 Async • AI Agent SDK

> execute_async: Execute handoff asynchronously with concurrency control.

# execute\_async

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

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

Execute handoff asynchronously with concurrency control.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def execute_async(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

* `asyncio.Semaphore`
* `time.time`
* `logger.info`
* `achat`
* `asyncio.get_event_loop`
* `loop.run_in_executor`
* `HandoffResult`
* `asyncio.wait_for`
* `HandoffTimeoutError`

## Used By

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

## Source

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Async Feature" icon="clock" href="/docs/features/async" />

  <Card title="Background Tasks" icon="spinner" href="/docs/features/background-tasks" />

  <Card title="Async Jobs" icon="list-check" href="/docs/features/async-jobs" />
</CardGroup>
