Wire up A2A Push Notifications and check the webhook boundary
Check Agent Card capability, config lifecycle and webhook authentication for A2A push notifications, item by item.
Prerequisites and input · Engineering checks · 1. Read the Agent Card and judge capability
At a glance
A long task does not always suit a held-open connection. A2A lets the remote agent send an HTTP POST to a client-supplied webhook URL to announce task updates. This note follows the A2A specification snapshot read on 2026-11-12 and splits integration into three parts: the capability check, creating and maintaining the configuration, and authenticating on the receiving side, ending in a checklist you can tick off. The specification gives only limited delivery guarantees, so the text points out what the receiver has to cover itself.
Runtime and applicability
- Article type
- Engineering practice
- Verified
- Applies to
- A2A Wire up A2A Push Notifications and check the webhook boundary
Execution locations and responsibilities
- A2A client and remote agent Use the workflow below to distinguish responsibilities of the caller, runtime, and external actions.
Arrows show the order of checks in the guide. Follow each step’s prerequisites, branches and stop conditions; unexecuted steps are not completed work.
When to use
- Push notifications are an optional capability. When
capabilities.pushNotificationsis false or absent, the create, get, list and delete configuration operations must returnPushNotificationNotSupportedError. The specification advises clients to inspect the Agent Card before using optional capabilities, so read the card first instead of trying the call.
When not to use
- Delivery is only guaranteed to be attempted at least once and may stop after consecutive failures; a notification cannot be the sole source of the task result, so confirm terminal state and artifacts with
GetTask. - The specification says a configuration persists until task completion or explicit deletion but gives no concrete automatic cleanup time, so the caller should delete after the terminal state and verify it.
- The specification defines only the
schemeandcredentialsshape ofauthentication; it sets no format for signatures, timestamps or replay protection, so any such measure is a local design that should be labeled as local.
Prerequisites and input
- You have fetched the remote Agent Card and can read the value of
capabilities.pushNotifications. - You have an HTTPS callback address reachable by the remote agent and a credential prepared for this one configuration.
- You can query the task with
GetTaskand know the caller's authorization scope, since every task-related operation passes a server-side authorization check.
Engineering checks
Layer 1: is the capability declared — Push notifications are an optional capability. When capabilities.pushNotifications is false or absent, the create, get, list and delete configuration operations must return PushNotificationNotSupportedError. The specification advises clients to inspect the Agent Card before using optional capabilities, so read the card first instead of trying the call.
Layer 2: configuration lifecycle — In TaskPushNotificationConfig, url is required while id, taskId, token and authentication are optional; authentication holds a required scheme and optional credentials. A configuration can ride along in configuration.taskPushNotificationConfig of SendMessage, in which case the task ID should be empty, or be created afterwards with the create operation. It persists until the task completes or it is explicitly deleted; deletion must be idempotent and no further notifications follow it.
Layer 3: authentication and handling on arrival — The notification payload is StreamResponse with Content-Type application/a2a+json and authentication in Authorization. The receiver must authenticate it, validate the expected task ID and return 2xx. Idempotent processing and server-side SSRF URL validation are specification SHOULD requirements. This guide makes idempotency and accepting only locally registered tasks stricter local admission conditions. The server attempts delivery at least once and may retry or stop after repeated failure, so the client also needs active verification independent of notifications.
1. Read the Agent Card and judge capability
Where: the A2A client reading the remote Agent Card. Input: the card's capabilities object. Action: confirm pushNotifications is true, and note the protocolBinding (JSONRPC, GRPC or HTTP+JSON), protocolVersion and any tenant of the selected supportedInterfaces entry. Completion check: the capability value and binding details are recorded. Stop condition: if the value is false or absent, stop integrating and fall back to polling GetTask, or to SubscribeToTask when capabilities.streaming is true.
2. Prepare the callback address and credential
Where: the client webhook receiver. Input: HTTPS url, authentication.scheme and credentials, and optional token. Use credentials scoped to this configuration, treat them as secrets and plan rotation. Completion: the callback is remotely reachable and its credential corresponds to the configuration. Stop local admission for localhost, private or link-local destinations. The specification says servers SHOULD validate URLs against SSRF; this guide’s stricter local rule does not turn SHOULD into a universal MUST.
3. Create the configuration
Where: the client call site. Input: a message and callback configuration. For inline creation use configuration.taskPushNotificationConfig in SendMessage with taskId omitted. If nonblocking return is needed explicitly set configuration.returnImmediately=true; push configuration alone does not change the default waiting mode. SendMessage returns Task or Message, not a standalone configuration. After a Task use ListTaskPushNotificationConfigs to locate and verify the configuration and assigned ID. For independent creation first obtain a Task, then use CreateTaskPushNotificationConfig (HTTP+JSON POST /tasks/{id}/pushNotificationConfigs); that response returns the configuration and its ID. Completion: save the real taskId, creation path and verified configId. Stop relying on push if only a Message arrives, the configuration ID cannot be established, or unsupported/task-not-found errors occur; return to task or capability checks.For ListTaskPushNotificationConfigs consume nextPageToken through subsequent pageToken requests until no continuation remains. Inline discovery, the full inventory and deletion-absence verification all traverse every page. Interrupted pagination does not establish absence.
4. Read back and list configurations
Where: configuration readback and inventory. Input: confirmed taskId/configId. Read the target with GetTaskPushNotificationConfig and traverse every ListTaskPushNotificationConfigs page via nextPageToken/pageToken until no continuation remains. Check URL and configurations owned by this integration. Completion: locate the actual target and reconcile the full inventory. Stop to investigate unfamiliar ownership/purpose rather than deleting merely visible configurations. Clean up only verified owned configurations explicitly intended for removal. Record incomplete pagination or unknown ownership without assuming exclusive control of the task.
5. Authenticate and acknowledge on the receiver
Where: the client's webhook service. Input: the incoming POST request. Action: compare the Authorization header with the configured authentication; parse the StreamResponse, which holds exactly one of task, message, statusUpdate or artifactUpdate; check that the task ID belongs to a task you created; return 2xx once these pass. Duplicate notifications must be safe to ignore. Completion check: forged requests or unknown task IDs were not treated as valid updates, and legitimate requests received 2xx. Stop condition: on failed authentication or an unrecognized task ID, do not act on the payload and do not change local task state because of it.
6. Confirm with GetTask and clean up
Where: the client monitor and cleanup path. Input: saved taskId, configId and a local waiting policy. After task creation and ID registration start a GetTask verification loop independent of notification arrival. The client chooses polling interval and a maximum waiting deadline; notifications can trigger extra checks. On a terminal state stop polling and delete the configuration (HTTP+JSON DELETE /tasks/{id}/pushNotificationConfigs/{configId}), then list to confirm absence. Completion: even without a notification the client can establish the terminal state and clean up; errors or interruptions retain time and reason. Stop the local loop at the deadline or when queries become unavailable, record undecided and enter the registered configuration cleanup disposition. Retain concrete cleanup failures without endless retries or inventing completion.For ListTaskPushNotificationConfigs consume nextPageToken through subsequent pageToken requests until no continuation remains. Inline discovery, the full inventory and deletion-absence verification all traverse every page. Interrupted pagination does not establish absence.
Task example
Unexecuted walkthrough: the card declares pushNotifications=true. Send a message with an HTTPS callback, separate credentials and explicit returnImmediately=true. If a nonterminal Task arrives, save taskId, obtain and verify configId through the configuration list and start bounded GetTask monitoring. Suppose a notification later arrives: authenticate it, validate the expected task, acknowledge it and handle duplicates under the local idempotency rule. Verify terminal state and artifacts with GetTask, then delete the configuration. Without a notification the independent monitor still reaches a terminal state or its deadline; the latter records undecided and handles cleanup. Push configuration alone does not predict a SUBMITTED response, and unknown is never recorded as completed.
Completion checks
- The Agent Card's
capabilities.pushNotificationsis confirmed true, and the selected binding andtenantare recorded. - Each configuration's
url,tokenandauthenticationmap to a single task, and the read-back matches what was created. - The webhook authenticates every notification, validates the task ID, handles it idempotently and returns 2xx.
Verification scope
This note was written from reading the A2A specification snapshot read on 2026-11-12. No SDK was installed, no service was logged into, and no API call was executed or its output verified; the example above is a hypothetical scenario. Method names and endpoints (as written for JSONRPC, GRPC and HTTP+JSON) follow that snapshot, and no SDK behavior beyond it is covered.
Sources
All links are official pages; verification dates are listed per source, and links point to the version checked.