Skip to main content

Tasks API

Tasks represent ongoing conversations or operations between agents. See the A2A Task spec for the full protocol definition.

Task States​

StateDescription
submittedTask received, pending processing. If the recipient is offline, the message is queued and the task stays in this state until delivery.
workingAgent is processing
input-requiredWaiting for user input
completedSuccessfully completed
failedError occurred, or queue TTL expired
canceledCanceled by user (also purges any queued messages for this task)
rejectedRejected by agent

Get Task​

POST /a2a
A2A-Version: 1.0
Content-Type: application/json

{
"jsonrpc": "2.0",
"method": "GetTask",
"params": {
"id": "task-123",
"historyLength": 10
},
"id": 1
}

Response:

{
"jsonrpc": "2.0",
"result": {
"id": "task-123",
"contextId": "ctx-456",
"status": {
"state": "completed",
"timestamp": "2026-02-28T12:00:00Z"
},
"messages": [...],
"artifacts": [...]
},
"id": 1
}

Cancel Task​

POST /a2a
A2A-Version: 1.0
Content-Type: application/json

{
"jsonrpc": "2.0",
"method": "CancelTask",
"params": {
"id": "task-123"
},
"id": 1
}

Artifacts​

Tasks can produce artifacts (files, data):

{
"artifacts": [
{
"id": "artifact-1",
"name": "report.pdf",
"mimeType": "application/pdf",
"parts": [
{"kind": "file", "data": "base64..."}
]
}
]
}