Cross-cycle scheduling dependencies let a node's current-cycle instance wait for one or more instances from the previous cycle to succeed before it starts. Use this dependency type when your node needs data produced in an earlier scheduling cycle — for example, when a daily node needs yesterday's output, or when an hourly node must process its own cycles sequentially.
Cross-cycle and same-cycle dependencies serve different purposes. Same-cycle dependencies control execution order *within* a single scheduling run (upstream to downstream). Cross-cycle dependencies control whether a node can start at all until a previous-cycle run succeeds. By default, the automatic parsing feature for same-cycle scheduling dependencies is enabled. After configuring a cross-cycle dependency, check whether the auto-generated same-cycle dependencies are still needed. Remove them if not, or the node may be blocked unexpectedly.
Cross-cycle dependencies appear as dashed lines in the directed acyclic graph (DAG) of a node. After configuration, deploy the node and its ancestor nodes to the production environment to view the dependencies in Operation Center.
Cross-cycle dependency types
DataWorks provides three cross-cycle dependency types:
| Dependency type | Use when |
|---|---|
| Self-dependency — current node's previous-cycle instance | The node must process its own cycles sequentially. The current-cycle instance needs data from the same node's previous-cycle run. |
| Level-1 descendant dependency — level-1 descendant nodes' previous-cycle instances | The current-cycle instance needs to confirm that its own previous-cycle output table data was already cleansed by level-1 descendant nodes. |
| Specified node dependency — one or more specified nodes' previous-cycle instances | The current-cycle instance depends on another node's previous-cycle output based on business logic, and that dependency is not expressed in the code. |
Add a cross-cycle dependency
In Data Studio, open the configuration tab of the node to configure. In the right-side panel, click the Properties tab, then go to Scheduling Dependencies > Node Dependencies > Add Dependency. Set Dependency Type to the appropriate cross-cycle option, search for the ancestor node by name, output name, or scheduling task ID, and click Add.
Click Save after adding all dependencies.
Self-dependency
Use self-dependency when the current-cycle instance depends on the latest data produced by the same node in the previous cycle. This ensures the node's cycles run sequentially — each cycle starts only after the previous one succeeds.
Behavior by schedule type:
-
Hourly node: The current-hour instance waits for the previous-hour instance to succeed.
-
Daily node: The current-day instance waits for the previous-day instance to succeed.
Configure self-dependency:
-
In Data Studio, open the configuration tab of Node A. Click the Properties tab, then click Scheduling Dependencies.
-
In the Node Dependencies section, click Add Dependency. Set Dependency Type to Cross-cycle Self Dependency, then click Add. DataWorks adds the previous-cycle instance of Node A as an ancestor dependency.
-
Click Save.
The running results of instances generated for a node scheduled by hour in different scheduling cycles and those generated for a node scheduled by day in different scheduling cycles affect each other.
Effect of self-dependency on a dependent daily node:
If a daily node depends on an hourly or minute-level node, whether self-dependency is enabled on the hourly or minute-level node changes which instance the daily node waits for:
-
Hourly/minute node without self-dependency: The daily node waits for *all* hourly or minute-level instances on the current day. Use this when the daily node aggregates all of the day's data.
-
Hourly/minute node with self-dependency: The daily node depends on only *one specific* hourly or minute-level instance — the one whose scheduling time is closest to the daily node's scheduling time, based on the principle of scheduling time proximity.
For more detail, see Complex dependency scenarios.
Level-1 descendant dependency
Use this dependency type when the current-cycle instance needs to confirm that its own previous-cycle output table data was already cleansed by level-1 descendant nodes before it runs again.
The current-cycle instance waits for the level-1 descendant nodes' previous-cycle instances to succeed before it starts.
How the dependency chain works (example with nodes A, B, C):
| Instance | Reads from | Writes to |
|---|---|---|
| Instance C1 (T-2 cycle) | Output tables of Instances A and B in the T-2 partition | Table C1 in the T-1 partition |
| Instances A1 and B1 (T-1 cycle) | Instance C1's output table on T-1 | Tables A1 and B1 on T-1 |
| Instance C2 (T-1 cycle) — starts only after A1 and B1 succeed | Output tables of Instances A1 and B1 in the T-1 partition | Table C2 in the T partition |
| Instances A2 and B2 (T cycle) | Instance C2's output table on T | Tables A2 and B2 on T |
Configure level-1 descendant dependency:
-
In Data Studio, open the configuration tab of Node C. Click the Properties tab, then click Scheduling Dependencies.
-
In the Node Dependencies section, click Add Dependency. Set Dependency Type to Cross-cycle Dependency on Level-1 Descendant Node. DataWorks automatically identifies candidate ancestor nodes based on the latest code. Select Nodes A and B as the ancestor nodes.
-
Click Save.
Specified node dependency
Use this dependency type when the current-cycle instance depends on another node's previous-cycle output based on business logic, and that dependency is not reflected in the code.
The current-cycle instance waits for one or more specified nodes' previous-cycle instances to succeed before it starts.
Example: Node C has two descendant nodes, A and B. Node B in the current cycle (T) must wait for Node D's previous-cycle instance (T-1) to succeed. Node D is outside the workflow formed by Nodes A, B, and C.
Configure specified node dependency:
-
In Data Studio, open the configuration tab of Node B. Click the Properties tab, then click Scheduling Dependencies.
-
In the Node Dependencies section, click Add Dependency. Configure the following:
-
Dependency Type: Cross-cycle Dependency
-
Ancestor Object: Name — select Node D
-
-
Select Node D as the ancestor node of Node B, then click Save.
What's next
Before deploying to the production environment, preview the scheduling dependencies to confirm they behave as expected. For details, see Appendix: Use the features provided in a DAG and Check whether the scheduling dependencies meet your expectations.
Related topics: