- [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/Task#SCHEMA_REPRESENTATION)

`Task` is the core unit of action for A2A. It has a current status and when results are created for the task they are stored in the artifact. If there are multiple turns for a task, these are stored in history.

| JSON representation |
|---|
| ``` { "id": string, "contextId": string, "status": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/TaskStatus`) }, "artifacts": [ { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/Artifact`) } ], "history": [ { object (`Message`) } ], "metadata": { object } } ``` |

| Fields ||
|---|---|
| `id` | `string` Required. Unique identifier (e.g. UUID) for the task, generated by the server for a new task. |
| `contextId` | `string` Unique identifier (e.g. UUID) for the contextual collection of interactions (tasks and messages). |
| `status` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/TaskStatus`)`` Required. The current status of a `Task`, including `state` and a `message`. |
| `artifacts[]` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/Artifact`)`` A set of output artifacts for a `Task`. |
| `history[]` | ``object (`Message`)`` protolint:disable REPEATED_FIELD_NAMES_PLURALIZED The history of interactions from a `Task`. |
| `metadata` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` protolint:enable REPEATED_FIELD_NAMES_PLURALIZED A key/value object to store custom metadata about a task. |