---
sidebar_label: Lifecycle
doc_id: 90182c6e-9d53-44a1-9b83-4365e6c0b975
description: >-
  Guide explaining deployment lifecycle stages and rollout strategies from
  creation through completion or rollback.
keywords:
  - deployment lifecycle
  - rollout strategies
  - deployment status
  - rollback
  - nullplatform
---

# Deployment lifecycle and flow

This guide explains what happens after a deployment is created, from initialization through rollout and rollback.

## Lifecycle stages

Each deployment progresses through a series of statuses:

| Status                     | Description                                                       |
| -------------------------- | ----------------------------------------------------------------- |
| `creating_approval`        | Waiting for approval before the deployment can be created.        |
| `creating_approval_denied` | The request to create the deployment was denied.                  |
| `creating`                 | The deployment is being created.                                  |
| `waiting_for_instances`    | The deployment is initializing instances.                         |
| `running`                  | The deployment is up and running.                                 |
| `finalizing`               | The deployment is wrapping up final steps.                        |
| `finalized`                | The deployment is complete and stable.                            |
| `cancelling`               | The deployment is being canceled.                                 |
| `cancelled`                | The deployment was successfully canceled.                         |
| `failed`                   | Something went wrong, and the deployment failed.                  |
| `rolling_back`             | The deployment is being rolled back to a previous stable version. |
| `rolled_back`              | The rollback is complete.                                         |
| `deleting`                 | The deployment is being deleted.                                  |
| `deleted`                  | The deployment was successfully deleted.                          |

## Built-in rollout strategies

Nullplatform supports two primary deployment strategies.

### Initial deployment

Used when the scope has no previous deployments.

Steps:

- Provision infrastructure
- Wait for instance readiness
- Mark the deployment as `RUNNING` and then `FINALIZED`


### Blue-green deployment

Used when replacing an existing deployment. This strategy:

- Provisions a new environment ("green")
- Gradually shifts traffic from the existing deployment ("blue")
- Allows rollback if needed (manual or automatic)


### Strategy diagram

```mermaid
graph LR
    subgraph Blue-Green strategy
    AA[New deployment] --> BB[Create new infrastructure]
    BB --> CC[Wait for instances]
    CC --> DD[Running/Traffic switch]
    DD --> EE[Traffic validation]
    EE -->|Success| FF[Finalized]
    EE -->|Failure| GG[Rolled back]
    end

    subgraph Initial deployment strategy
    A[New deployment] --> B[Create initial infrastructure]
    B --> C[Wait for instances]
    C --> D[Running]
    D --> E[Finalized]
    end

    classDef accent fill:#111827,stroke:#0b172a,color:#e2e8f0;
    classDef success fill:#0f766e,stroke:#0b5f59,color:#f8fafc;
    classDef danger fill:#b91c1c,stroke:#7f1d1d,color:#f8fafc;
    class A,AA accent
    class FF,E success
    class GG danger
```

### Strategy data

When interacting with deployments via API or telemetry, the `strategy_data` object tracks the current rollout state.

| Field                      | Type    | Description                                          |
| -------------------------- | ------- | ---------------------------------------------------- |
| `switched_traffic`         | integer | Current percentage of traffic on new version (0-100) |
| `desired_switched_traffic` | integer | Target traffic percentage for new version            |
| `amount_instances_to_wait` | integer | Required number of instances before proceeding       |
| `healthy_instances`        | integer | Current count of healthy instances                   |
| `launched_instances`       | integer | Total instances launched                             |
| `switch_traffic_step`      | boolean | Indicates active traffic switching phase             |

### Defining your own strategies

You can define custom strategies in the UI using **Platform Settings > Deployment Strategies**.

For details, see [Deployment strategies](/docs/deployments/strategies).
