diagram.mmd — flowchart
CD Pipeline flowchart diagram

A CD (Continuous Delivery/Deployment) pipeline automates the process of delivering a validated build artifact through staging environments and into production, ensuring every release is consistent, auditable, and reversible.

How the pipeline works

The CD pipeline begins once a CI Pipeline successfully publishes a build artifact. The first step is to fetch that artifact from the registry and deploy it to a staging environment — an environment that mirrors production configuration as closely as possible.

In staging, a suite of smoke tests and end-to-end acceptance tests run automatically. These verify that the application starts correctly, key user journeys work, and integrations with downstream services are healthy. If tests fail at this stage, the pipeline halts and the deployment is rolled back in staging before any production traffic is affected.

When staging tests pass, the pipeline pauses at an approval gate. Depending on the team's maturity, this gate may require explicit sign-off from a release manager or automatically proceed if the change is flagged as low-risk. The Deployment Approval Flow covers this decision logic in detail.

Once approved, the artifact is deployed to production. A deployment strategy — blue/green, canary, or rolling — controls how traffic is shifted to the new version. Post-deployment health checks verify that error rates, latency, and key business metrics remain within acceptable thresholds. If metrics degrade, the pipeline triggers an automatic rollback, reverting traffic to the previous version.

Why CD matters

Manual deployments are slow, error-prone, and hard to audit. CD pipelines encode the release process as code, making every deployment traceable and reproducible. Combined with Environment Promotion Flow and Rollback Deployment, CD pipelines give teams the confidence to deploy frequently and safely.

Free online editor
Edit this diagram in Graphlet
Fork, modify, and export to SVG or PNG. No sign-up required.
Open in Graphlet →

Frequently asked questions

A CD (Continuous Delivery/Deployment) pipeline automates the release of a validated build artifact through one or more environments and into production. It handles staging deployment, acceptance testing, approval gating, production rollout, and health-check-driven rollback.
The CD pipeline receives a published artifact from CI, deploys it to staging, runs end-to-end tests, then pauses for an approval gate. Once approved, it deploys to production using a progressive strategy — canary, blue/green, or rolling — and monitors health metrics, triggering automatic rollback if thresholds are breached.
Once your team ships to production more than once per sprint, manual deployment steps become a bottleneck and a source of errors. A CD pipeline is warranted as soon as deployments need to be consistent, auditable, and reversible.
The most common issues are staging environments that differ significantly from production (causing environment-specific failures), approval gates that become rubber-stamp bottlenecks, and missing automated rollback logic that forces manual intervention during incidents.
mermaid
flowchart TD Artifact[Fetch build artifact from registry] --> DeployStage[Deploy to staging environment] DeployStage --> SmokeTests[Run smoke tests] SmokeTests --> E2ETests[Run end-to-end tests] E2ETests --> StageGate{Staging tests passed?} StageGate -->|No| RollbackStage[Rollback staging deployment] StageGate -->|Yes| ApprovalGate{Deployment approved?} RollbackStage --> NotifyFail[Notify team of failure] ApprovalGate -->|No| Hold[Hold for approval] ApprovalGate -->|Yes| DeployProd[Deploy to production] DeployProd --> HealthCheck[Run post-deploy health checks] HealthCheck --> ProdGate{Health checks passed?} ProdGate -->|No| Rollback[Trigger automatic rollback] ProdGate -->|Yes| Monitor[Monitor metrics and alerts] Monitor --> Done[Deployment complete]
Copied to clipboard