For the complete documentation index, see llms.txt. This page is also available as Markdown.

Task

A task represents the state of an asynchronous, usually long-running operation. Examples include, bulk migrations, transferring buyers, and more.

This object contains the following attributes:

Field
Type
Description

id

string, core

(Read-only) Represents the task ID. The task identifier includes the identifier of the service that owns it. The format is TSK-XXXX-YYYY-YYYY-YYYY, where XXXX corresponds to part of the Service identifier SVC-XXXX.

status

enum, core

Represents the status of the task. A new task is created in either the queued (default) or blocked status.

code

string, core

Represents a task code. Different task codes are responsible for different workflows, and are prefixed with the respective service namespace.

name

string, core

The name of the specific operation.

Example: Moving the buyer to a different account

queue

string

The queue name for the task execution, sourced by the task service, is prefixed with the controlling service namespace. Queues are independent in scope of execution; tasks in the queue are executed in First In, First Out order if queued.

object

object

A reference to the business object related to the task.

Example:

description

string

A description of the task.

parent

task

(Optional) Represents the parent task, if applicable.

Example:

progress

float

(Optional) The progress in percentage, ranging from 0 to 100. Applies only to tasks that have started.

eta

string

The estimated completion time for the task, if applicable, in the ISO 8601 datetime format.

audit

object

Represents the audit object.

parameters

object

(Optional) Parameters that can be used to store task-specific metadata.

Example:

result

string

(Optional) The URI, which reflects the results of the task execution. It could be either:

  • A task-specific result object.

  • A relative URI to the resource, for example, a standard platform object or file.

owner

service

The service that owns the task.

Example:

access

object

A list of account with access to the task and its result.

Examples

THE TASK OBJECT
{
    "id": "TSK-0001-2474-4798-1266",
    "name": "Transferring the buyer to a different account",
    "revision": 1,
    "status": "Completed",
    "code": "accounts.buyers.transfer",
    "queue": "marketplace/platform/internal/buyers/commands",
    "object": {
        "id": "BUY-1190-0394"
    },
    "description": "Transferring buyer 'BUY-1190-0394' to account 'ACC-5563-4382'",
    "progress": 100,
    "parameters": {
        "BuyerId": "BUY-1190-0394",
        "TargetAccountId": "ACC-5563-4382"
    },
    "result": "/public/v1/accounts/buyers/BUY-1190-0394",
    "owner": {
        "id": "SVC-0001",
        "name": "platform",
        "revision": 1
    }
}

Last updated

Was this helpful?