ListTaskInstances

更新时间:
复制 MD 格式

Queries a list of instances. You can also specify filter conditions to query specific instances.

Operation description

You must purchase DataWorks Basic Edition or a higher edition to use this feature.

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. 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

integer

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.

integer

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

string

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

integer

No

The ID of the workflow to which the instance belongs.

1234

UnifiedWorkflowInstanceId

integer

No

The unified workflow instance ID. For all task instances under a specific data timestamp within a single trigger, this field has the same value.

1234

WorkflowInstanceType

string

No

The type of the workflow instance. 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 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.

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 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

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:

  • 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 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.

  • NotRun: Not started

  • Running

  • Failure

  • Success

  • WaitTime: Awaiting scheduled time

  • WaitResource: Awaiting resources

Success

Filter

string

No

The filter. It is in JSON format, and multiple filter conditions are combined with a logical AND. Currently supported fields include: 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

Pagination information.

TaskInstances

array<object>

The list of task instances.

array<object>

TaskId

integer

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

1234

TaskType

string

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

ODPS_SQL

TaskName

string

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

SQL node

Description

string

The description.

test

WorkflowId

integer

The ID of the workflow to which the instance belongs.

1234

WorkflowName

string

The name of the workflow to which the instance belongs.

Test workflow

TriggerType

string

The trigger type.

Valid values:

  • Scheduler: scheduling cycle-based trigger

  • Manual: manual trigger

Scheduler

TriggerRecurrence

string

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

WorkflowInstanceId

integer

The workflow instance ID.

1234

UnifiedWorkflowInstanceId

integer

Unified workflow instance ID. All task instances triggered under the same data timestamp share the same value for this field.

1234

WorkflowInstanceType

string

The type of the workflow instance.

Valid values:

  • SmokeTest

  • SupplementData

  • Manual

  • ManualWorkflow

  • Normal

  • ManualFlow

Normal

Timeout

integer

The timeout period of task running. Unit: seconds.

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

3600

RerunMode

string

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

RunNumber

integer

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

1

PeriodNumber

integer

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

1

BaselineId

integer

The baseline ID.

1234

Priority

integer

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

1

RuntimeResource

object

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

ResourceGroupId

string

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

S_res_group_524258031846018_1684XXXXXXXXX

Image

string

The ID of the image configured for task running.

i-xxxxxx

Cu

string

The default number of CUs configured for task running.

0.25

Runtime

object

The runtime information about the instance.

ProcessId

string

The instance run ID.

T3_123

Gateway

string

The host for running.

cn-shanghai.1.2

DataSource

object

The information about the associated data source.

Name

string

The name of the data source.

mysql_test

Status

string

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

TriggerTime

integer

The scheduling time.

1710239005403

Bizdate

integer

The data timestamp.

1710239005403

StartedTime

integer

The time when the instance started to run.

1710239005403

FinishedTime

integer

The time when the instance finished running.

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 user who creates the instance.

1000

ModifyUser

string

The account ID of the user who modifies the instance.

1000

ScriptParameters

string

The script parameter list.

para1=val1 para2=val2

WaitingResourceTime

integer

The timestamp for when it started waiting for resources.

1710239005403

WaitingTriggerTime

integer

The timestamp for when it 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.