> 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

Learn how to configure dependencies between phases to control execution order

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 you will learn from this topic

* Understand [phase dependencies](#what-are-phase-dependencies) and the types of dependencies you can configure.
* How to [configure a dependency](#dependency-configuration) between phases in process YAML.
* How to apply [common dependency patterns](#common-dependency-patterns) and best practices.
* How to troubleshoot a phase that does not start or executes out of order.

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

Phase dependencies define which phases must be completed 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**

One phase must be completed 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**

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**

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**

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**

Only add necessary dependencies:

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

**Clear dependency logic**

Make dependencies explicit and understandable:

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

**Optimize for parallelism**

Structure dependencies to enable parallel execution:

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

**Validate early**

Check dependencies during process creation:

* Validate dependency chains
* Detect cycles
* Identify unreachable phases

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

<details>

<summary>Phase not starting</summary>

Check the following:

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

</details>

<details>

<summary>Unexpected execution order</summary>

Verify the following:

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

</details>

## Next steps

* [Phases Overview](/release-orchestration/use-release-orchestration/release-orchestration-phases/phases-overview.md): Learn how phases structure a release process.
* [Creating Phases](/release-orchestration/use-release-orchestration/release-orchestration-phases/creating-phases.md): Learn how to create and configure phases.
* [Activity Dependencies](/release-orchestration/use-release-orchestration/release-orchestration-activities/activities-overview.md#activity-dependencies-and-execution-order): Learn how dependencies work at the activity level.

{% @harness-feedback/feedback %}
