Queries a list of instances. You can also specify filter conditions to query specific instances.
Operation description
This API operation is available for all DataWorks editions.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| dataworks:ListTaskInstances | get | *TaskInstance acs:dataworks:{#regionId}:{#accountId}:taskinstance/* |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ProjectId | long | Yes | The DataWorks workspace ID. | 100 |
| Bizdate | long | Yes | The data timestamp. The value of this parameter is 00:00:00 of the day before the scheduling time of the instance. The value is a UNIX timestamp. Unit: milliseconds. Example: 1743350400000. | 1710239005403 |
| TaskId | long | No | The ID of the task for which the instance is generated. | 1234 |
| TaskIds | array | No | The IDs of the tasks. You can query multiple instances at a time by task ID. | |
| long | No | The task ID. | 1234 | |
| TaskName | string | No | The name of the task. Fuzzy match is supported. | SQL node |
| Owner | string | No | The account ID of the task owner. | 1000 |
| TaskType | integer | No | The type of the task for which the instance is generated. | ODPS_SQL |
| RuntimeResource | string | No | The information about the resource group. Set this parameter to the identifier of a resource group for scheduling. | S_res_group_524258031846018_1684XXXXXXXXX |
| WorkflowId | long | No | The ID of the workflow to which the instance belongs. | 1234 |
| WorkflowInstanceType | string | No | The type of the workflow instance. Valid values:
| Normal |
| WorkflowInstanceId | long | No | The workflow instance ID. | 1234 |
| ProjectEnv | string | No | The environment of the workspace. Valid values:
| Prod |
| Id | long | No | The ID of the instance. The instance may be rerun. If the instance is rerun and you configure this parameter, the system returns the historical information of the instance, including the rerun information. You can use the RunNumber parameter to distinguish each entry in the historical information. | 1234 |
| Ids | array | No | The IDs of the instances. You can query multiple instances at a time by instance ID. | |
| long | No | The ID of the instance. | 1234 | |
| TriggerType | string | No | The trigger type. Valid values:
| Normal |
| TriggerRecurrence | string | No | The running mode of the instance after it is triggered. This parameter takes effect only if the TriggerType parameter is set to Scheduler. Valid values:
| Normal |
| SortBy | string | No | The field used for sorting. Fields such as TriggerTime and StartedTime are supported. The value of this parameter is in the Sort field + Sort by (Desc/Asc) format. By default, results are sorted in ascending order. Valid values:
| Id Desc |
| PageSize | integer | No | The number of entries per page. Default value: 10. | 10 |
| PageNumber | integer | No | The page number. Pages start from page 1. Default value: 1. | 1 |
| Status | string | No | The status of the task instance.
| Success |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "22C97E95-F023-56B5-8852-B1A77A17XXXX",
"PagingInfo": {
"TaskInstances": [
{
"TaskId": 1234,
"TaskType": "ODPS_SQL\n",
"TaskName": "SQL node",
"Description": "test\n",
"WorkflowId": 1234,
"WorkflowName": "Test workflow",
"TriggerType": "Scheduler\n",
"TriggerRecurrence": "Normal\n",
"WorkflowInstanceId": 1234,
"UnifiedWorkflowInstanceId": 1234,
"WorkflowInstanceType": "Normal",
"Timeout": 1,
"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
},
"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
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2025-11-25 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
| 2025-10-29 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
| 2025-01-21 | The response structure of the API has changed | View Change Details |
| 2024-11-21 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
| 2024-11-20 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
