Workflow Step Dependency

Definition. The relationship between steps where one requires the output of another, determining the order of execution and the opportunities for parallelism. Explicit dependencies are what allow a workflow to run independent steps concurrently and to resume correctly.

How it works. Declare dependencies explicitly rather than relying on sequence. Execute steps whose dependencies are satisfied in parallel. Validate that the dependency graph is acyclic, since a cycle is a deadlock. Use the graph to determine what can be resumed after a failure, since only steps downstream of the failure need re-running.

Example. A workflow runs six steps sequentially, taking 18 seconds. Declaring dependencies shows that four are independent and only two depend on others. Running the independent steps in parallel reduces the total to 7 seconds. The dependency graph also allows a failure at step five to resume from step five rather than restarting, saving the cost of the first four.

Use case. Dependency declaration is valuable for any workflow with more than a few steps, and it is the basis for parallelism and for efficient resumption. It is also what makes the workflow's structure explicit.

Warnings. An undeclared dependency produces a race condition that appears intermittently. Never assume sequence implies dependency, since it often does not. And never allow a cycle, since it deadlocks.

Limitations. Declaring dependencies requires understanding the data flow, which is not always obvious. Parallelism also increases peak load on downstream systems.

← Browse all glossary terms