title: Core. Task
A2A Node SDK - v0.1.0 / Modules / Core / Task
Interface: Task
Core.Task
Represents a task in the A2A protocol
Remarks
Tasks are the primary unit of work in the A2A protocol
Table of contents
Properties
- agentId
- artifacts
- contextId
- createdAt
- description
- error
- expectedParts
- id
- input
- inputSchema
- metadata
- name
- output
- outputSchema
- parts
- status
- transitions
- updatedAt
Properties
agentId
• Optional
agentId: string
Optional ID of the agent assigned to this task
artifacts
• Optional
artifacts: { content
: Record
<string
, any
> ; createdAt
: string
; id
: string
; type
: "text"
| "file"
| "data"
; updatedAt
: string
}[]
Optional artifacts produced by this task
contextId
• Optional
contextId: string
Optional context ID for grouping related tasks
createdAt
• createdAt: string
ISO timestamp when the task was created
description
• Optional
description: string
Optional detailed description of the task
error
• Optional
error: Object
Optional error information if the task failed
Type declaration
Name | Type | Description |
---|---|---|
code | number | Error code in the JSON-RPC reserved range |
data? | Record <string , any > | Optional additional error data |
message | string | Human-readable error message |
expectedParts
• Optional
expectedParts: number
Optional count of expected message parts
id
• id: string
Unique identifier for the task
input
• Optional
input: Record
<string
, any
>
Optional input data for the task
inputSchema
• Optional
inputSchema: Record
<string
, any
>
Optional JSON schema defining the expected input format
metadata
• Optional
metadata: Record
<string
, unknown
>
Optional additional metadata
name
• name: string
Human-readable name of the task
output
• Optional
output: Record
<string
, any
>
Optional output data produced by the task
outputSchema
• Optional
outputSchema: Record
<string
, any
>
Optional JSON schema defining the expected output format
parts
• Optional
parts: ({ content
: string
; format
: "plain"
| "markdown"
; type
: "text"
} | { content
: string
| Uint8Array
<ArrayBuffer
> ; mimeType
: string
; name
: string
; size?
: number
; type
: "file"
} | { content
: Record
<string
, any
> ; schema?
: string
; type
: "data"
} | { content
: string
; format
: "plain"
; type
: "heartbeat"
})[]
Optional message parts associated with this task
status
• status: "submitted"
| "working"
| "input_required"
| "completed"
| "failed"
| "canceled"
Current state of the task
transitions
• Optional
transitions: TaskTransition
[]
Optional history of state transitions
updatedAt
• updatedAt: string
ISO timestamp when the task was last updated