A2A Client Setup
1. Initialize A2A Client
2. Verify Agent Card
3. Send Your First Task
Message Structure (A2A-Specific)
Multi-Part Messages
A2A’s key advantage is multi-part messages combining text, data, and files:Skill Invocation Methods
Natural Language (Flexible)
Explicit Skill (Deterministic)
Hybrid Approach (Recommended)
A2A Response Format
New in AdCP 1.6.0: All responses include unified status field.Canonical Response Structure
AdCP responses over A2A MUST include at least oneDataPart (kind: ‘data’) containing the task response. A TextPart (kind: ‘text’) for human-readable messages is recommended but optional.
A2A-Specific Fields
- taskId: A2A task identifier for streaming updates
- contextId: Automatically managed by A2A protocol
- artifacts: Multi-part deliverables with text and data parts
- status: Same values as MCP for consistency (A2A TaskState enum)
Processing Artifacts
AdCP responses use the lastDataPart as authoritative when multiple data parts exist (e.g., from streaming operations):
Push Notifications (A2A-Specific)
A2A defines push notifications natively viaPushNotificationConfig. When you configure a webhook URL, the server will POST task updates directly to your endpoint instead of requiring you to poll.
Best Practice: URL-Based Routing
Recommended: Encode routing information (task_type, operation_id) in the webhook URL, not the payload.
Why this approach?
- ✅ Industry standard pattern - Widely adopted for webhook routing across major APIs
- ✅ Separation of concerns - URLs handle routing, payloads contain data
- ✅ Protocol-agnostic - Same pattern works for MCP, A2A, REST, future protocols
- ✅ Cleaner handlers - Route with URL framework, not payload parsing
SSE Streaming (A2A-Specific)
A2A’s key advantage is real-time updates via Server-Sent Events:Task Monitoring
Real-Time Updates Example
A2A Webhook Payload Examples
Example 1:Task payload for completed operation
When a task finishes, the server sends the full Task object with task result in .artifacts:
completed or failed status, the AdCP task result MUST be in .artifacts[0].parts[], NOT in status.message.parts[].
Example 2: TaskStatusUpdateEvent for progress updates
During execution, interim status updates can include optional data in status.message.parts[]:
async-response-data.json. Note that interim status schemas are evolving and may change in future versions, so implementors may choose to handle them more loosely.
A2A Webhook Payload Types
Per the A2A specification, the server sends different payload types based on the situation:| Payload Type | When Used | What It Contains |
|---|---|---|
Task | Final states (completed, failed, canceled) or when full context needed | Complete task object with all history and artifact data |
TaskStatusUpdateEvent | Status transitions during execution (working, input-required) | Lightweight status change with message parts |
TaskArtifactUpdateEvent | Streaming artifact updates | Artifact data as it becomes available |
Taskfor final results (completed,failed)TaskStatusUpdateEventfor progress updates (working,input-required)
Webhook Trigger Rules
Webhooks are sent when all of these conditions are met:- Task type supports async (e.g.,
create_media_buy,sync_creatives,get_products) pushNotificationConfigis provided in the request- Task runs asynchronously — initial response is
workingorsubmitted
completed, failed, rejected), no webhook is sent—you already have the result.
Status changes that trigger webhooks:
working→ Progress update (task actively processing)input-required→ Human input neededcompleted→ Final result availablefailed→ Error detailscanceled→ Cancellation confirmed
Data Schema Validation
Thestatus.message.parts[].data field in A2A webhooks uses status-specific schemas:
| Status | 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) |
async-response-data.json
Webhook Handler Example
Context Management (A2A-Specific)
Key Advantage: A2A handles context automatically - no manual context_id management needed.Automatic Context
Explicit Context (Optional)
Multi-Modal Messages (A2A-Specific)
A2A’s unique capability - combine text, data, and files in one message:Creative Upload with Context
Campaign Brief + Assets
Available Skills
All AdCP tasks are available as A2A skills. Use explicit invocation for deterministic execution: Task Management: For comprehensive guidance on tracking async operations across all domains, polling patterns, and webhook integration, see Task Management.Skill Structure
Available Skills
- Media Buy:
get_products,list_creative_formats,create_media_buy,update_media_buy,sync_creatives,get_media_buy_delivery,list_authorized_properties,provide_performance_feedback - Signals:
get_signals,activate_signal
Agent Cards
A2A agents advertise capabilities via Agent Cards at.well-known/agent.json:
Discovering Agent Cards
Sample Agent Card Structure
AdCP Extension
Recommended: Include theextensions.adcp field in your agent card to declare AdCP support programmatically.
- Clients can discover AdCP capabilities without making test calls
- Declare which protocol domains you implement (media_buy, creative, signals)
- Enable compatibility checks based on version
Integration Example
A2A-Specific Considerations
Error Handling
File Upload Validation
Best Practices
- Use hybrid messages for best results (text + data + optional files)
- Check status field before processing artifacts
- Leverage SSE streaming for real-time updates on long operations
- Reference Core Concepts for status handling patterns
- Use agent cards to discover available skills and examples
Next Steps
- Core Concepts: Read Core Concepts for status handling and workflows
- Task Reference: See Media Buy Tasks and Signals
- Protocol Comparison: Compare with MCP integration
- Examples: Find complete workflow examples in Core Concepts