Basic Concept
A dependency is a requirement that one or more nodes must complete before another node can start.Dependency Types
No Dependencies (Root Nodes)
Nodes with nodepends_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
step_1: No dependencies → runs firststep_2: Implicitly depends onstep_1step_3: Implicitly depends onstep_2
Parallel Container (No Implicit Dependencies)
analyze_a,analyze_b,analyze_call run in parallel- Each only depends on what’s explicitly stated
Complex Dependency Patterns
Diamond Pattern
- Tick 1:
fetch_dataruns - Tick 2:
analyzeandsearchrun in parallel - Tick 3:
synthesizeruns (after both complete)
Tree Pattern
Loop Dependencies
Loop nodes wait for their dependencies and create iteration outputs:- Loop runs for each URL item in parallel
- Each iteration:
fetch→analyze - After all iterations:
aggregatenode 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_aandnode_bcomplete →node_ccan start - ❌ If only
node_acompletes →node_cwaits fornode_b - ❌ If
node_afails →node_cis skipped (blocked)
Rule 2: No Circular Dependencies
Workflows are directed acyclic graphs (DAGs). Circular dependencies are invalid.Rule 3: Parent Waits for Children
Container nodes (parallel, sequential, loop) wait for all their child nodes to complete.after_parentdoesn’t start untilchild_1ANDchild_2complete
Dependency Patterns by Use Case
Sequential Processing
Use case: Each step uses output of previous stepsequential container:
Parallel Processing
Use case: Multiple independent analysesdepends_on).
Fan-Out / Fan-In
Use case: One source → multiple analyses → one resultConditional Execution with Loops
Use case: Process array items, aggregate resultsDebugging Dependencies
Check Execution Order
Get execution logs to see dependency satisfaction:status: COMPLETED, RUNNING, PENDING, FAILED, SKIPPEDstarted_at: When the node startedcompleted_at: When it finished
Visualize Dependencies
For complex workflows, list your nodes:Common Mistakes
Mistake 1: Forgotten Dependency
Mistake 2: Circular Dependencies
Mistake 3: Depending on Container Output Before Completion
Best Practices
✅ DO:- Use explicit
depends_onfor clarity - Use
sequentialcontainer for linear workflows - Use
parallelcontainer for independent tasks - Document complex dependency patterns
- Validate workflows before execution
- Create circular dependencies
- Forget dependencies (causing race conditions)
- Over-specify dependencies (limiting parallelism)
- Assume nodes run in definition order
Next Steps
- Execution Variables - Access node outputs in dependencies
- Node Types - Learn about parallel/sequential containers
- What is a Workflow - See workflow examples