Nodes in DataWorks run in isolation, so they cannot share memory or state directly. Input and output parameters let nodes pass values — constants, variables, or query results — to downstream nodes at runtime, enabling dynamic scheduling across your pipeline.
How it works
An upstream node declares an output parameter and its value. A downstream node declares an input parameter that references that output. When the pipeline runs, DataWorks resolves the reference and injects the upstream value into the downstream node.
The full chain looks like this:
Upstream node → defines output parameter → Dependency link (output name) → Downstream node → declares input parameter → references value in code as ${parameter_name}
Choose a parameter type
DataWorks supports two ways to pass data between nodes:
| Method | How it works | Use when |
|---|---|---|
| Standard output parameter | Pass a constant string or a variable (scheduling parameter, global variable) | Passing dates, IDs, configuration values, or other small scalar values |
| Assignment output parameter | Pass the query results of the current node | Passing result sets from SQL queries to downstream nodes |
Limitations:
-
The Add assignment parameter option requires DataWorks Standard Edition or higher.
-
If a node produces no results, the node still succeeds, but any downstream node that references the assignment parameter may fail.
-
Only these node types support assignment parameters: EMR Hive, EMR Spark SQL, ODPS Script, Hologres SQL, AnalyticDB for PostgreSQL, ClickHouse SQL, and MySQL. For other node types, use an assignment node instead.
Prerequisites
Before you begin, ensure that you have:
-
A DataWorks workspace with at least two nodes that have an upstream–downstream relationship
-
DataWorks Standard Edition or higher (required for assignment parameters only)
Open the parameter configuration section
-
Log on to the DataWorks console. In the top navigation bar, select the target region. In the left-side navigation pane, choose Data Development and O&M > Data Development. Select your workspace from the drop-down list and click Go to Data Development.
-
On the Data Studio page, double-click the node to open its editor.
-
In the right-side pane, click Properties. In the Input and Output Parameters section, click the
icon.
Configure output parameters
Configure a standard output parameter
A standard output parameter passes a constant or variable from the current node to downstream nodes.
In the Input and Output Parameters section, you can configure output parameters for the current node. Fill in the fields:
| Field | Description |
|---|---|
| No. | Auto-generated sequence number. |
| Parameter name | A custom name for the output parameter. |
| Type | Select Constant or Variable. |
| Value | The value to pass. A constant is a fixed string. A variable can be a system global variable, a built-in scheduling parameter, or a custom parameter in ${...} or $[...] format. |
| Description | A brief description of the parameter. |
| Add method | How the parameter was added: Added Automatically, Analyze Code, or Added Manually. |
| Actions | Save, Change, or Delete the parameter. |
Click Save in the Actions column.
Configure an assignment output parameter
An assignment output parameter passes the query results of the current node to downstream nodes.
-
In the Input and Output Parameters > Output Parameters section, click Add assignment parameter. The system automatically configures the parameter to pass query results to any downstream node that references it.
-
After the parameter is created, go to Dependencies > Output Name of Current Node to find the generated output name. The Add Mode for this output is Added Automatically. Downstream nodes use this output name to declare a dependency on the current node.
Configure input parameters
Input parameters let the downstream node retrieve and use a value from an upstream output parameter. Configure them after the upstream output parameter and the dependency are both in place.
Step 1: Configure an output parameter on the upstream node
Follow the steps in Configure output parameters to define the value the upstream node will pass.
Step 2: Establish a dependency
-
Open the downstream node editor and click Properties in the right-side pane.
-
In the Dependencies > Parent Nodes section, enter and select the output name of the upstream node's output parameter.
-
Click Create.
Step 3: Add the input parameter
In the Input and Output Parameters section of the downstream node, click Create and fill in the fields:
| Field | Description |
|---|---|
| No. | Auto-generated sequence number. |
| Parameter name | A custom name for the input parameter. Use this name to reference the value in the node's code. |
| Value source | The value comes from the upstream node's output parameter. |
| Description | A brief description of the parameter. |
| Parent node ID | Auto-parsed from the upstream node. |
| Add method | How the parameter was added: Added Automatically, Analyze Code, or Added Manually. |
| Actions | Save, Change, or Delete the parameter. |
Click Save in the Actions column.
Use input parameters in node code
Reference an input parameter in node code using ${parameter_name}. This syntax is the same as for other scheduling parameters.
The following example shows how to reference an input parameter in a Shell node:
Run the entire workflow, not individual nodes. If you run a downstream node in isolation, it cannot resolve the input parameter and the run fails.
System-supported global variables
Use the following global variables as values for output parameters of the Variable type:
System variables
| Variable | Description |
|---|---|
${projectId} |
The project ID. |
${projectName} |
The MaxCompute project name. |
${nodeId} |
The node ID. |
${gmtdate} |
The scheduled run date at 00:00:00, in yyyy-MM-dd 00:00:00 format. |
${taskId} |
The task instance ID. |
${seq} |
The sequence number of the task instance among all instances of the same node on the same day. |
${cyctime} |
The scheduled time of the instance. |
${status} |
The instance status: SUCCESS or FAILURE. |
${bizdate} |
The business date. |
${finishTime} |
The instance completion time. |
${taskType} |
The run type: NORMAL, MANUAL, PAUSE, SKIP, UNCHOOSE, or SKIP_CYCLE. |
${nodeName} |
The node name. |
For other scheduling parameter formats, see Supported formats of scheduling parameters.
Next steps
-
Assignment node — Pass query results between nodes using a dedicated assignment node
-
Supported formats of scheduling parameters — Full reference for scheduling parameter syntax