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

> execute_callback_sync: Synchronous wrapper to ensure that execute_callback is awaited,

# execute\_callback\_sync

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

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

Synchronous wrapper to ensure that execute\_callback is awaited,
preventing 'Task was destroyed but pending!' warnings if called
from non-async code.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def execute_callback_sync(task_output: TaskOutput) -> None
```

## Parameters

<ParamField query="task_output" type="TaskOutput" required={true}>
  No description available.
</ParamField>

## Uses

* `asyncio.get_running_loop`
* `loop.is_running`
* `loop.create_task`
* `execute_callback`
* `loop.run_until_complete`
* `asyncio.run`

## Used By

* [`AgentTeam.arun_task`](../functions/AgentTeam-arun_task)
* [`AgentTeam.run_task`](../functions/AgentTeam-run_task)

## Source

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