ListTaskInstances
Retrieves a paginated list of task instances, with optional filter conditions.
Operation description
DataWorks Basic Edition or higher is required.
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 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:
|
Normal |
| WorkflowInstanceId |
integer |
No |
The workflow instance ID. |
1234 |
| ProjectEnv |
string |
No |
The environment of the workspace. Valid values:
|
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:
|
Normal |
| TriggerRecurrence |
string |
No |
The running mode after triggering. Takes effect only when TriggerType is set to Scheduler. Valid values:
|
Normal |
| SortBy |
string |
No |
The sort field, in the format of field name + direction (Desc/Asc). Default sort order is ascending. Valid values:
|
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.
|
Success |
| Filter |
string |
No |
The filter conditions in JSON format, combined with logical AND. Supported fields: |
{ "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 |
| TriggerRecurrence |
string |
The running mode after triggering. Takes effect only when TriggerType is set to Scheduler. Valid values:
|
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:
|
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:
|
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:
|
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 |
| 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.