All Products
Search
Document Center

DataWorks:GetTask

Last Updated:Sep 03, 2026

Queries the details of a specified task.

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

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Id

integer

Yes

The task ID.

1234

ProjectEnv

string

No

Workspace environment. Valid values:

  • Prod: production environment

  • Dev: development environment

Prod

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

22C97E95-F023-56B5-8852-B1A77A17XXXX

Task

object

The task details.

Name

string

The name of the task.

SQL node

Description

string

The description of the task.

test

WorkflowId

integer

The workflow ID.

1234

InstanceMode

string

The instance generation mode. Valid values:

  • T+1

  • Immediately

T+1

Type

string

The type of the task.

ODPS_SQL

BaselineId

integer

The baseline ID.

1234

Priority

integer

Task priority. Valid values: 1 to 8. Higher values indicate higher priority. Default value: 1.

1

Timeout

integer

Task execution timeout, in seconds.

3600

RerunMode

string

The rerun mode. Valid values:

  • AllDenied: The task cannot be rerun.

  • FailureAllowed: The task can be rerun only after failure.

  • AllAllowed: The task can always be rerun.

AllAllowed

RerunTimes

integer

Number of reruns. Takes effect only when RerunMode is AllAllowed or FailureAllowed.

3

RerunInterval

integer

Rerun interval, in seconds.

60

Script

object

The script information.

Content

string

The script content.

echo "helloWorld"

Parameters

string

The script parameters.

para1=$bizdate

Trigger

object

The scheduling trigger configuration.

Type

string

The trigger type. Valid values:

  • Scheduler: periodic scheduling

  • Manual: manual scheduling

Scheduler

Recurrence

string

Post-trigger running mode. Takes effect only when Type is Scheduler. Valid values:

  • Pause

  • Skip

  • Normal

Normal

Cron

string

CRON expression. Takes effect only when Type is Scheduler.

00 00 00 * * ?

StartTime

string

Start time for periodic scheduling. Takes effect only when Type is Scheduler.

1970-01-01 00:00:00

EndTime

string

End time for periodic scheduling. Takes effect only when Type is Scheduler.

9999-01-01 00:00:00

RuntimeResource

object

Runtime environment configuration, such as the resource group.

ResourceGroupId

string

Resource group ID for task scheduling.

S_res_group_524258031846018_1684XXXXXXXXX

Image

string

Image ID for task execution.

i-xxxxxx

Cu

string

Default number of compute units (CUs) for task execution.

0.25

DataSource

object

The associated data source.

Name

string

The name of the data source.

mysql_test

Inputs

object

The input information.

Variables

array<object>

The variables.

object

Name

string

The name of the variable.

key1

Type

string

The type. Valid values:

  • Constant: constant

  • PassThrough: node output

  • System: variable

  • NodeOutput: script output

Constant

Value

string

The value of the variable.

Value1

Outputs

object

The output information.

TaskOutputs

array<object>

The task outputs.

object

Output

string

The identifier of the output.

pre.odps_sql_demo_0

Variables

array<object>

The variables.

object

Name

string

The name of the variable.

key1

Type

string

The type. Valid values:

  • Constant: constant

  • PassThrough: node output

  • System: variable

  • NodeOutput: script output

Constant

Value

string

The value of the variable.

value1

Dependencies

array<object>

The dependency information.

object

Type

string

The dependency type. Valid values:

  • CrossCycleDependsOnChildren: cross-cycle dependency on level-1 descendant nodes

  • CrossCycleDependsOnSelf: cross-cycle dependency on the current node

  • CrossCycleDependsOnOtherNode: cross-cycle dependency on other nodes

  • Normal: same-cycle scheduling dependency

Normal

UpstreamOutput

string

Output identifier of the ancestor task. Returned only when same-cycle scheduling dependencies and node input are configured.

pre.odps_sql_demo_0

UpstreamTaskId

string

Ancestor task ID. Returned only when cross-cycle scheduling dependencies or same-cycle scheduling dependencies are configured without node input.

1234

SubTasks

object

Subtask configuration, such as do-while nodes.

SubTasks

array<object>

The subtasks.

array<object>

Name

string

The name of the task.

SQL node

Description

string

The description of the task.

test

WorkflowId

integer

The ID of the workflow to which the task belongs.

1234

Type

string

The type of the task.

ODPS_SQL

BaselineId

integer

The baseline ID.

The baseline ID.

Priority

integer

Task priority. Valid values: 1 to 8. Higher values indicate higher priority. Default value: 1.

1

Timeout

integer

Task execution timeout, in seconds.

3600

RerunMode

string

The rerun mode. Valid values:

  • AllDenied: The task cannot be rerun.

  • FailureAllowed: The task can be rerun only after failure.

  • AllAllowed: The task can always be rerun.

AllAllowed

RerunTimes

integer

Number of reruns. Takes effect only when RerunMode is AllAllowed or FailureAllowed.

3

RerunInterval

integer

Rerun interval, in seconds.

180

Trigger

object

The scheduling trigger configuration.

Type

string

The trigger type. Valid values:

  • Scheduler: periodic scheduling

  • Manual: manual scheduling

Scheduler

Recurrence

string

Post-trigger running mode. Takes effect only when Type is Scheduler. Valid values:

  • Pause

  • Skip

  • Normal

Normal

Cron

string

CRON expression. Takes effect only when Type is Scheduler.

00 00 00 * * ?

StartTime

string

Start time for periodic scheduling. Takes effect only when Type is Scheduler.

1970-01-01 00:00:00

EndTime

string

End time for periodic scheduling. Takes effect only when Type is Scheduler.

9999-01-01 00:00:00

RuntimeResource

object

Runtime environment configuration, such as the resource group.

ResourceGroupId

string

Resource group ID for task scheduling.

S_res_group_524258031846018_1684XXXXXXXXX

Image

string

Image ID for task execution.

i-xxxxxx

Cu

string

Default number of CUs for task execution.

0.25

DataSource

object

The associated data source.

Name

string

The name of the data source.

mysql_test

Id

integer

The task ID.

1234

ProjectId

integer

The workspace ID.

100

ProjectEnv deprecated

string

Workspace environment. Deprecated; use EnvType instead. Valid values:

  • Prod: production environment

  • Dev: development environment

Prod

EnvType

string

Workspace environment. 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 creator.

1000

ModifyUser

string

The account ID of the modifier.

1000

Type

string

The type of the subtask. Valid values:

  • DoWhile: do-while node

  • Combined: node group

  • ForEach: for-each node

Combined

Tags

array<object>

The tags.

object

Key

string

The tag key.

key1

Value

string

The tag value.

value1

Id

integer

The instance ID.

1234

ProjectId

integer

The workspace ID.

100

ProjectEnv deprecated

string

Workspace environment. Deprecated; use EnvType instead. Valid values:

  • Prod: production environment

  • Dev: development environment

Prod

EnvType

string

Workspace environment. 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 creator.

1000

ModifyUser

string

The account ID of the modifier.

1000

Examples

Success response

JSON format

{
  "RequestId": "22C97E95-F023-56B5-8852-B1A77A17XXXX",
  "Task": {
    "Name": "SQL node",
    "Description": "test",
    "WorkflowId": 1234,
    "InstanceMode": "T+1",
    "Type": "ODPS_SQL",
    "BaselineId": 1234,
    "Priority": 1,
    "Timeout": 3600,
    "RerunMode": "AllAllowed",
    "RerunTimes": 3,
    "RerunInterval": 60,
    "Script": {
      "Content": "echo \"helloWorld\"",
      "Parameters": "para1=$bizdate"
    },
    "Trigger": {
      "Type": "Scheduler",
      "Recurrence": "Normal",
      "Cron": "00 00 00 * * ?",
      "StartTime": "1970-01-01 00:00:00",
      "EndTime": "9999-01-01 00:00:00"
    },
    "RuntimeResource": {
      "ResourceGroupId": "S_res_group_524258031846018_1684XXXXXXXXX",
      "Image": "i-xxxxxx\n",
      "Cu": "0.25"
    },
    "DataSource": {
      "Name": "mysql_test"
    },
    "Inputs": {
      "Variables": [
        {
          "Name": "key1",
          "Type": "Constant\n",
          "Value": "Value1\n"
        }
      ]
    },
    "Outputs": {
      "TaskOutputs": [
        {
          "Output": "pre.odps_sql_demo_0"
        }
      ],
      "Variables": [
        {
          "Name": "key1",
          "Type": "Constant\n",
          "Value": "value1"
        }
      ]
    },
    "Dependencies": [
      {
        "Type": "Normal",
        "UpstreamOutput": "pre.odps_sql_demo_0",
        "UpstreamTaskId": "1234"
      }
    ],
    "SubTasks": {
      "SubTasks": [
        {
          "Name": "SQL node\n",
          "Description": "test",
          "WorkflowId": 1234,
          "Type": "ODPS_SQL\n",
          "BaselineId": 0,
          "Priority": 1,
          "Timeout": 3600,
          "RerunMode": "AllAllowed",
          "RerunTimes": 3,
          "RerunInterval": 180,
          "Trigger": {
            "Type": "Scheduler",
            "Recurrence": "Normal\n",
            "Cron": "00 00 00 * * ?\n",
            "StartTime": "1970-01-01 00:00:00\n",
            "EndTime": "9999-01-01 00:00:00\n"
          },
          "RuntimeResource": {
            "ResourceGroupId": "S_res_group_524258031846018_1684XXXXXXXXX",
            "Image": "i-xxxxxx",
            "Cu": "0.25"
          },
          "DataSource": {
            "Name": "mysql_test\n"
          },
          "Id": 1234,
          "ProjectId": 100,
          "ProjectEnv": "Prod",
          "EnvType": "Prod",
          "Owner": "1000\n",
          "CreateTime": 1710239005403,
          "ModifyTime": 1710239005403,
          "CreateUser": "1000\n",
          "ModifyUser": "1000\n"
        }
      ],
      "Type": "Combined"
    },
    "Tags": [
      {
        "Key": "key1",
        "Value": "value1"
      }
    ],
    "Id": 1234,
    "ProjectId": 100,
    "ProjectEnv": "Prod",
    "EnvType": "Prod",
    "Owner": "1000",
    "CreateTime": 1710239005403,
    "ModifyTime": 1710239005403,
    "CreateUser": "1000\n",
    "ModifyUser": "1000"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.