All Products
Search
Document Center

DataWorks:CreateNode

Last Updated:Mar 30, 2026

Creates a node in DataStudio. The information about the node is described by using FlowSpec.

Operation description

Important This API does not support batch operations. If you define more than one node in the FlowSpec, all nodes except the first one are ignored.

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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

ProjectId

integer

Yes

The DataWorks workspace ID. You can log on to the DataWorks console and go to the Workspace page to query the ID.

You must configure this parameter to specify the DataWorks workspace to which the API operation is applied.

123456

ContainerId

string

No

Specify this parameter if you want to create the node inside a container. This parameter represents the unique identifier of the container, which can be a workflow or a container node.

Note

If this parameter is specified, the path field defined in FlowSpec is ignored.

Note

Prior to SDK version 8.0.0, this field is of type Long. In SDK version 8.0.0 and later, it is of type String. This change does not affect the normal use of the SDK. The parameter is returned based on the type defined in the SDK. Compilation failures caused by the type change may occur only when you upgrade the SDK across version 8.0.0. In this case, you must manually update the data type.

23451286945488XXXX

Scene

string

Yes

Specify this parameter if you want to create the node inside a container. This parameter represents the unique identifier of the container, which can be a workflow or a container node.

Note

If this parameter is specified, the path field defined in FlowSpec is ignored.

Note

Prior to SDK version 8.0.0, this field is of type Long. In SDK version 8.0.0 and later, it is of type String. This change does not affect the normal use of the SDK. The parameter is returned based on the type defined in the SDK. Compilation failures caused by the type change may occur only when you upgrade the SDK across version 8.0.0. In this case, you must manually update the data type.

DATAWORKS_PROJECT

Spec

string

Yes

The FlowSpec information that describes the node. For more information, see FlowSpec.

Note

How do I quickly obtain a FlowSpec template?

  • Go to Data Studio, open a node, click Version on the right side, find the latest version, and then click Scheduling Settings to obtain the FlowSpec description of the current node. You can use the FlowSpec description in the version to quickly build a template that meets your requirements.

Note

How do I configure the node content?

  • Enter the code for the node in the $.spec.nodes[].script.content field.

Note

How do I configure a batch synchronization node?

  • Write the script by referring to Step 4 in Configure an offline sync task in the code editor, and then enter the script content in the $.spec.nodes[*].script.content field. Alternatively, you can create a batch synchronization node in the console and view its version information to obtain the script content.

{ "version": "1.1.0", "kind": "Node", "spec": { "nodes": [ { "recurrence": "Normal", "timeout": 0, "instanceMode": "T+1", "rerunMode": "Allowed", "rerunTimes": 3, "rerunInterval": 180000, "datasource": { "name": "odps_test" }, "script": { "path": "XX/OpenAPI_Test/odpsSQL_Test", "runtime": { "command": "ODPS_SQL" }, "content": "select now();" }, "trigger": { "type": "Scheduler", "cron": "00 00 00 * * ?", "startTime": "1970-01-01 00:00:00", "endTime": "9999-01-01 00:00:00", "timezone": "Asia/Shanghai", "delaySeconds": 0 }, "runtimeResource": { "resourceGroup": "S_res_group_XXXX_XXXX" }, "name": "odpsSQL_Test", "inputs": { "nodeOutputs": [ { "data": "project_root", "artifactType": "NodeOutput" } ] }, "outputs": { "nodeOutputs": [ { "data": "output_data", "artifactType": "NodeOutput", "refTableName": "odpsSQL_Test" } ] } } ] } }

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

AFBB799F-8578-51C5-A766-E922EDB8XXXX

Id

string

The unique identifier of the Data Studio node.

Note

This field is of the Long type in SDK versions prior to 8.0.0, and of the String type in SDK versions 8.0.0 and later. This change does not affect the normal use of the SDK. The parameter is returned based on the type defined in the SDK. Compilation failures caused by the type change may occur only when you upgrade the SDK across version 8.0.0. In this case, you must manually update the data type.

860438872620113XXXX

Examples

Success response

JSON format

{
  "RequestId": "AFBB799F-8578-51C5-A766-E922EDB8XXXX",
  "Id": "860438872620113XXXX"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.