All Products
Search
Document Center

DataWorks:ListTaskInstances

Last Updated:Dec 24, 2024

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectIdlongYes

The DataWorks workspace ID.

100
BizdatelongYes

The data timestamp.

1710239005403
TaskIdlongNo

The ID of the task for which the instance is generated.

1234
TaskIdsarrayNo

The IDs of the tasks. You can query multiple instances at a time by task ID.

longNo

The task ID.

1234
TaskNamestringNo

The name of the task. Fuzzy match is supported.

OwnerstringNo

The account ID of the task owner.

1000
TaskTypeintegerNo

The type of the task for which the instance is generated.

ODPS_SQL
RuntimeResourcestringNo

The information about the resource group. Set this parameter to the identifier of a resource group for scheduling.

S_res_group_524258031846018_1684XXXXXXXXX
WorkflowIdlongNo

The ID of the workflow to which the instance belongs.

1234
WorkflowInstanceTypestringNo

The type of the workflow instance.

Valid values:

  • SmokeTest
  • Manual
  • SupplementData
  • ManualWorkflow
  • Normal
Normal
WorkflowInstanceIdlongNo

The workflow instance ID.

1234
ProjectEnvstringNo

The environment of the workspace.

Valid values:

  • Prod: production environment
  • Dev: development environment
Prod
IdlongNo

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
IdsarrayNo

The IDs of the instances. You can query multiple instances at a time by instance ID.

longNo

The ID of the instance.

1234
TriggerTypestringNo

The trigger type.

Valid values:

  • Scheduler: scheduling cycle-based trigger
  • Manual: manual trigger
Normal
TriggerRecurrencestringNo

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:

  • Pause
  • Skip
  • Normal
Normal
SortBystringNo

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:

  • TriggerTime (Desc/Asc)

  • StartedTime (Desc/Asc)

  • FinishedTime (Desc/Asc)

  • CreateTime (Desc/Asc)

  • Id (Desc/Asc)

    Default value: Id Desc.

Id Desc
PageSizeintegerNo

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

10
PageNumberintegerNo

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

1

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

22C97E95-F023-56B5-8852-B1A77A17XXXX
PagingInfoobject

The pagination information.

TaskInstancesarray<object>

The instances.

TaskInstanceobject
TaskIdlong

The ID of the task for which the instance is generated.

1234
TaskTypestring

The type of the task for which the instance is generated.

ODPS_SQL
TaskNamestring

The name of the task for which the instance is generated.

Descriptionstring

The description.

test
WorkflowIdlong

The ID of the workflow to which the instance belongs.

1234
WorkflowNamestring

The name of the workflow to which the instance belongs.

TriggerTypestring

The trigger type.

Valid values:

  • Scheduler: scheduling cycle-based trigger
  • Manual: manual trigger
Scheduler
TriggerRecurrencestring

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:

  • Pause
  • Skip
  • Normal
Normal
WorkflowInstanceIdlong

The workflow instance ID.

1234
WorkflowInstanceTypestring

The type of the workflow instance.

Valid values:

  • SmokeTest
  • SupplementData
  • Manual
  • ManualWorkflow
  • Normal
  • ManualFlow
Normal
Timeoutinteger

The timeout period of task running. Unit: seconds.

Note: The value of this parameter is rounded up by hour.

1
RerunModestring

The rerun mode

Valid values:

  • AllDenied: The task cannot be rerun regardless of whether the task is successfully run or fails to run.
  • FailureAllowed: The task can be rerun only after it fails to run.
  • AllAllowed: The task can be rerun regardless of whether the task is successfully run or fails to run.
AllAllowed
RunNumberinteger

The number of times the task is run. By default, the value starts from 1.

1
PeriodNumberinteger

The sequence number of the cycle. This parameter indicates the cycle of the task instance on the current day.

1
BaselineIdlong

The baseline ID.

1234
Priorityinteger

The priority of the task. Minimum value: 1. Maximum value: 8. A larger value indicates a higher priority. Default value: 1.

1
RuntimeResourceobject

The information about the resource group with which the instance is associated.

ResourceGroupIdstring

The ID of the resource group for scheduling configured for task running.

S_res_group_524258031846018_1684XXXXXXXXX
Imagestring

The ID of the image configured for task running.

i-xxxxxx
Custring

The default number of CUs configured for task running.

0.25
Runtimeobject

The runtime information about the instance.

ProcessIdstring

The instance run ID.

T3_123
Gatewaystring

The host for running.

cn-shanghai.1.2
DataSourceobject

The information about the associated data source.

Namestring

The name of the data source.

mysql_test
Statusstring

The status of the instance.

Valid values:

  • NotRun: The instance is not run.
  • Running: The instance is running.
  • WaitTime: The instance is waiting for the scheduling time to arrive.
  • CheckingCondition: Branch conditions are being checked for the instance.
  • WaitResource: The instance is waiting for resources.
  • Failure: The instance fails to be run.
  • Success: The instance is successfully run.
  • Checking: Data quality is being checked for the instance.
Success
TriggerTimelong

The scheduling time.

1710239005403
Bizdatelong

The data timestamp.

1710239005403
StartedTimelong

The time when the instance started to run.

1710239005403
FinishedTimelong

The time when the instance finished running.

1710239005403
Idlong

The instance ID.

1234
TenantIdlong

The tenant ID.

1
ProjectIdlong

The DataWorks workspace ID.

100
ProjectEnvstring

The environment of the workspace.

Valid values:

  • Prod: production environment
  • Dev: development environment
Prod
Ownerstring

The account ID of the task owner.

1000
CreateTimelong

The creation time.

1710239005403
ModifyTimelong

The modification time.

1710239005403
CreateUserstring

The account ID of the user who creates the instance.

1000
ModifyUserstring

The account ID of the user who modifies the instance.

1000
TotalCountinteger

The total number of entries returned.

100
PageSizeinteger

The number of entries per page.

10
PageNumberinteger

The page number.

1

Examples

Sample success responses

JSONformat

{
  "RequestId": "22C97E95-F023-56B5-8852-B1A77A17XXXX",
  "PagingInfo": {
    "TaskInstances": [
      {
        "TaskId": 1234,
        "TaskType": "ODPS_SQL\n",
        "TaskName": "",
        "Description": "test\n",
        "WorkflowId": 1234,
        "WorkflowName": "",
        "TriggerType": "Scheduler\n",
        "TriggerRecurrence": "Normal\n",
        "WorkflowInstanceId": 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\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,
        "TenantId": 1,
        "ProjectId": 100,
        "ProjectEnv": "Prod",
        "Owner": "1000",
        "CreateTime": 1710239005403,
        "ModifyTime": 1710239005403,
        "CreateUser": "1000",
        "ModifyUser": "1000"
      }
    ],
    "TotalCount": 100,
    "PageSize": 10,
    "PageNumber": 1
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-11-21The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-11-20The request parameters of the API has changed. The response structure of the API has changedView Change Details