SubscribeToTask
The A2A v1.0 operation that opens a stream of updates for an existing, unfinished task, starting with a snapshot of it. v0.3 called it tasks/resubscribe.
SubscribeToTask is the A2A v1.0 operation that opens a stream of updates for a task that already exists and has not finished, whether the client started the task or is joining it later.
Request. It takes the task id and, on multi-tenant interfaces, the tenant. Over JSON-RPC:
{"jsonrpc": "2.0", "id": 5, "method": "SubscribeToTask", "params": {"id": "task-uuid"}}
The response is a Server-Sent Events stream in the same format as SendStreamingMessage. gRPC exposes it as a server-streaming RPC. For HTTP+JSON, section 11.3 and the method table give POST /tasks/{id}:subscribe, while the HTTP annotation in a2a.proto says GET, so clients may meet either.
What the stream returns. The first event must be the Task as it stands at that moment. Section 3.1.6 explains why: a snapshot inside the stream closes the gap between a separate GetTask call and the subscription, where an update could otherwise be missed. Status and artifact update events follow, and the stream ends when the task reaches a terminal state.
Errors.
UnsupportedOperationError(-32004) if the Agent Card does not declarecapabilities.streaming: true.UnsupportedOperationError(-32004) if the task is already completed, failed, canceled or rejected.TaskNotFoundError(-32001) if the task does not exist or the caller cannot see it.
When to use it.
- Reconnecting after a stream dropped mid-task.
- Letting a second client or dashboard watch the same task. The agent sends every stream the same events in the same order.
- Waiting for a task in
TASK_STATE_AUTH_REQUIRED. Section 7.6.2 notes the agent may receive credentials out of band and resume without a new message, and lists subscribing as one way for the client to avoid missing that.
History. In v0.3 the method was tasks/resubscribe, and backfill behaviour depended on the implementation. Version 1.0 renamed it, defined the opening snapshot, and allowed multiple concurrent subscriptions per task.
Neighbouring terms. Streaming covers both streaming operations. Push notifications deliver the same events to a webhook instead.
Sources
- A2A Protocol Specification, section 3.1.6: Subscribe to Task (accessed )
- A2A Protocol Specification, section 9.4.6: SubscribeToTask (JSON-RPC) (accessed )
- A2A Protocol Specification, section 5.3: Method Mapping Reference (accessed )
- A2A protocol definition (a2a.proto): SubscribeToTask, SubscribeToTaskRequest (accessed )
- A2A Protocol Specification, section 7.6.2: In-Task Authorization Client Responsibilities (accessed )
- What's New in A2A Protocol v1.0: Subscribe to task (accessed )