All Products
Search
Document Center

DataWorks:Configure and use scheduling parameters

Last Updated:Apr 21, 2026

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 ${param} format.

Reserve a placeholder for a dynamic value.

2. Configure the parameter

In the Scheduling > Scheduling Parameter pane of the node, assign a value to the variable in the code.

Associate the ${param} placeholder with a specific scheduling parameter, such as $bizdate or $[yyyymmdd-1].

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

image

  1. Double-click the target node, such as an ODPS SQL node, to open the node editor.

  2. 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}'; 
  3. In the right-side pane, click Scheduling to go to the Scheduling Parameter section.

  4. 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.

  1. Configure parameters

    Visual mode

    Click Scheduling in the right-side pane to open the scheduling parameters configuration panel.

    image

    • 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.

      1. 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.

      2. 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.

    image

    • 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 (=).

  2. 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.

    image

Note

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.

image

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.
  1. Commit the node code.

    1. Configure the scheduling time and scheduling dependencies.

    2. 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.

      Note

      If you find that smoke testing is not running the latest code or parameters, commit the node again.

  2. Run the smoke test.

    Click the imageSmoke Testing icon in the toolbar. In the Perform Smoke Testing dialog box, select a data timestamp and click OK to start the test.

  3. View the smoke testing logs.

    1. In the Smoke Testing Records window that appears, find the latest record and click View Log.

      image

    2. Check the parameter output in the logs to confirm that the values are correct.

      Note

      If you accidentally close the window, you can reopen it by clicking the imageSmoke Testing Logs icon in the toolbar.

Important

The Run image and Advanced Run image 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.

Note

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.

  1. Check the parameter definitions.

    Go to Operation Center, switch to the target region and workspace, and navigate to the Auto Triggered Task O&M > Periodic tasks page. In the task list, click the task name and check the Property in the Property panel to ensure they are correct.

    image

  2. 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.

    Important

    Note that smoke testing runs on real production data. Proceed with caution to avoid corrupting data in your production database.

    image

  3. 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.

    image

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.

Note

For information about how to configure scheduling parameters for different node types, see Configuration examples for scheduling parameters of different node types.

  1. Edit the node code and configure scheduling parameters.

    The following figure shows the code and scheduling parameter configurations of the ODPS SQL node.节点代码及参数配置

    1. 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}';
    2. Assign values to the variables.

      In the Scheduling > Scheduling Parameter 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 in yyyymmdd format.

      • var2=$cyctime: Assigns the scheduled runtime in yyyymmddhh24miss format.

      • var3=${yyyymmdd}: Assigns the data timestamp in yyyymmdd format.

      • var4=$[yyyymmddhh24miss]: Assigns the scheduled runtime in yyyymmddhh24miss format.

      • var5=Hangzhou: Assigns the constant Hangzhou to var5.

    3. Optional: Configure the scheduling time.

      Configure the ODPS SQL node to run on an hourly schedule (Area 3).

      Note

      You 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: 1 hour

      For more information about configuring time-based schedules, see Configure time properties.

    4. 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.

  2. 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.

  3. Perform smoke testing in the development environment.

    1. 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:00 and 17:00 on 2025-10-17.

      Note

      The 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:00 instance are:

      • var1=20251016

      • var2=20251017160000

      • var3=20251016

      • var4=20251017160000

      The expected values for the 17:00 instance are:

      • var1=20251016

      • var2=20251017170000

      • var3=20251016

      • var4=20251017170000

    2. Click OK. The node starts running at the specified times.

    3. 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.

      image

      image

      image

  4. 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.

  5. Go to Operation Center to confirm the node's scheduling parameter configuration.

    生产环境参数配置

    1. In the top menu bar of DataStudio, click Operation Center in the upper-right corner.

    2. On the Auto Triggered Task O&M > Periodic tasks page, search for the target node.

      Note

      You can find the node on this page only after it has been successfully deployed.

    3. 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].

    4. 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.

Related topics