return_immediately allows non-blocking agent interactions.
Quick Start
Async Task Processing with return_immediately
Send requests that return immediately while the agent processes in the background.
How It Works
| Component | Purpose | Benefit |
|---|---|---|
return_immediately | Non-blocking task submission | Improved client responsiveness |
| Push Notifications | Proactive status updates | Eliminates need for constant polling |
| Webhook Configuration | Flexible delivery endpoints | Integration with existing systems |
Configuration Options
TaskPushNotificationConfig
Configure webhook delivery for task status updates.| Option | Type | Default | Description |
|---|---|---|---|
id | str | None | Configuration identifier |
task_id | str | Required | Task to monitor for updates |
url | str | Required | Webhook endpoint URL |
token | str | None | Verification token |
authentication | AuthenticationInfo | None | Auth configuration |
AuthenticationInfo
Authentication details for webhook requests.| Option | Type | Default | Description |
|---|---|---|---|
scheme | str | Required | Auth scheme (e.g., “Bearer”) |
credentials | str | None | Auth credentials/token |
return_immediately Configuration
Blocking vs Non-blocking Requests
Default Behavior (Blocking):Polling Pattern
Push Notification JSON-RPC Methods
Available Methods
| Method | Purpose | Support |
|---|---|---|
tasks/pushNotificationConfig/set | Register webhook config | Extension required |
tasks/pushNotificationConfig/get | Retrieve webhook config | Extension required |
tasks/pushNotificationConfig/list | List all webhook configs | Extension required |
tasks/pushNotificationConfig/delete | Remove webhook config | Extension required |
Default Error Response
When push notifications are not supported:Custom Push Notification Implementation
Complete Implementation Example
Webhook Client Configuration
Agent Card Capabilities
Push Notification Advertisement
The Agent Card declares push notification support:pushNotifications is false (default), all push notification methods return -32601 errors.
Common Patterns
- Async + Polling
- Async + Webhooks
- Webhook Security
Best Practices
Webhook Reliability
Webhook Reliability
Implement proper webhook handling with retries and failure logging.
Task Timeout Handling
Task Timeout Handling
Set appropriate timeouts for long-running tasks.
Webhook Security
Webhook Security
Always validate webhook authenticity and implement proper error handling.
Graceful Degradation
Graceful Degradation
Design your application to work with or without push notifications.
Related
A2A Protocol
Core A2A server setup and configuration
A2A Tasks
Task lifecycle and state management
A2A Client
Client SDK with polling examples
Async Features
General async processing patterns

