ListTaskInstances

Updated at:

Retrieves a paginated list of task instances, with optional filter conditions.

Operation description

DataWorks Basic Edition or higher is required.

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 DataWorks workspace ID.

100

Bizdate

integer

Yes

The data timestamp, which is 00:00:00 of the day before the instance scheduling time. The value is a UNIX timestamp in milliseconds. Example: 1743350400000.

1710239005403

TaskId

integer

No

The task ID.

1234

TaskIds

array

No

The task IDs. You can query instances for multiple tasks in a single request.

integer

No

The task ID.

1234

TaskName

string

No

The task name. Fuzzy match is supported.

SQL node

Owner

string

No

The account ID of the task owner.

1000

TaskType

string

No

The task type.

ODPS_SQL

RuntimeResource

string

No

The resource group identifier used for scheduling.

S_res_group_524258031846018_1684XXXXXXXXX

WorkflowId

integer

No

The workflow ID.

1234

UnifiedWorkflowInstanceId

integer

No

The unified workflow instance ID. All task instances under the same data timestamp within a single trigger share this value.

1234

WorkflowInstanceType

string

No

The workflow instance type. Valid values:

  • SmokeTest: Testing

  • Manual: Manually triggered node

  • SupplementData: Data backfill

  • ManualWorkflow: Manually triggered workflow

  • Normal: Scheduled execution

  • TriggerWorkflow: Triggered Workflow

Normal

WorkflowInstanceId

integer

No

The workflow instance ID.

1234

ProjectEnv

string

No

The environment of the workspace. Valid values:

  • Prod: production environment

  • Dev: development environment

Prod

Id

integer

No

The instance ID. If the instance has been rerun and you specify this parameter, the response includes the instance history with rerun records. Use the RunNumber parameter to distinguish each entry.

1234

Ids

array

No

The instance IDs. You can query multiple instances in a single request.

integer

No

The ID of the instance.

1234

TriggerType

string

No

The trigger type. Valid values:

  • Scheduler: scheduling cycle-based trigger

  • Manual: manual trigger

Normal

TriggerRecurrence

string

No

The running mode after triggering. Takes effect only when TriggerType is set to Scheduler. Valid values:

  • Pause

  • Skip

  • Normal

Normal

SortBy

string

No

The sort field, in the format of field name + direction (Desc/Asc). Default sort order is ascending. Valid values:

  • 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 page size. Default value: 10.

10

PageNumber

integer

No

The page number, starting from 1. Default value: 1.

1

Status

string

No

The task instance status.

  • NotRun: Not started

  • Running

  • Failure

  • Success

  • WaitTime: Awaiting scheduled time

  • WaitResource: Awaiting resources

Success

Filter

string

No

The filter conditions in JSON format, combined with logical AND. Supported fields: startedTimeStart, startedTimeEnd, finishedTimeStart, finishedTimeEnd, createTimeStart, 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.

22C97E95-F023-56B5-8852-B1A77A17XXXX

PagingInfo

object

The pagination information.

TaskInstances

array<object>

The list of task instances.

array<object>

TaskId

integer

The task ID.

1234

TaskType

string

The task type.

ODPS_SQL

TaskName

string

The task name.

SQL node

Description

string

The description.

test

WorkflowId

integer

The workflow ID.

1234

WorkflowName

string

The workflow name.

Test workflow

TriggerType

string

The trigger type.

Valid values:

  • Scheduler: scheduling cycle-based trigger

  • Manual: manual trigger

Scheduler

TriggerRecurrence

string

The running mode after triggering. Takes effect only when TriggerType is set to Scheduler.

Valid values:

  • Pause

  • Skip

  • Normal

Normal

WorkflowInstanceId

integer

The workflow instance ID.

1234

UnifiedWorkflowInstanceId

integer

The unified workflow instance ID. All task instances triggered under the same data timestamp share this value.

1234

WorkflowInstanceType

string

The type of the workflow instance.

Valid values:

  • SmokeTest

  • SupplementData

  • Manual

  • ManualWorkflow

  • Normal

  • ManualFlow

Normal

Timeout

integer

The task timeout period. Unit: seconds.

Note: The value is rounded up to the nearest hour.

3600

RerunMode

string

The rerun mode.

Valid values:

  • AllDenied: The task cannot be rerun regardless of the run result.

  • FailureAllowed: The task can be rerun only after a failure.

  • AllAllowed: The task can be rerun regardless of the run result.

AllAllowed

RunNumber

integer

The run count, starting from 1.

1

PeriodNumber

integer

The cycle number, indicating which scheduling cycle the instance belongs to on the current day.

1

BaselineId

integer

The baseline ID.

1234

Priority

integer

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

1

RuntimeResource

object

The associated resource group information.

ResourceGroupId

string

The scheduling resource group ID.

S_res_group_524258031846018_1684XXXXXXXXX

Image

string

The image ID configured for task execution.

i-xxxxxx

Cu

string

The default CU count for task execution.

0.25

Runtime

object

The runtime information.

ProcessId

string

The instance run ID.

T3_123

Gateway

string

The execution host.

cn-shanghai.1.2

DataSource

object

The associated data source information.

Name

string

The data source name.

mysql_test

Status

string

The instance status.

Valid values:

  • NotRun: Not started.

  • Running: The instance is running.

  • WaitTime: Waiting for the scheduled time.

  • CheckingCondition: Checking branch conditions.

  • WaitResource: Waiting for resources.

  • Failure: The instance failed.

  • Success: The instance succeeded.

  • Checking: Running data quality checks.

Success

TriggerTime

integer

The scheduling time.

1710239005403

Bizdate

integer

The data timestamp.

1710239005403

StartedTime

integer

The start time of the instance run.

1710239005403

FinishedTime

integer

The end time of the instance run.

1710239005403

Id

integer

The instance ID.

1234

ProjectId

integer

The DataWorks workspace ID.

100

ProjectEnv

string

The environment of the workspace.

Valid values:

  • Prod: production environment

  • Dev: development environment

Prod

Owner

string

The account ID of the task owner.

1000

CreateTime

integer

The creation time.

1710239005403

ModifyTime

integer

The modification time.

1710239005403

CreateUser

string

The account ID of the instance creator.

1000

ModifyUser

string

The account ID of the user who last modified the instance.

1000

ScriptParameters

string

The script parameters.

para1=val1 para2=val2

WaitingResourceTime

integer

The timestamp when the instance started waiting for resources.

1710239005403

WaitingTriggerTime

integer

The timestamp when the instance started waiting for the scheduled time.

1710239005403

TotalCount

integer

The total number of entries returned.

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
      }
    ],
    "TotalCount": 100,
    "PageSize": 10,
    "PageNumber": 1
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.