ListTaskInstances

Updated at:

Retrieves a paginated list of task instances. You can also perform a filtered query based on conditions.

Operation description

You must purchase DataWorks Basic Edition or higher to use this operation.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:ListTaskInstances

get

*TaskInstance

acs:dataworks:{#regionId}:{#accountId}:taskinstance/*

None None

Request parameters

Parameter

Type

Required

Description

Example

ProjectId

integer

Yes

The ID of the DataWorks workspace.

100

Bizdate

integer

Yes

The business date. Typically, this is 00:00:00 of the day before the scheduled time of the periodic instance, in the format of a millisecond-level timestamp, such as 1743350400000.

1710239005403

TaskId

integer

No

The ID of the task.

1234

TaskIds

array

No

The IDs of the tasks. You can specify multiple task IDs to query task instances in batches.

integer

No

The task ID.

1234

TaskName

string

No

The name of the task. Fuzzy search is supported.

SQL node

Owner

string

No

The account ID of the task owner.

1000

TaskType

string

No

The task type. For the valid values of TaskType for each node, see DataWorks nodes.

ODPS_SQL

RuntimeResource

string

No

The resource group information. Specify the identifier of the scheduling resource group.

S_res_group_524258031846018_1684XXXXXXXXX

WorkflowId

integer

No

The ID of the associated workflow.

1234

UnifiedWorkflowInstanceId

integer

No

The unified workflow instance ID. The value of this field is the same for all task instances within a specific business date under a single trigger.

1234

WorkflowInstanceType

string

No

The type of the workflow instance to which the task belongs. Valid values:

  • SmokeTest: Smoke test.

  • Manual: Manual task.

  • SupplementData: Data backfill.

  • ManualWorkflow: Manual workflow.

  • Normal: Periodic scheduling.

  • TriggerWorkflow: Triggered workflow.

Valid values:

  • SmokeTest :

    Smoke test.

  • TriggerWorkflow :

    Triggered workflow.

  • Manual :

    Manual task.

  • SupplementData :

    Data backfill.

  • ManualWorkflow :

    Manual workflow.

  • Normal :

    Periodic scheduling.

Normal

WorkflowInstanceId

integer

No

The ID of the associated workflow instance.

1234

ProjectEnv

string

No

The project environment. Valid values:

  • Prod: Production environment.

  • Dev: Development environment.

Valid values:

  • Prod :

    Production environment.

  • Dev :

    Development environment.

Prod

Id

integer

No

If you specify a single task instance ID, the operation returns the paginated run history of the instance. You can use the returned RunNumber to distinguish the initial run from reruns.

1234

Ids

array

No

The list of task instance IDs to query. Specify this parameter to query multiple instances in batches and omit the Id parameter.

integer

No

The task instance ID.

1234

TriggerType

string

No

The trigger type. Valid values:

  • Scheduler: Triggered by periodic scheduling.

  • Manual: Triggered manually.

Valid values:

  • Scheduler :

    Triggered by periodic scheduling.

  • Manual :

    Triggered manually.

Scheduler

TriggerRecurrence

string

No

The run mode upon triggering. This parameter takes effect only when TriggerType is set to Scheduler. Valid values:

  • Pause: Paused.

  • Skip: Dry run.

  • Normal: Normal run.

Valid values:

  • Pause :

    Paused.

  • Skip :

    Dry run.

  • Normal :

    Normal run.

Normal

SortBy

string

No

The sort field. Fields such as scheduled time and start time are supported. The format is Sort field + Sort order (Desc/Asc). Asc can be omitted. Valid values for the sort field:

  • TriggerTime (Desc/Asc)

  • StartedTime (Desc/Asc)

  • FinishedTime (Desc/Asc)

  • CreateTime (Desc/Asc)

  • Id (Desc/Asc)

Default value: Id Desc.

Id Desc

PageSize

integer

No

The number of entries per page. Default value: 10. Maximum value: 500.

10

PageNumber

integer

No

The page number. Pages start from 1. Default value: 1.

1

Status

string

No

The status of the task instance. Valid values:

  • NotRun: Not run.

  • Running: Running.

  • Failure: Failed.

  • Success: Succeeded.

  • WaitTime: Waiting for the scheduled time.

  • WaitResource: Waiting for resources.

Valid values:

  • NotRun :

    Not run.

  • Running :

    Running.

  • WaitTime :

    Waiting for the scheduled time.

  • WaitResource :

    Waiting for resources.

  • Failure :

    Failed.

  • Success :

    Succeeded.

Success

Filter

string

No

The filter conditions in JSON format. Multiple filter conditions are connected by the AND logical operator. Supported fields: startedTimeStart, startedTimeEnd, finishedTimeStart, finishedTimeEnd, createTimeStart, and createTimeEnd.

{ "startedTimeStart": "1763481600000", "startedTimeEnd": "1763481600000", "finishedTimeStart": "1763481600000", "finishedTimeEnd": "1763481600000", "createTimeStart": "1763481600000", "createTimeEnd": "1763481600000" }

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID, which is used to locate logs and troubleshoot issues.

22C97E95-F023-56B5-8852-B1A77A17XXXX

PagingInfo

object

The pagination information.

TaskInstances

array<object>

The list of task instances.

array<object>

TaskId

integer

The ID of the task.

1234

TaskType

string

The type of the task.

ODPS_SQL

TaskName

string

The name of the task.

SQL node

Description

string

The description.

test

WorkflowId

integer

The ID of the associated workflow.

1234

WorkflowName

string

The name of the workflow to which the task belongs.

Test workflow

TriggerType

string

The trigger type. Valid values:

  • Scheduler: scheduled trigger

  • Manual: manual trigger

Scheduler

TriggerRecurrence

string

The run mode when triggered. This parameter takes effect only when TriggerType is set to Scheduler. Valid values:

  • Pause: paused

  • Skip: dry run

  • Normal: normal run

Normal

WorkflowInstanceId

integer

The ID of the associated workflow instance.

1234

UnifiedWorkflowInstanceId

integer

The unified workflow instance ID. The value of this field is the same for all task instances within a specific business date under a single trigger.

1234

WorkflowInstanceType

string

The type of the workflow instance to which the task belongs. Valid values:

  • SmokeTest: smoke test

  • SupplementData: data backfill

  • Manual: manual

  • ManualWorkflow: manual workflow

  • Normal: scheduled

  • ManualFlow: manually executed business flow

Normal

Timeout

integer

The timeout period for task execution, in seconds.

Note: The scheduling system rounds the configured value to a whole number of hours.

3600

RerunMode

string

The rerun configuration for the task. Valid values:

  • AllDenied: rerun is not allowed regardless of success or failure

  • FailureAllowed: only failed runs can be rerun

  • AllAllowed: rerun is allowed regardless of success or failure

AllAllowed

RunNumber

integer

The run sequence number of the task instance, starting from 1. The number increments each time the instance is rerun.

1

PeriodNumber

integer

The cycle sequence number, which indicates the cycle round of the task instance on the current day.

1

BaselineId

integer

The baseline ID.

1234

Priority

integer

The execution priority of the task. Valid values: 1 to 8. A larger value indicates a higher priority. Default value: 1.

1

RuntimeResource

object

The resource group information associated with the instance.

ResourceGroupId

string

The identifier of the scheduling resource group configured for task execution.

S_res_group_524258031846018_1684XXXXXXXXX

Image

string

The ID of the image configured for task execution.

i-xxxxxx

Cu

string

The CU consumption configured for task execution.

0.25

Runtime

object

The runtime information of the instance.

ProcessId

string

The unique run ID.

T3_123

Gateway

string

The execution machine.

cn-shanghai.1.2

DataSource

object

The data source information associated with the instance.

Name

string

The name of the data source.

mysql_test

Status

string

The execution status of the instance. Valid values:

  • NotRun: not run

  • Running: running

  • WaitTime: waiting for the trigger time

  • CheckingCondition: checking branch conditions

  • WaitResource: waiting for resources

  • Failure: failed

  • Success: successful

  • Checking: submitted for data quality check

  • WaitTrigger: waiting for an external trigger (a trigger node changes to this status after the waiting period)

Success

TriggerTime

integer

The scheduled trigger time.

The value is a 13-digit number, such as 1710239005403.

1710239005403

Bizdate

integer

The business date.

The value is a 13-digit number, such as 1710239005403.

1710239005403

StartedTime

integer

The start time.

The value is a 13-digit number, such as 1710239005403.

1710239005403

FinishedTime

integer

The completion time.

The value is a 13-digit number, such as 1710239005403.

1710239005403

Id

integer

The unique identifier of the task instance.

1234

ProjectId

integer

The ID of the DataWorks workspace.

100

ProjectEnv

string

The project environment. Valid values:

  • Prod: Production environment.

  • Dev: Development environment.

Prod

Owner

string

The account ID of the task owner.

1000

CreateTime

integer

The creation time.

The value is a 13-digit number, such as 1710239005403.

1710239005403

ModifyTime

integer

The update time.

The value is a 13-digit number, such as 1710239005403.

1710239005403

CreateUser

string

The account ID of the user who created the instance.

1000

ModifyUser

string

The account ID of the user who updated the instance.

1000

ScriptParameters

string

The list of script parameters.

para1=val1 para2=val2

WaitingResourceTime

integer

The time when the instance entered the resource waiting state. The value is a UNIX timestamp in milliseconds.

1710239005403

WaitingTriggerTime

integer

The time when the instance entered the trigger time waiting state.

The value is a 13-digit number, such as 1710239005403.

1710239005403

OperationType

string

The type of the latest operation on the instance.

TriggerDqc

TotalCount

integer

The total number of records that meet the query conditions. If Id is specified, this value indicates the total number of run history records for the instance.

100

PageSize

integer

The number of entries per page.

10

PageNumber

integer

The page number.

1

Examples

Success response

JSON format

{
  "RequestId": "22C97E95-F023-56B5-8852-B1A77A17XXXX",
  "PagingInfo": {
    "TaskInstances": [
      {
        "TaskId": 1234,
        "TaskType": "ODPS_SQL\n",
        "TaskName": "SQL node\n",
        "Description": "test\n",
        "WorkflowId": 1234,
        "WorkflowName": "Test workflow\n",
        "TriggerType": "Scheduler\n",
        "TriggerRecurrence": "Normal\n",
        "WorkflowInstanceId": 1234,
        "UnifiedWorkflowInstanceId": 1234,
        "WorkflowInstanceType": "Normal",
        "Timeout": 3600,
        "RerunMode": "AllAllowed\n",
        "RunNumber": 1,
        "PeriodNumber": 1,
        "BaselineId": 1234,
        "Priority": 1,
        "RuntimeResource": {
          "ResourceGroupId": "S_res_group_524258031846018_1684XXXXXXXXX",
          "Image": "i-xxxxxx\n",
          "Cu": "0.25\n"
        },
        "Runtime": {
          "ProcessId": "T3_123\n",
          "Gateway": "cn-shanghai.1.2\n"
        },
        "DataSource": {
          "Name": "mysql_test\n"
        },
        "Status": "Success",
        "TriggerTime": 1710239005403,
        "Bizdate": 1710239005403,
        "StartedTime": 1710239005403,
        "FinishedTime": 1710239005403,
        "Id": 1234,
        "ProjectId": 100,
        "ProjectEnv": "Prod",
        "Owner": "1000",
        "CreateTime": 1710239005403,
        "ModifyTime": 1710239005403,
        "CreateUser": "1000",
        "ModifyUser": "1000",
        "ScriptParameters": "para1=val1 para2=val2",
        "WaitingResourceTime": 1710239005403,
        "WaitingTriggerTime": 1710239005403,
        "OperationType": "TriggerDqc"
      }
    ],
    "TotalCount": 100,
    "PageSize": 10,
    "PageNumber": 1
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.