Task Status System
Every AdCP response includes astatus field that tells you exactly what state the operation is in and what action you should take next.
Status Values
AdCP uses the same status values as the A2A protocol’s TaskState enum:| Status | Meaning | Your Action |
|---|---|---|
submitted | Task queued for execution | Show “queued” indicator, wait for updates |
working | Agent actively processing | Show progress, poll frequently for updates |
input-required | Needs information from you | Read message field, prompt user, send follow-up |
completed | Successfully finished | Process data, show success message |
canceled | User/system canceled task | Show cancellation notice, clean up |
failed | Error occurred | Show error from message, handle gracefully |
rejected | Agent rejected the request | Show rejection reason, don’t retry |
auth-required | Authentication needed | Prompt for auth, retry with credentials |
unknown | Indeterminate state | Log for debugging, may need manual intervention |
Response Structure
Every AdCP response has this structure:Client Decision Logic
Basic Status Handling
Advanced Status Patterns
1. Clarification Flow
When status isinput-required, the message tells you what’s needed:
2. Approval Flow
Human approval is a special case ofinput-required:
3. Long-Running Operations
Async operations start withworking and provide updates:
- MCP: Poll with context_id for updates
- A2A: Subscribe to SSE stream for real-time updates
Async Operations
Operation Types
AdCP operations fall into three categories:-
Synchronous - Return immediately with
completedorfailedlist_creative_formats,list_authorized_properties- Fast operations that don’t require external systems
-
Interactive - May return
input-requiredbefore proceedingget_products(when brief is vague or needs clarification)- Operations that need user input to proceed
-
Asynchronous - Return
workingorsubmittedand require polling/streamingcreate_media_buy,activate_signal,sync_creatives,get_products- Operations that integrate with external systems or require human approval
Timeout Handling
Set reasonable timeouts based on operation type:Context Management
Session Continuity
Thecontext_id maintains conversation state across requests:
Context Expiration
Contexts typically expire after 1 hour of inactivity:Task Management & Webhooks
Task Tracking
All async operations return atask_id at the protocol level for tracking:
Push Notification Architecture
Both MCP and A2A use HTTP webhooks for async task updates. Instead of polling, you provide a webhook URL and the server POSTs status changes to you directly.| Aspect | MCP | A2A |
|---|---|---|
| Spec Status | AdCP specifies this | Native protocol feature |
| Configuration | pushNotificationConfig | pushNotificationConfig |
| Envelope | mcp-webhook-payload.json | Task or TaskStatusUpdateEvent |
| Data Location | result field | status.message.parts[].data |
| Data Schemas | Identical AdCP schemas | Identical AdCP schemas |
MCP Webhooks
MCP doesn’t define push notifications. AdCP fills this gap by specifying the webhook configuration (pushNotificationConfig) and payload format (mcp-webhook-payload.json).
Note: If MCP adds native push notification support in future versions, AdCP will adopt that mechanism in a future major version to maintain alignment with the protocol’s evolution.Envelope:
mcp-webhook-payload.jsonData location:
result field
A2A Webhooks
A2A defines push notifications natively. Per the A2A spec, the server sendsTask, TaskStatusUpdateEvent, or TaskArtifactUpdateEvent depending on what changed.
Data location: status.message.parts[].data
Unified Data Schemas
The data payload uses identical AdCP schemas regardless of envelope format:completed/failed, use the full task response schema. For other statuses, use the status-specific schemas.
When Webhooks Are Called
Webhooks are triggered when all of the following are true:- Task type supports async execution (e.g.,
get_products,create_media_buy,sync_creatives) pushNotificationConfigis provided in the request- Task requires async processing — initial response is
workingorsubmitted
completed, failed, rejected), no webhook is sent — the client already has the final result.
Status changes that trigger webhooks:
working→ Progress updateinput-required→ Human input neededcompleted→ Final result availablefailed→ Error detailscanceled→ Cancellation confirmed
Push Notification Format by Protocol
MCP: HTTP Webhook POST
When an MCP async operation changes status, the publisher POSTs to your webhook URL. Envelope Schema:mcp-webhook-payload.json
A2A Webhook POST
A2A sendsTask (for final states) or TaskStatusUpdateEvent (for progress updates):
Status-Specific Data Schemas
The data payload (result in MCP, status.message.parts[].data in A2A) uses status-specific schemas:
| Status | Data Schema | Contents |
|---|---|---|
completed | [task]-response.json | Full task response (success branch) |
failed | [task]-response.json | Full task response (error branch) |
working | [task]-async-response-working.json | Progress info (percentage, step) |
input-required | [task]-async-response-input-required.json | Requirements, approval data |
submitted | [task]-async-response-submitted.json | Acknowledgment (usually minimal) |
Supported Async Operations
Each async operation uses its main response schema forcompleted/failed statuses:
| Task | Response Schema |
|---|---|
get_products | get-products-response.json |
create_media_buy | create-media-buy-response.json |
update_media_buy | update-media-buy-response.json |
sync_creatives | sync-creatives-response.json |
MCP Webhook URL Patterns
For MCP HTTP webhooks, structure URLs to identify the operation:pushNotificationConfig, push notifications are sent for all status changes after the initial response. The data payload uses the same schema regardless of transport (MCP webhook or A2A native message).
Task State Reconciliation
Usetasks/list to recover from lost state:
Status Progression
Tasks progress through predictable states:submitted: Task queued for execution, provide webhook or pollworking: Agent actively processing, poll frequentlyinput-required: Need user input, continue conversationcompleted: Success, process resultsfailed: Error, handle appropriately
Webhook Reliability
Delivery Semantics
AdCP webhooks use at-least-once delivery semantics with the following characteristics:- Not guaranteed: Webhooks may fail due to network issues, server downtime, or configuration problems
- May be duplicated: The same event might be delivered multiple times
- May arrive out of order: Later events could arrive before earlier ones
- Timeout behavior: Webhook delivery has limited retry attempts and timeouts
Security
Webhook Authentication (Required)
AdCP adopts A2A’s PushNotificationConfig structure for webhook configuration. This provides a standard, flexible authentication model that supports multiple security schemes. Configuration Structure (A2A-Compatible):-
Bearer Token (Simple, Recommended for Development)
-
HMAC Signature (Enterprise, Recommended for Production)
- Bearer tokens: Simple, good for development and testing
- HMAC signatures: Prevents replay attacks, recommended for production
- Credentials exchanged out-of-band (during publisher onboarding)
- Minimum 32 characters for all credentials
- Store securely (environment variables, secret management)
- Support credential rotation (accept old and new during transition)
Retry and Circuit Breaker Patterns
Publishers MUST implement retry logic with circuit breakers to handle temporary buyer endpoint failures without overwhelming systems or accumulating unbounded queues.Retry Strategy
Publishers SHOULD use exponential backoff with jitter for webhook delivery retries:- Attempt 1: Immediate
- Attempt 2: After ~1 second (with jitter)
- Attempt 3: After ~2 seconds (with jitter)
- Attempt 4: After ~4 seconds (with jitter)
- Give up after 4 total attempts
Circuit Breaker Pattern
Publishers MUST implement circuit breakers to prevent webhook queues from growing unbounded when buyer endpoints are down:- CLOSED: Normal operation, webhooks delivered
- OPEN: Endpoint is down, webhooks are dropped (not queued)
- HALF_OPEN: Testing if endpoint recovered, limited webhooks sent
Queue Management
Publishers SHOULD implement bounded queues with overflow policies:- Set max queue size based on available memory and recovery time
- Monitor queue depth and dropped webhook counts
- Alert operations when queues are consistently full
- Use dead letter queues for manual investigation of persistent failures
- Implement queue per buyer endpoint (not global queue)
Implementation Requirements
Idempotent Webhook Handlers
Always implement idempotent webhook handlers that can safely process the same event multiple times:Sequence Handling
Use timestamps to ensure proper event ordering:Polling as Backup
Use polling as a reliable backup mechanism:Webhook Event Format
AdCP webhook events include all necessary information for processing, with task-specific data inresult:
Security Considerations
Webhook Authentication
Verify webhook authenticity using the authentication method specified during webhook registration:Replay Attack Prevention
Use timestamps and event IDs to prevent replay attacks:Best Practices Summary
- Always implement polling backup - Don’t rely solely on webhooks
- Handle duplicates gracefully - Use idempotent processing with event IDs
- Check timestamps - Ignore out-of-order events based on timestamps
- Return 200 quickly - Acknowledge webhook receipt immediately
- Verify authenticity - Always validate webhook signatures
- Log webhook events - Keep audit trail for debugging
- Set reasonable timeouts - Don’t wait forever for webhook delivery
- Graceful degradation - Fall back to polling if webhooks consistently fail
Reporting Webhooks
In addition to task status webhooks, AdCP supports reporting webhooks for automated delivery performance notifications. These webhooks are configured during media buy creation and follow a scheduled delivery pattern.Configuration
Reporting webhooks are configured via thereporting_webhook parameter in create_media_buy:
Publisher Commitment
When a reporting webhook is configured, publishers commit to sending: (campaign_duration / reporting_frequency) + 1 notifications- One per frequency period during the campaign
- One final notification at campaign completion
- Delayed notifications if data isn’t ready within expected delay window
Payload Structure
Reporting webhooks deliver the same payload asget_media_buy_delivery with additional metadata:
scheduled: Regular periodic updatefinal: Campaign completeddelayed: Data not yet available (prevents missed notification detection)
Webhook Aggregation
Publishers SHOULD aggregate webhooks when multiple media buys share the same webhook URL, reporting frequency, and reporting period. This reduces webhook volume significantly for buyers with many active campaigns. Example: Buyer with 100 active campaigns receives:- Without aggregation: 100 webhooks per reporting period
- With aggregation: 1 webhook containing all 100 campaigns in
media_buy_deliveriesarray
media_buy_deliveries as an array, even when it contains a single media buy.
Timezone Handling
For daily and monthly frequencies, the publisher’s reporting timezone (from product’sreporting_capabilities.timezone) determines period boundaries:
- Daily: Midnight to midnight in publisher’s timezone
- Monthly: 1st to last day of month in publisher’s timezone
- Hourly: UTC unless specified
Implementation Requirements
- Array Handling: Always process
media_buy_deliveriesas an array (may contain 1 to N media buys) - Idempotent Processing: Same as task webhooks - handle duplicates safely
- Sequence Tracking: Use
sequence_numberto detect gaps or out-of-order delivery - Fallback Strategy: Continue polling
get_media_buy_deliveryas backup - Delay Handling: Treat
"delayed"notifications as normal, not errors - Frequency Validation: Ensure requested frequency is in product’s
available_reporting_frequencies - Metrics Validation: Ensure requested metrics are in product’s
available_metrics
Error Handling
Error Categories
-
Protocol Errors - Transport/connection issues
- Handle with retries and fallback
- Not related to AdCP business logic
-
Task Errors - Business logic failures
- Returned as
status: "failed"with error details - Should be displayed to user
- Returned as
-
Validation Errors - Malformed requests
- Fix request format and retry
- Usually development-time issues
Error Response Format
Failed operations return statusfailed with details:
Human-in-the-Loop Workflows
Design Principles
- Optional by default - Approvals are configured per implementation
- Clear messaging - Users understand what they’re approving
- Timeout gracefully - Don’t block forever on human input
- Audit trail - Track who approved what when
Approval Patterns
Protocol-Agnostic Examples
Product Discovery with Clarification
Campaign Creation with Approval
Migration Guide
From Custom Status Fields
If you’re using custom status handling: Before:Backwards Compatibility
During the transition period, responses may include both old and new fields:Next Steps
- MCP Integration: See MCP Guide for tool calls and context management
- A2A Integration: See A2A Guide for artifacts and streaming
- Protocol Comparison: See Protocol Comparison for choosing between MCP and A2A