In a data workflow, task code, such as SQL, often needs to change dynamically based on the scheduling time to process different data partitions. To avoid manually modifying the code, you can use scheduling parameters. By defining placeholders in your code, the system automatically replaces them with dynamic values like the data timestamp and scheduling time when a task runs. This enables automated, parameterized workflow execution.
Core configuration process
To use scheduling parameters, you must define the parameters and assign values to them in the Scheduling. After the code passes tests in DataStudio, submit the code that contains the scheduling parameters to the Operation Center. The system then automatically schedules the task and dynamically replaces the parameter values based on the assignment logic.
|
Step |
Action |
Goal |
|
1. Define a parameter |
In the node code, define one or more parameters by using the |
Reserve a placeholder for a dynamic value. |
|
2. Configure the parameter |
In the pane of the node, assign a value to the variable in the code. |
Associate the |
|
3. Test |
Use the Perform Smoke Testing feature to simulate a specific data timestamp and verify that the parameter is replaced and the code runs correctly. |
Ensure the configuration is correct in the development environment. |
|
4. Deploy and verify |
Deploy the node to the production environment and confirm the final parameter configuration in Operation Center. |
Ensure the parameters for the production task work as expected. |
Procedure
1. Define parameters

-
Double-click the target node, such as an ODPS SQL node, to open the node editor.
-
In the code of an ODPS SQL node or other SQL-based nodes, define a parameter name by using the
${param}syntax. DataWorks recommends using a descriptive parameter name for easier reference and management.Scheduling parameter syntax:
Type
Syntax
Applicability
Notes
General format
${parameter_name}Applicable to most node types, such as ODPS SQL and data synchronization nodes.
This is the most common format.
Special format
Varies by node type and does not use the
${...}format.PyODPS and Shell
For more information, see Configuration examples for scheduling parameters of different node types.
-- Example: Define a variable named pt_date for partition filtering. SELECT * FROM my_table WHERE ds = '${pt_date}'; -
In the right-side pane, click Scheduling to go to the Scheduling Parameter section.
-
Configure the scheduling parameters as described in the next section.
2. Configure parameters
You can set scheduling parameters in either Visual definition or Define by expression. You can switch between these modes by clicking Define by expression in the upper-right corner of the parameter list. Visual definition is the default.
-
Configure parameters
Visual mode
Click Scheduling in the right-side pane to open the scheduling parameters configuration panel.

-
Add a parameter
Click Scheduling to the right of the node and add parameters in the Scheduling Parameter section. You can add parameters in one of the following two ways.
-
Click Add Parameter and manually enter a name and value. The parameter name must be the same as the variable name defined in the code.
-
Click Load Parameters in Code. DataWorks automatically parses the variables in your code, such as
${pt_date}, and populates them in the parameter list. You only need to enter a value for each parameter.
-
-
Assign a value
You can assign built-in parameters, custom time variables, or constants as values.
-
Click the input box. A drop-down list appears with commonly used parameter expressions that you can select directly. You can also manually enter a custom expression or a built-in variable.
-
You can enter a value based on your business requirements. For more information about supported value formats, see Supported formats of scheduling parameters.
-
Expression mode
Click Define by expression to switch to Expression mode. Use this mode if you prefer configuring parameters with expressions.

-
In Expression mode, separate multiple parameters with spaces.
-
When you add, delete, or modify scheduling parameters in Define by expression, DataWorks validates the syntax of the expression. If the syntax is invalid, the parameter cannot be configured.
For example, DataWorks enforces rules, such as not allowing spaces on either side of the equals sign (=).
-
-
Preview parameters
After you define the parameters, click Preview Scheduling Parameters to see how the parameters will be resolved for upcoming instances based on a specified data timestamp. This helps you test whether the definitions are correct. You can adjust the data timestamp and the number of instances to preview.

Some nodes, such as batch synchronization nodes, have a default ${bizdate} parameter. This parameter is automatically assigned the value $bizdate. You can replace the bizdate parameter with a custom name in your code. The ${bizdate} name itself has no special meaning and is treated the same as any other custom parameter.

3. Smoke testing
After you assign values to the scheduling parameters, use the smoke testing feature. This allows you to set a data timestamp and simulate how the task will run, which helps you verify that the code executes and the scheduling parameters are replaced as expected. If the results are not as expected, adjust the configuration promptly to avoid issues with scheduled runs.
Smoke testing generates instances, which will incur fees. For more information about instance pricing, see Billing of serverless resource groups.
-
Commit the node code.
-
Configure the scheduling time and scheduling dependencies.
-
Click the Save icon
. After the code and configurations are saved, click the Commit icon
to commit the latest code and configuration to Operation Center. You can use the smoke testing feature in the development environment only after the node is committed.NoteIf you find that smoke testing is not running the latest code or parameters, commit the node again.
-
-
Run the smoke test.
Click the
Smoke Testing icon in the toolbar. In the Perform Smoke Testing dialog box, select a data timestamp and click OK to start the test. -
View the smoke testing logs.
-
In the Smoke Testing Records window that appears, find the latest record and click View Log.

-
Check the parameter output in the logs to confirm that the values are correct.
NoteIf you accidentally close the window, you can reopen it by clicking the
Smoke Testing Logs icon in the toolbar.
-
The Run
and Advanced Run
features require you to manually assign constants to variables in the code. Therefore, they cannot be used to verify whether scheduling parameters are configured correctly.
4. Deploy and verify
After verification in the development environment, you can deploy the task to Operation Center for scheduled execution in production. After deployment, check the scheduling parameters in the production environment to prevent runtime errors.
If the scheduling parameters for an auto triggered task are not configured as expected, or if you cannot find the task in Operation Center, ensure that the task was deployed successfully. For more information about how to deploy a task, see Deploy a task.
-
Check the parameter definitions.
Go to Operation Center, switch to the target region and workspace, and navigate to the page. In the task list, click the task name and check the Property in the Property panel to ensure they are correct.

-
Perform smoke testing in Operation Center.
You can also use smoke testing in Operation Center to confirm that a deployed task replaces parameters and executes code as expected in the production environment. For more information, see Run a test and view the test instance.
ImportantNote that smoke testing runs on real production data. Proceed with caution to avoid corrupting data in your production database.

-
Observe the actual scheduling results.
After the task is automatically scheduled, you can verify that the parameters were replaced correctly by checking the parameters of an auto triggered instance in Auto Triggered Instances.

Complete configuration example
This example uses an ODPS SQL node to show how to use the Perform smoke test in development environment feature in the development environment to test whether configured scheduling parameters work as expected. After the task is deployed, you will also check its scheduling parameter configuration in Operation Center.
For information about how to configure scheduling parameters for different node types, see Configuration examples for scheduling parameters of different node types.
-
Edit the node code and configure scheduling parameters.
The following figure shows the code and scheduling parameter configurations of the ODPS SQL node.

-
Define variables in the code.
-- Assign values by using built-in parameters SELECT '${var1}'; SELECT '${var2}'; -- Assign values by using custom parameters SELECT '${var3}'; SELECT '${var4}'; -- Assign a constant SELECT '${var5}'; -
Assign values to the variables.
In the pane, assign values to the variables (Area 2). For more information about value formats, see Supported formats of scheduling parameters.
-
var1=$bizdate: Assigns the data timestamp inyyyymmddformat. -
var2=$cyctime: Assigns the scheduled runtime inyyyymmddhh24missformat. -
var3=${yyyymmdd}: Assigns the data timestamp inyyyymmddformat. -
var4=$[yyyymmddhh24miss]: Assigns the scheduled runtime inyyyymmddhh24missformat. -
var5=Hangzhou: Assigns the constantHangzhoutovar5.
-
-
Optional: Configure the scheduling time.
Configure the ODPS SQL node to run on an hourly schedule (Area 3).
NoteYou can choose whether to configure a time-based schedule based on your needs. This example demonstrates how to configure an hourly schedule.
-
Start time:
16:00 -
End time:
23:59 -
Interval:
1hour
For more information about configuring time-based schedules, see Configure time properties.
-
-
Set the scheduling dependency.
Configure a scheduling dependency for the node. For more information, see Configure scheduling dependencies. In this example, the root node is used as the upstream dependency for this node.
-
-
In the top toolbar of the node editor page, click the
icon and then the
icon to save and commit the configuration for the ODPS SQL node. -
Perform smoke testing in the development environment.
-
Click the
icon. In the Smoke Testing in Development Environment dialog box, configure the data timestamp to simulate the node's schedule.
The data timestamp is configured as follows:-
Data Timestamp:
2025-10-16 -
Start Time:
16:00 -
End Time:
17:00
Because the ODPS SQL task is scheduled to run hourly, it will generate two instances at
16:00and17:00on2025-10-17.NoteThe data timestamp is typically the day before the runtime. Therefore, the task's actual runtime is
2025-10-17.The expected values for the
16:00instance are:-
var1=20251016 -
var2=20251017160000 -
var3=20251016 -
var4=20251017160000
The expected values for the
17:00instance are:-
var1=20251016 -
var2=20251017170000 -
var3=20251016 -
var4=20251017170000
-
-
Click OK. The node starts running at the specified times.
-
After the run is complete, click the
icon to view the smoke testing logs.The two instances generated for the node run successfully, and the results are as expected.



-
-
If your workspace is in standard mode, you must deploy the node to the production environment. On the ODPS SQL node editor page, click Deploy in the upper-right corner to deploy the node. For more information, see Deploy a task.
-
Go to Operation Center to confirm the node's scheduling parameter configuration.

-
In the top menu bar of DataStudio, click Operation Center in the upper-right corner.
-
On the page, search for the target node.
NoteYou can find the node on this page only after it has been successfully deployed.
-
Click the target node name and view the Execution Parameters in the Property panel.
In this example, the execution parameters for the node are
var1=$bizdate var2=$cyctime var3=${yyyymmdd} var4=$[yyyymmddhh24miss]. -
Observe the actual parameter replacement in a running instance. After a scheduled instance is generated, go to the Auto Triggered Instances page, search for the task name, click the instance name, and view the Execution Parameters in the Property panel.
In this example, the execution parameters are resolved as
var1=20251016 var2=20251017160000 var3=20251016 var4=20251017160000.
-