By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
When you're building multi-agent systems, you need to understand how work gets organized, tracked, and communicated. The core data model—messages, parts, tasks, and artifacts—determines whether your system can handle long-running operations, survive network failures, and let callers check progress without keeping connections open. Get this wrong and you end up with brittle request-response patterns that fall apart the moment work takes more than a few seconds.
A message is one turn of communication. It has a role (user or agent) and contains one or more parts. A part is a piece of content: text, a file (either inline bytes or a URL), or structured data like JSON.
A task is the unit of work. It has an id, a contextId that ties it to a conversation, a status, artifacts, and a history of messages. An artifact is an output of the task—a report, a file, a JSON result—and it's made of parts.
The relationship is hierarchical. A context (conversation) contains multiple tasks. Each task tracks its state, holds a message history, and produces artifacts. Messages within that history contain parts. Parts are the actual content.
A task moves through states as it executes. Four states are terminal: COMPLETED, FAILED, CANCELED, and REJECTED. Once a task reaches any of these, it never changes again.
Two states are special: INPUT_REQUIRED and AUTH_REQUIRED. These are interruption points. The agent pauses, waiting for something from the caller. When the caller responds, the task returns to WORKING.
The spec also defines TASK_STATE_UNSPECIFIED as a default unknown value, giving you nine states total. The common paths flow from SUBMITTED to WORKING, then either to an interrupted state or to a terminal state. The key rule: terminal states are final, and interrupted states always return to WORKING when the caller responds.
| State (TASK_STATE_...) | Kind | Meaning |
|---|---|---|
| SUBMITTED | Active | Accepted and acknowledged, not started yet |
| WORKING | Active | The agent is processing |
| INPUT_REQUIRED | Interrupted | Needs more information from the caller to continue |
| AUTH_REQUIRED | Interrupted | Needs authentication or authorisation to continue |
| COMPLETED | Terminal | Finished successfully; artifacts hold the output |
| FAILED | Terminal | Ended with an error |
| CANCELED | Terminal | Cancelled before completion |
| REJECTED | Terminal | The agent declined to do the task |
A quick question the agent can answer immediately might be answered with just a message. You send it, get a response, done.
Anything that takes time, produces outputs, or may need follow-up becomes a task. Tasks give you an id to track, the ability to cancel, and the ability to subscribe to progress updates. You get the id back immediately, then check progress hours later without holding a connection open.
To continue a conversation, send a new message with the same contextId. If the message targets an existing task, include the taskId as well.
Tasks make A2A good for slow, agentic work: you get an id back, and can check progress hours later without holding a connection open.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.