Skip to main content
Dependencies determine the execution order in workflows. They define which nodes must complete before a node can start, creating the structure of your directed acyclic graph (DAG).

Basic Concept

A dependency is a requirement that one or more nodes must complete before another node can start.
Execution Flow:

Dependency Types

No Dependencies (Root Nodes)

Nodes with no depends_on execute immediately:

Single Dependency

A node depending on one other node:

Multiple Dependencies

A node waiting for several nodes:

Implicit Dependencies

Sequential containers create automatic dependencies between siblings:

Sequential Container Example

Implicit dependencies created:
  • step_1: No dependencies → runs first
  • step_2: Implicitly depends on step_1
  • step_3: Implicitly depends on step_2
Equivalent explicit form:

Parallel Container (No Implicit Dependencies)

No implicit dependencies:
  • analyze_a, analyze_b, analyze_c all run in parallel
  • Each only depends on what’s explicitly stated

Complex Dependency Patterns

Diamond Pattern

Implementation:
Execution:
  • Tick 1: fetch_data runs
  • Tick 2: analyze and search run in parallel
  • Tick 3: synthesize runs (after both complete)

Tree Pattern

Implementation:

Loop Dependencies

Loop nodes wait for their dependencies and create iteration outputs:
Execution:
  • Loop runs for each URL item in parallel
  • Each iteration: fetchanalyze
  • After all iterations: aggregate node runs

Execution Order Rules

Rule 1: All Dependencies Must Be Satisfied

A node only starts when all its dependencies have completed successfully.
  • ✅ If both node_a and node_b complete → node_c can start
  • ❌ If only node_a completes → node_c waits for node_b
  • ❌ If node_a fails → node_c is skipped (blocked)

Rule 2: No Circular Dependencies

Workflows are directed acyclic graphs (DAGs). Circular dependencies are invalid.
Error: Workflow validation will reject this.

Rule 3: Parent Waits for Children

Container nodes (parallel, sequential, loop) wait for all their child nodes to complete.
  • after_parent doesn’t start until child_1 AND child_2 complete

Dependency Patterns by Use Case

Sequential Processing

Use case: Each step uses output of previous step
Or use sequential container:

Parallel Processing

Use case: Multiple independent analyses
All run simultaneously (no explicit depends_on).

Fan-Out / Fan-In

Use case: One source → multiple analyses → one result

Conditional Execution with Loops

Use case: Process array items, aggregate results

Debugging Dependencies

Check Execution Order

Get execution logs to see dependency satisfaction:
Each log shows:
  • status: COMPLETED, RUNNING, PENDING, FAILED, SKIPPED
  • started_at: When the node started
  • completed_at: When it finished
PENDING nodes are waiting for dependencies.

Visualize Dependencies

For complex workflows, list your nodes:
Dependency graph:

Common Mistakes

Mistake 1: Forgotten Dependency

Fix: Add explicit dependency

Mistake 2: Circular Dependencies

Fix: Remove circular reference and use proper DAG structure.

Mistake 3: Depending on Container Output Before Completion

Actually this is correct - container nodes automatically wait for all children.

Best Practices

DO:
  • Use explicit depends_on for clarity
  • Use sequential container for linear workflows
  • Use parallel container for independent tasks
  • Document complex dependency patterns
  • Validate workflows before execution
DON’T:
  • Create circular dependencies
  • Forget dependencies (causing race conditions)
  • Over-specify dependencies (limiting parallelism)
  • Assume nodes run in definition order

Next Steps