> ## 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 typed handoff asynchronously with schema validation.

# execute\_async

AsyncMethod

> This is a method of the [**TypedHandoff**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/TypedHandoff.md) class in the [**handoff**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/handoff.md) module.

Execute typed handoff asynchronously with schema validation.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def execute_async(source_agent: 'Agent', payload: Union[T, dict, str], context: Optional[Dict[str, Any]]) -> HandoffResult
```

## Parameters

**source\_agent** `Agent` *required*

The agent initiating the handoff

**payload** `Union[T, dict, str]` *required*

The typed payload (Pydantic model instance or dict) OR a string prompt (for backward compatibility)

**context** `Optional`

Optional additional context

### Returns

**Returns** `HandoffResult`

HandoffResult with response or error

### Exceptions

> [accordion] HandoffValidationError
>
> If payload validation fails

## Uses

* `execute_async`
* `time.time`
* `validated_payload.model_dump_json`
* `json.dumps`
* `logger.info`
* `achat`
* `asyncio.get_event_loop`
* `loop.run_in_executor`
* `HandoffResult`
* `asyncio.wait_for`

## Used By

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

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/handoff.py#L1770)
>
> `praisonaiagents/agent/handoff.py` at line 1770

***

## Related Documentation

> [card] [Async Feature](https://praison.ai/docs/docs/features/async)

> [card] [Background Tasks](https://praison.ai/docs/docs/features/background-tasks)

> [card] [Async Jobs](https://praison.ai/docs/docs/features/async-jobs)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.