ListTaskInstances
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
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:ListTaskInstances |
get |
*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:
Valid values:
|
Normal |
| WorkflowInstanceId |
integer |
No |
The ID of the associated workflow instance. |
1234 |
| ProjectEnv |
string |
No |
The project environment. Valid values:
Valid values:
|
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 |
1234 |
| Ids |
array |
No |
The list of task instance IDs to query. Specify this parameter to query multiple instances in batches and omit the |
|
|
integer |
No |
The task instance ID. |
1234 |
|
| TriggerType |
string |
No |
The trigger type. Valid values:
Valid values:
|
Scheduler |
| TriggerRecurrence |
string |
No |
The run mode upon triggering. This parameter takes effect only when TriggerType is set to Scheduler. Valid values:
Valid values:
|
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:
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:
Valid values:
|
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 |
| TriggerRecurrence |
string |
The run mode when triggered. This parameter takes effect only when TriggerType is set to Scheduler. Valid values:
|
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:
|
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:
|
AllAllowed |
| RunNumber |
integer |
The run sequence number of the task instance, starting from |
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:
|
Success |
| TriggerTime |
integer |
The scheduled trigger time. The value is a 13-digit number, such as |
1710239005403 |
| Bizdate |
integer |
The business date. The value is a 13-digit number, such as |
1710239005403 |
| StartedTime |
integer |
The start time. The value is a 13-digit number, such as |
1710239005403 |
| FinishedTime |
integer |
The completion time. The value is a 13-digit number, such as |
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 |
| 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 |
| ModifyTime |
integer |
The update time. The value is a 13-digit number, such as |
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 |
| 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 |
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.