The Task is A2A's fundamental unit of work. Every delegated operation, from a synchronous data lookup to a multi-day document analysis workflow, lives inside a Task object with a unique ID, a stateful lifecycle, and a structured output model. How A2A protocol AI agents manage that lifecycle determines how reliably they behave at production scale.
Initiating a Task with message/send and message/stream
A client agent initiates work by sending a message/send or message/stream JSON-RPC request to the remote agent's service endpoint. The message body includes a role field set to "user" and a parts array containing one or more content units, such as TextPart, FilePart, or DataPart. For synchronous work, message/send returns the completed Task or a direct Message response in the JSON-RPC reply.
For long-running work, the message/stream keeps the connection open, and the server pushes incremental updates via Server-Sent Events, each carrying a complete JSON-RPC response object, either a TaskStatusUpdateEvent or a TaskArtifactUpdateEvent. Clients consuming the SSE stream get real-time visibility into task progress without polling.
Task Lifecycle States
A Task moves through a defined set of states. The server marks it as submitted when it accepts the request, then working while the agent actively processes it. If the agent needs clarification before proceeding, the state becomes input-required. If it needs the client to complete an authentication step mid-task, the state becomes auth-required, a dedicated interrupted state distinct from a simple clarification request. A Task can also sit in unknown when its current state can't be determined, such as after a lost connection or an unrecognized status from the remote agent. Terminal states are completed, failed, canceled, and rejected.
The input-required and auth-required states matter most in A2A protocol use cases involving approval-dependent or regulated workflows. When a remote agent signals input-required, the client sends a follow-up message to the same Task ID to resume execution. When it signals auth-required, the client completes the necessary auth step, typically acquiring or refreshing a credential, before resuming the same Task. A Task that reaches a terminal state is immutable: retrying a failed operation requires creating a new Task.
Artifact Handling and Structured Output
When an agent produces output, it emits Artifacts alongside or instead of a reply message. An Artifact is a named, typed output composed of Parts, carrying a mimeType, an artifactId, and optionally a file reference for binary content. In SSE streams, artifacts arrive incrementally via TaskArtifactUpdateEvent objects, letting clients begin consuming large outputs before the task completes.
The A2A protocol architecture treats Artifacts as first-class deliverables. A coding agent producing source files, a data agent returning structured JSON, and a document agent generating a PDF all use the same Artifact model, keeping output handling consistent across A2A protocol AI agents regardless of the content type.
Polling, Cancellation, and Reconnection
For clients tracking a long-running task without an open stream, tasks/get retrieves the current Task state by ID. tasks/cancel instructs the remote agent to terminate execution and emit the canceled state. If a streaming client loses its SSE connection before a task completes, tasks/resubscribe re-establishes the stream against the existing Task ID.
For fully disconnected workflows, clients register a webhook URL for push notifications: the server posts status and artifact update events to that URL as the task progresses, with no persistent connection required.
Proper error recovery in distributed A2A protocol AI agents workflows means handling each JSON-RPC error code the specification, including task-not-found, unsupported operation, and push notification configuration failures. Teams building multi-agent lifecycle visibility find that task state transitions are the most reliable signal for understanding what a distributed agent system is doing at any moment.