All Products
Search
Document Center

DataWorks:CreateNode

Last Updated:Dec 19, 2025

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

Operation description

Note You cannot use this API operation to create multiple nodes at a time. If you specify multiple nodes by using FlowSpec, the system creates only the first specified node.

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
ProjectIdstringYes

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
ContainerIdstringNo

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.
a7ef0634-20ec-4a7c-a214-54020f91XXXX
ScenestringYes

The scenario for node creation. This determines whether the node is created in the manual task pane or the Data Studio pane. DataworksManualWorkflow is valid only when ContainerId is specified and the container is a manual workflow.

Valid values:

  • DATAWORKS_PROJECT: Project directory
  • DATAWORKS_MANUAL_WORKFLOW: Manual workflow
  • DATAWORKS_MANUAL_TASK: Manual task
DATAWORKS_PROJECT
SpecstringYes

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": [ { "id": "860438872620113XXXX", "recurrence": "Normal", "timeout": 0, "instanceMode": "T+1", "rerunMode": "Allowed", "rerunTimes": 3, "rerunInterval": 180000, "datasource": { "name": "ODPS_test", "type": "ODPS" }, "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": "lwttest_standard_root", "artifactType": "NodeOutput" } ] }, "outputs": { "nodeOutputs": [ { "data": "output_data", "artifactType": "NodeOutput", "refTableName": "odpsSQL test" } ] } } ], "flow": [ { "nodeId": "860438872620113XXXX", "depends": [ { "type": "Normal", "output": "project_root" } ] } ] } }

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

AFBB799F-8578-51C5-A766-E922EDB8XXXX
Idstring

The unique identifier of the Data Studio node.

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

Examples

Sample success responses

JSONformat

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

Error codes

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

Change history

Change timeSummary of changesOperation
2025-01-13The internal configuration of the API is changed, but the call is not affectedView Change Details
2025-01-13The response structure of the API has changedView Change Details