Mermaid exampleFlowchart

CI/CD Pipeline Flowchart: Commit to Production

A CI/CD pipeline flowchart shows every gate a change passes between a developer pushing a commit and users seeing it in production. Platform teams put this diagram in onboarding docs so new engineers know why a merge can sit for twenty minutes, and release managers use it to agree on where the manual approval belongs.

  • ci cd pipeline diagram
  • deployment pipeline flowchart
  • mermaid pipeline
  • devops flowchart
  • release process diagram
CI/CD Pipeline Flowchart: Commit to Production

pass

fail

pass

fail

yes

no

fail

pass

Push commit

Lint and unit tests

Build image

Notify author

Deploy to staging

Integration tests

Approve release?

Deploy to production

Hold in staging

Smoke tests

Roll back

Done

Open in editor → 14 linesrenders in GitHub, Notion, Obsidian

Mermaid code

flowchart LR
    A[Push commit] --> B[Lint and unit tests]
    B -->|pass| C[Build image]
    B -->|fail| X[Notify author]
    C --> D[Deploy to staging]
    D --> E[Integration tests]
    E -->|pass| F{Approve release?}
    E -->|fail| X
    F -->|yes| G[Deploy to production]
    F -->|no| H[Hold in staging]
    G --> I[Smoke tests]
    I -->|fail| J[Roll back]
    I -->|pass| K[Done]
    X --> A

Paste this into any tool that renders Mermaid, or into the editor to change the theme and export PNG or SVG. Syntax reference: Flowchart guide.

What this diagram shows

Read this one left to right. Lint and unit tests is the first gate; a failure goes straight to Notify author and loops back to a new push. The Approve release? diamond is the only human step. After Deploy to production, Smoke tests decides between Done and Roll back, so a bad deploy has an explicit exit instead of an implied one.

A flowchart beats a sequence diagram here because the pipeline is about stages and decisions, not about which system talks to which. The horizontal LR layout matches how pipeline UIs draw stages, so the diagram and the tooling look alike.

How to adapt it

  • Rename the stage nodes to match your pipeline definition, for example Build image to Compile and package for non-container projects.
  • Add a Security scan node between Build image and Deploy to staging if you run dependency or container scanning.
  • Remove the Approve release? diamond and connect Integration tests directly to Deploy to production for a continuous deployment setup.
  • Group stages with subgraph CI ... end and subgraph CD ... end to show which part runs on every push and which part runs on merge to main.
  • Change flowchart LR to flowchart TD if you embed the diagram in a narrow document column.

FAQ

How do I show that some stages run in parallel?

Fan out from one node to several, then fan back in. For example C --> D1[Unit tests] and C --> D2[Lint], with both pointing to the next stage. Mermaid draws them side by side.

Why does the failure path point back to the first node?

Because a failed check ends with a new commit, not a retry of the same one. The X --> A edge makes that loop visible. If your pipeline supports re-running a failed job, point the edge at the stage that failed instead.

Can the diamond have more than two outcomes?

Yes. A decision node accepts any number of outgoing edges; label each with -->|text|. Three outcomes such as approve, reject, and defer are common for release gates.