All Products
Search
Document Center

Data Management:CreateTask

Last Updated:Apr 29, 2026

Creates a task node for a task flow.

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

dms:CreateTask

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Tid

integer

No

The tenant ID.

Note

To view the tenant ID, move the pointer over the profile picture in the upper-right corner of the Data Management (DMS) console. For more information, see the "View information about the current tenant" section of the Manage DMS tenants topic.

3***

DagId

integer

Yes

The ID of the task flow. You can call the ListTaskFlow or ListLhTaskFlowAndScenario operation to query the task flow ID.

7***

NodeName

string

Yes

The name of the node that you want to create.

zhttest

NodeType

string

Yes

The type of the node that you want to create. For more information about the valid values for this parameter, see NodeType parameter.

NORMAL_SQL

NodeContent

string

No

The configuration of the node.

test

TimeVariables

string

No

The time variables configured for the node.

test

NodeOutput

string

No

The output variables configured for the task.

test

GraphParam

string

No

The position of the node on the Directed Acyclic Graph (DAG).

test

Description of node-related parameters

The configuration of a node varies based on the node type. This topic is a supplementary description of task node-related operations, such as CreateTask and UpdateTaskOutput. The NodeParam, NodeContent, and GraphParam parameters apply to all task node-related operations.
Only nodes such as single-instance SQL assignment, script code, and Elastic Compute Service (ECS) remote command have output variables. The configurations of output variables vary based on the node type. For more information, see the related topic of the UpdateTaskOutput operation.

SQL for single instance

  • DagId

  • NodeName

  • NodeType: 1

  • NodeParam

  • GraphParam

  • NodeContent:

{
    "dbId":123456, // The database ID.
    "sql":"/* Use the database syntax for the current node to write SQL statements */", // The SQL statement.
    "dbType":"lindorm_sql" // The database type.
}

Script

  • DagId

  • NodeName

  • NodeType: 28

  • NodeParam

  • GraphParam

  • NodeOutput

{
    "outputs":[
        {
            "extractMethod":"json", // The value is in the JSON format.
            "variableName":"var", // The name of the variable.
            "description":"demo desc" // The description of the variable.
        }
    ]
}
  • NodeContent:

{
    "regionId":"cn-hangzhou", // The region ID.
    "gatewayId":"dg-xxxxxxxxxxxxxx", // The gateway ID.
    "gatewayInstanceId":"dg-node-xxxxxxxxxxxxxx", // The ID of the gateway instance.
    "scriptFileName":"demo.sh", // The file name.
    "args":[ // The running parameters.
        "-n value",
        "-n1 value1"
    ]
}

Lock-free data change

  • DagId

  • NodeName

  • NodeType: 24

  • NodeParam

  • GraphParam

  • NodeContent:

{
    "dbId":123456, // The database ID.
    "sql":"/* Use the database syntax for the current node to write SQL statements */", // The SQL statement.
    "dbType":"polardb" // The database type.
}

SQL assignment for single instance

  • DagId

  • NodeName

  • NodeType: 32

  • NodeParam

  • GraphParam

  • NodeOutput:

{
    "outputs":[
        {
            /*
            // The variable extraction settings.
            {
                "row":0, // Rows. A value of -1 indicates all rows.
                "column":-1, // Columns. A value of -1 indicates all columns.
                "combiner":"," // The delimiter. If you select all rows or columns, you must specify a delimiter. The returned value of the variable is a string.
            }
            */
            "extractMethod":"{\"row\":0,\"column\":-1,\"combiner\":\",\"}", 
            "variableName":"var", // The name of the variable.
            "description":"For demo" // The description of the variable.
        }
    ]
}
  • NodeContent:

{
    "dbId":123456, // The database ID.
    "sql":"/* Use the database syntax for the current node to write SQL statements. Only SELECT statements are supported. By default, the maximum number of rows returned is 30. *", // The SQL statement.
    "dbType":"lindorm_cql" // The database type.
}

Dependency check

  • DagId

  • NodeName

  • NodeType: 2

  • NodeParam

  • GraphParam

  • NodeContent:

{
    "dependentDAGId":132, // Dependency object: task flow.
    "dependentNodeId":"", // Dependency object: a single node. By default, the dependency object is the specified task flow.
    "dependentStartTimePattern":"yyyy-MM-dd HH:mm|-2d+0h+0m", // The offset of the start time.
    "dependentEndTimePattern":"yyyy-MM-dd HH:mm|+1d +0h+0m", // The offset of the end time.
    "multiSuccessStrategy":2, // The instance check policy. A value of 0 specifies that the most previous node is successful. A value of 1 specifies that all nodes are successful. A value of 2 specifies that the specified node is successful
    "multiSuccessStrategyIndex":1 // Instance check policy: The node x+1 is successful.
}

Status check of a time column in a table

  • DagId

  • NodeName

  • NodeType: 2

  • NodeParam

  • GraphParam

  • NodeContent:

{
    "dependentDAGId":132, // Dependency object: task flow.
    "dependentNodeId":"", // Dependency object: a single node. By default, the dependency object is the specified task flow.
    "dependentStartTimePattern":"yyyy-MM-dd HH:mm|-2d+0h+0m", // The offset of the start time.
    "dependentEndTimePattern":"yyyy-MM-dd HH:mm|+1d +0h+0m", // The offset of the end time.
    "multiSuccessStrategy":2, // The instance check policy. A value of 0 specifies that the most previous node is successful. A value of 1 specifies that all nodes are successful. A value of 2 specifies that the specified node is successful
    "multiSuccessStrategyIndex":1 // Instance check policy: The node x+1 is successful.
}

SQL status check

  • DagId

  • NodeName

  • NodeType: 25

  • NodeParam

  • GraphParam

  • NodeContent:

{
    "dbId":123456,
    "sql":"/* Use the database syntax for the current node to write SQL statements*/ \n\n select 1 from abc",
    "dbType":"lindorm_cql"
}

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The ID of the request. You can use the ID to query logs and troubleshoot issues.

CFD8FE00-36D9-4C1B-940D-65A7B73D9066

ErrorCode

string

The error code returned.

InvalidParameterValid

ErrorMessage

string

The error message returned if the request failed.

InvalidParameterValid

Success

boolean

Indicates whether the request was successful. Valid values:

  • true

  • false

true

NodeId

integer

The ID of the task node returned when the task was created.

3***

Examples

Success response

JSON format

{
  "RequestId": "CFD8FE00-36D9-4C1B-940D-65A7B73D9066",
  "ErrorCode": "InvalidParameterValid",
  "ErrorMessage": "InvalidParameterValid",
  "Success": true,
  "NodeId": 0
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.