Agent tasks can take a long time. A2A offers ways to deliver updates without constant polling.
Streaming
For interactive use, the client can request a streaming response. The remote agent sends a stream of events over server-sent events (SSE):
- Status updates as the task changes state.
- Artifact updates as outputs are produced, possibly in chunks.
Streaming suits tasks lasting seconds to minutes where a user is waiting.
Push Notifications
For long-running tasks, the client provides a webhook URL. The remote agent sends notifications when important changes happen, and the client then fetches details.
Push suits tasks lasting hours or days, and clients that shouldn't hold connections open.
Polling
Clients can always request a task's current status by ID.
Security for Webhooks
- Verify notifications really come from the remote agent, using authentication the protocol supports.
- Validate webhook URLs to prevent the agent being used to call internal addresses.
- Treat notification content as untrusted until verified.
Choosing
Interactive → streaming. Long, background work → push notifications. Simple integrations → polling.