Advanced10 min
Async Subagents: Background Task Delegation
Launch background subagents that run concurrently while the supervisor continues chatting — with start, check, update, cancel, and list lifecycle management.
Quick Reference
- →Async subagents run in the background while the supervisor agent continues interacting with the user
- →5-tool lifecycle: start_async_task, check_async_task, update_async_task, cancel_async_task, list_async_tasks
- →ASGI transport: subagent runs in the same process (co-deployed, low latency)
- →HTTP transport: subagent runs on a remote Agent Server (distributed, independent scaling)
- →Supervisor delegates complex tasks and checks results when ready — no blocking
- →Each subagent gets its own context window — context isolation prevents overflow
Sync vs. Async Subagents
Supervisor manages background subagents via 5 lifecycle tools — continues chatting while tasks run
| Aspect | Sync Subagent | Async Subagent |
|---|---|---|
| Execution | Blocks supervisor until done | Runs in background, supervisor continues |
| User experience | User waits for all subtasks | User chats while tasks run |
| Use case | Quick, focused subtasks (<10s) | Long-running tasks (research, analysis) |
| Complexity | Simple (function call) | Lifecycle management (5 tools) |
| Error handling | Error propagates immediately | Supervisor checks status, handles errors |
When to go async
Use async subagents when the task takes >10 seconds and the user shouldn't wait. Examples: web research, code generation across multiple files, data analysis on large datasets, or any task where the user might want to give additional instructions while work is in progress.