Task Management
AdCP provides unified task management for tracking all async operations across media-buy and signals domains. This enables state reconciliation, progress monitoring, and webhook integration for long-running operations.Overview
AdCP operations may complete immediately (~1 second), take processing time (~60 seconds), or require extended execution (minutes to days). Task management provides visibility and control over these async operations regardless of their domain or complexity. Core Tasks:tasks/list- List and filter async operations for state reconciliationtasks/get- Poll specific tasks for status, progress, and results
- Cross-Domain Coverage: Works for both media-buy and signals operations
- State Reconciliation: Prevents lost or orphaned operations
- Webhook Integration: Optional push notifications for completion
- Progress Tracking: Real-time status updates for active operations
- Error Recovery: Detailed error information and retry guidance
Task Status Lifecycle
All AdCP operations follow a consistent status progression:Status Definitions
| Status | Description | Duration | Client Action |
|---|---|---|---|
submitted | Queued for long-running execution | Hours to days | Poll periodically or wait for webhook |
working | Actively processing | < 120 seconds | Poll frequently (5-10s intervals) |
input-required | Paused, waiting for user input | Until input provided | Read message, provide clarification |
completed | Successfully finished | Final | Process results, stop polling |
failed | Failed due to error | Final | Handle error, potentially retry |
canceled | Canceled by user | Final | Clean up, stop polling |
rejected | Rejected before starting | Final | Review rejection reason |
auth-required | Needs authentication | Until auth provided | Provide credentials |
unknown | Indeterminate state | Variable | Check again or escalate |
Status Transitions
Immediate Completion: Simple operations may skip tocompleted without intermediate states.
Working vs Submitted: working indicates active processing with completion expected within 120 seconds, while submitted indicates queued execution that may take much longer.
tasks/list
List and filter async tasks across your account to enable state reconciliation and operation tracking. Response Time: ~1 second (simple database lookup) Request Schema:https://adcontextprotocol.org/schemas/v1/core/tasks-list-request.json
Response Schema: https://adcontextprotocol.org/schemas/v1/core/tasks-list-response.json
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
filters | object | No | Filter criteria for querying tasks |
sort | object | No | Sorting parameters |
pagination | object | No | Pagination controls |
include_history | boolean | No | Include full conversation history for each task (default: false) |
Filtering Options
Status and Type Filtering
Domain-Specific Filtering
Date and Context Filtering
Response Structure
Common Use Cases
State Reconciliation
Find all pending operations across domains:Domain-Specific Monitoring
Track only media-buy operations:Operations Needing Attention
Lost Connection Recovery
Recover from lost task submissions by examining conversation history:history[0].data to see original requests and identify your lost task:
tasks/get
Poll a specific task by ID to check status, progress, and retrieve results when complete. Response Time: ~1 second (simple database lookup) Request Schema:https://adcontextprotocol.org/schemas/v1/core/tasks-get-request.json
Response Schema: https://adcontextprotocol.org/schemas/v1/core/tasks-get-response.json
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | Yes | Unique identifier of the task to retrieve |
include_history | boolean | No | Include full conversation history for this task (default: false) |
Response Structure
Basic Task Information
Progress Information
Task with Conversation History
Failed Task Errors
Polling Patterns
Basic Polling Loop
Smart Polling with Domain Awareness
Protocol Integration
Task management works consistently across all AdCP protocols.MCP Integration
A2A Integration
Natural Language
Explicit Skill Invocation
Webhook Integration
Task management integrates with protocol-level webhook configuration for push notifications.Webhook Configuration
Configure webhooks at the protocol level when making async task calls. See Core Concepts: Protocol-Level Webhook Configuration for complete setup examples. Quick example:Webhook POST Format
When a task’s status changes, the publisher POSTs a payload with protocol fields at the top-level and the task-specific payload nested underresult to your webhook URL.
Webhook Payload Schema: https://adcontextprotocol.org/schemas/v1/core/webhook-payload.json
Top-level fields:
operation_id(required) — Correlates a sequence of updates for this operationdomain- AdCP domain (“media-buy” or “signals”)task_type(required) — e.g., “create_media_buy”, “sync_creatives”, “activate_signal”status(required) — Current task statustask_id(optional) — Present when server exposes task tracking idcontext_id(optional) — Conversation/session idmessage(optional) — Human-readable contexttimestamp(optional) — ISO 8601 time when webhook was generatedresult(optional) — Task-specific payload for this statuserror(optional) — Error message string when status isfailed
submitted (long-running operations).
When webhooks are NOT triggered:
- Initial response is
completed,failed, orrejected→ Synchronous response, client already has result - Initial response is
working→ Will complete synchronously within ~120 seconds, client should wait for response
submitted operations only):
- Status changes to
input-required→ Webhook called (alerts that human input needed) - Status changes to
completed→ Webhook called (final result available) - Status changes to
failed→ Webhook called (error details provided) - Status changes to
canceled→ Webhook called (cancellation confirmed)
input-required webhook (human approval needed):
completed webhook (after approval granted - full create_media_buy response):
Webhook Handling Example
Webhook Reliability
Important: Webhooks use at-least-once delivery semantics and may be duplicated or arrive out of order. See Core Concepts: Webhook Reliability for detailed implementation guidance including:- Idempotent webhook handlers
- Sequence handling and out-of-order detection
- Security considerations (signature verification)
- Polling as backup mechanism
- Replay attack prevention
Error Handling
Common Error Scenarios
- Task Not Found: Invalid task ID or access permissions
- Invalid Filters: Malformed filter criteria in tasks/list
- Pagination Errors: Invalid offset or limit values
- Permission Denied: Task exists but user lacks access
Error Response Format
Best Practices
State Reconciliation
- Run
tasks/listwith pending filters during application startup - Check for old tasks that may be stuck in
submittedstatus - Use domain filtering to focus on relevant operation types
- Include webhook status to understand notification expectations
Performance Optimization
- Use pagination for accounts with many operations
- Filter by date ranges to limit results to relevant periods
- Use
include_history: falseby default to keep responses lightweight - Implement exponential backoff for polling loops
Monitoring and Alerting
- Monitor
input-requiredtasks for user attention needs - Alert on tasks stuck in
submittedstatus beyond expected duration - Track
failedtasks for error reporting and system health - Use domain breakdown to understand operation distribution
Integration Patterns
- Store task IDs with your application entities for later reference
- Use webhooks as primary notification mechanism, polling as backup
- Implement proper error handling for both webhook and polling failures
- Consider domain-specific polling intervals and timeout values
Related Documentation
- Core Concepts - Protocol fundamentals and design principles
- MCP Guide - MCP-specific implementation patterns
- A2A Guide - A2A-specific integration examples
- Media Buy Reference - Domain-specific task documentation
- Signals Reference - Signal-specific task documentation