Scheduling cycle: Daily scheduling

更新时间:
复制 MD 格式

Daily scheduling runs a node once a day at a specified time. When you create an auto triggered task, the system generates a random scheduled time between 00:00 and 00:30 by default. You can change this time as needed. For example, you can set a task to run at 13:00 every day.

Configuration example

  • Configuration method

    On the DataStudio page, create a node and go to the configuration tab of the node. Click the Properties tab in the right-side navigation pane. In the General section of the Properties tab, configure the scheduling period for the node.

  • Scenario example
    • Configuration details
      • Assume that the import, data transformation, and export tasks are all daily scheduled tasks.
      • These tasks run at 13:00 every day.
      • The data transformation task depends on the import task, and the export task depends on the data transformation task.
      The configuration details for the daily scheduled tasks in this scenario are shown in the following figure.
      Note The cron expression is automatically generated based on the scheduling time that you select and cannot be changed.
      日调度
    • Scheduling details
      The scheduling system automatically generates and runs instances for the tasks. The following figure shows the data timestamp for each business date.生成并运行
      Note
      • A scheduling node runs only if the following conditions are met:
        • The upstream tasks have run successfully.
        • The scheduled time for the node has been reached.
        If either condition is not met, the scheduling node does not run. The conditions are not checked in any specific order.
      • By default, the scheduled time is randomly generated between 00:00 and 00:30.

Scenario: A daily task depends on an hourly or a minute-level task

This section uses a daily task that depends on an hourly task as an example to explain dependencies between daily tasks and hourly or minute-level tasks.
Note DataWorks supports dependencies between upstream and downstream tasks with different scheduling cycles. If the cycles are inconsistent, you must first understand the default rules for attaching dependencies in DataWorks. Then, you can modify the scheduling configuration based on these rules and your business requirements. For more information about complex dependency scenarios in DataWorks, see Principles and examples of scheduling configurations for complex dependency scenarios.

Scenario description: A daily task depends on an hourly task

ScenarioDescription
A daily task depends on all instances of an hourly task (default)By default in DataWorks, a daily task depends on all instances of an upstream hourly or minute-level task that run on the same day. This means the daily task starts to process data only after all instances of the upstream task for that day are complete.
A daily task depends on a specific hourly instanceIf a daily task must depend on a specific hourly or minute-level instance from the same day, you can configure a self-dependency for the hourly or minute-level task. For more information, see Dependency on the previous cycle: This node (self-dependency). The daily task then attaches a dependency to the hourly or minute-level instance that is closest to its own scheduled time, based on the proximity principle.

Effects of setting a self-dependency for hourly or minute-level tasks

  • Before configuring a self-dependency: Each instance of an hourly or minute-level task runs independently.
  • After configuring a self-dependency: The successful execution of the previous instance determines whether the current instance can run.
    Note After a self-dependency is set, the first hourly or minute-level instance of today will depend on the last hourly or minute-level instance of yesterday.
天任务依赖小时任务

Scenario: A daily task aggregates data from an hourly task

Consider a scenario where a daily task depends on an hourly task. If an offset in the scheduling parameters causes the first instance of the hourly task to produce data for the last hour's partition of the previous day, the daily task's dependency shifts. It now needs to depend on the first instance of the hourly task for the current day. In this case, you must set a self-dependency for the hourly task. For more information, see Dependency on the previous cycle: This node (self-dependency). The details are described below.天任务依赖小时任务