> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/release-orchestration/use-release-orchestration/release-orchestration-phases/phase-dependencies.md).

# Phase Dependencies

Phase dependencies control the execution order of phases in a release process. Understanding and properly configuring dependencies is essential for ensuring releases execute in the correct sequence.

### What are Phase Dependencies? <a href="#what-are-phase-dependencies" id="what-are-phase-dependencies"></a>

Phase dependencies define which phases must complete before another phase can start. They ensure:

* Correct execution order
* Prerequisites are met
* Data and artifacts are available
* Validation occurs before deployment

### Dependency Types <a href="#dependency-types" id="dependency-types"></a>

#### Sequential Dependencies <a href="#sequential-dependencies" id="sequential-dependencies"></a>

One phase must complete before another starts:

```yaml
process:
  phases:
    - phase:
        id: build_phase
        name: Build Phase
        depends-on: []
    - phase:
        id: test_phase
        name: Test Phase
        depends-on:
          - build_phase
    - phase:
        id: deploy_phase
        name: Deploy Phase
        depends-on:
          - test_phase
```

**Execution Flow:**

```
Build → Test → Deploy
```

#### Multiple dependencies <a href="#multiple-dependencies" id="multiple-dependencies"></a>

One phase can depend on multiple phases. In the following example, `PhasEnd1` depends on multiple phases:

```yaml
process:
  phases:
    - phase:
        id: PhasEnd1
        name: PhasEnd1
        depends-on:
          - deploy_phase
          - Phase000U
          - test_phase
          - build_phase
```

### Dependency Configuration <a href="#dependency-configuration" id="dependency-configuration"></a>

#### Basic Dependency <a href="#basic-dependency" id="basic-dependency"></a>

Simple dependency declaration:

```yaml
phase:
  id: test_phase
  name: Test Phase
  depends-on:
    - build_phase
```

### Common Dependency Patterns <a href="#common-dependency-patterns" id="common-dependency-patterns"></a>

#### Linear Chain <a href="#linear-chain" id="linear-chain"></a>

Sequential phases in a chain:

```
Phase 1 → Phase 2 → Phase 3 → Phase 4
```

### Best Practices <a href="#best-practices" id="best-practices"></a>

#### Minimize Dependencies <a href="#minimize-dependencies" id="minimize-dependencies"></a>

Only add necessary dependencies:

* **Recommended:** Essential prerequisites
* **Avoid:** Unnecessary blocking

#### Clear Dependency Logic <a href="#clear-dependency-logic" id="clear-dependency-logic"></a>

Make dependencies explicit and understandable:

* Use descriptive phase names
* Document dependency reasons
* Avoid implicit dependencies

#### Optimize for Parallelism <a href="#optimize-for-parallelism" id="optimize-for-parallelism"></a>

Structure dependencies to enable parallel execution:

* Identify independent phases
* Minimize sequential bottlenecks
* Group related dependencies

#### Validate Early <a href="#validate-early" id="validate-early"></a>

Check dependencies during process creation:

* Validate dependency chains
* Detect cycles
* Identify unreachable phases

### Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

#### Phase Not Starting <a href="#phase-not-starting" id="phase-not-starting"></a>

Check:

* All dependencies completed successfully
* No blocking conditions
* Phase is not skipped
* No errors in dependencies

#### Unexpected Execution Order <a href="#unexpected-execution-order" id="unexpected-execution-order"></a>

Verify:

* Dependency configuration
* Conditional logic
* Parallel execution settings
* Phase status

### Related Topics <a href="#related-topics" id="related-topics"></a>

* [Phases Overview](/release-orchestration/use-release-orchestration/release-orchestration-phases/phases-overview.md)
* [Creating Phases](/release-orchestration/use-release-orchestration/release-orchestration-phases/creating-phases.md)
* [Activity Dependencies](/release-orchestration/3.0/activities/activity-dependencies.md)
