Skip to main content

tasks

Creates, updates, deletes, gets or lists a tasks resource.

Overview

Nametasks
TypeResource
Idgoogle.discoveryengine.tasks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringUnique identifier (e.g. UUID) for the task, generated by the server for a new task.
artifactsarrayA set of output artifacts for a Task.
contextIdstringUnique identifier (e.g. UUID) for the contextual collection of interactions (tasks and messages). Created by the A2A server.
historyarrayprotolint:disable REPEATED_FIELD_NAMES_PLURALIZED The history of interactions from a task.
metadataobjectprotolint:enable REPEATED_FIELD_NAMES_PLURALIZED A key/value object to store custom metadata about a task.
statusobjectThe current status of a Task, including state and a message. (id: A2aV1TaskStatus)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_collections_engines_assistants_agents_a2a_v1_tasks_getselectprojectsId, locationsId, collectionsId, enginesId, assistantsId, agentsId, tasksIdhistoryLengthGet the current state of a task from the agent.
projects_locations_collections_engines_assistants_agents_a2a_v1_tasks_subscribeexecprojectsId, locationsId, collectionsId, enginesId, assistantsId, agentsId, tasksIdTaskSubscription is a streaming call that will return a stream of task update events. This attaches the stream to an existing in process task. If the task is complete the stream will return the completed task (like GetTask) and close the stream.
projects_locations_collections_engines_assistants_agents_a2a_v1_tasks_cancelexecprojectsId, locationsId, collectionsId, enginesId, assistantsId, agentsId, tasksIdCancel a task from the agent. If supported one should expect no more task updates for the task.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
agentsIdstring
assistantsIdstring
collectionsIdstring
enginesIdstring
locationsIdstring
projectsIdstring
tasksIdstring
historyLengthinteger (int32)

SELECT examples

Get the current state of a task from the agent.

SELECT
id,
artifacts,
contextId,
history,
metadata,
status
FROM google.discoveryengine.tasks
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND collectionsId = '{{ collectionsId }}' -- required
AND enginesId = '{{ enginesId }}' -- required
AND assistantsId = '{{ assistantsId }}' -- required
AND agentsId = '{{ agentsId }}' -- required
AND tasksId = '{{ tasksId }}' -- required
AND historyLength = '{{ historyLength }}'
;

Lifecycle Methods

TaskSubscription is a streaming call that will return a stream of task update events. This attaches the stream to an existing in process task. If the task is complete the stream will return the completed task (like GetTask) and close the stream.

EXEC google.discoveryengine.tasks.projects_locations_collections_engines_assistants_agents_a2a_v1_tasks_subscribe
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@collectionsId='{{ collectionsId }}' --required,
@enginesId='{{ enginesId }}' --required,
@assistantsId='{{ assistantsId }}' --required,
@agentsId='{{ agentsId }}' --required,
@tasksId='{{ tasksId }}' --required
;