All Products
Search
Document Center

DataWorks:Configuration examples for node types

Last Updated:Mar 26, 2026

Most node types — including SQL nodes and batch synchronization nodes — use the same method to define and reference scheduling parameters. Two node types work differently: PyODPS nodes retrieve parameters through a dictionary object instead of string replacement, and general Shell nodes use positional variables instead of named ones. This topic provides configuration examples for each node type.

Node type comparison

The following table summarizes how each node type handles scheduling parameters.

Node type Variable reference syntax Assignment syntax Special constraints
SQL nodes (e.g., ODPS SQL) ${var_name} in code var_name=$bizdate None
Batch synchronization nodes Same as SQL nodes Same as SQL nodes None
PyODPS nodes args['var_name'] in code Same as SQL nodes No string replacement in code
General Shell nodes $1, $2, $3 (positional) Expressions only, space-separated No custom variable names

SQL nodes and batch synchronization nodes

SQL nodes (such as ODPS SQL nodes) and batch synchronization nodes use the same parameter configuration method. This method also applies to most other node types.

Note

Some nodes do not support scheduling parameters. Check the documentation for your specific node type to confirm support.

To configure parameters, assign values in the parameter assignment area, then reference those variables in the code editing area.

系统参数和自定义参数赋值

The figure above shows an example with five parameters:

  • var1 and var3 are built-in system variables, assigned values from the built-in variables $bizdate and $cyctime.

  • var2 and var4 are custom parameters, assigned values from date format expressions.

  • var5 is a constant.

Assignment examples:

  • Assign the business time to a built-in system variable: var1=$bizdate

  • Assign the scheduling time to a built-in system variable: var3=$cyctime

  • Assign the business time to a custom parameter: var2=${yyyymmdd}

  • Assign the scheduling time to a custom parameter: var4=$[yyyymmddhh24:mi:ss]

  • Assign a constant to a parameter: var5=abc

In the code editing area, reference each variable using the ${var_name} format — for example, ${var1} or ${var2}.

PyODPS nodes

PyODPS nodes do not support direct string replacement using the ${param_name} format in code. This design prevents string replacement from modifying source code invasively. Instead, retrieve scheduling parameters from the args global variable, which is a dict (dictionary) object, before the code runs. The assignment syntax in the parameter assignment area is the same as for other nodes.

Pyodps节点示例

The figure above shows three parameters assigned in the parameter assignment area and referenced through args in the code editing area.

Assignment examples:

  • Assign the business time to a built-in parameter: var1=$bizdate

  • Assign the business time to a custom parameter using one format: var2=${yyyymmdd}

  • Assign the business time to a custom parameter using another format: var3=$[yyyymmdd]

In the code, reference these parameters as args['var1'], args['var2'], and args['var3'].

Important

If you write ${var_name} directly in PyODPS code, it will not be substituted. Always use args['var_name'] to access parameter values at runtime.

General Shell nodes

For general Shell nodes, you cannot use custom variable names — name variables by their ordinal position ($1, $2, $3) in ascending order. For 10 or more parameters, use the ${10} format.

Shell节点示例

The figure above shows three positional parameters: $1 is a built-in parameter, while $2 and $3 are custom parameters defined in the code editing area.

Note

For general Shell nodes, assign values using only expressions in the parameter assignment area, separated by spaces. Values are assigned to positional parameters in sequential order. For example, the first value in the parameter assignment area is assigned to $1, the second to $2, and so on.

Assignment examples (space-separated expressions in the parameter assignment area):

  • Assign the business time to $1: $bizdate

  • Assign the business time to $2: ${yyyymmdd}

  • Assign the scheduling time to $3: $[yyyymmdd]

What's next