CI/CD Diagram Guide

How to draw a CI/CD pipeline diagram: one artifact, five stages, under twenty five nodes

By the engineer who builds Datadef, from client work on data platforms · Reviewed August 21, 2026

A CI/CD pipeline diagram becomes readable when it follows one artifact along one path: the event that starts it, the stages it passes, the environments it lands in, and the gates that can stop it. Draw that first. Every second pipeline, every matrix leg, every nightly job is a separate diagram or a note, not more boxes on this one. The method below takes about twenty minutes and produces something an on-call engineer can use at 3am.

7 min readFor engineers asked to put the pipeline on a page by Thursday

See it as a diagram

Everything below, as a diagram you can edit. Describe yours and see it in seconds.

226/20003 credits left
Try:

No account needed · Editable canvas, not a picture

Decide the artifact and the trigger before you draw anything

Two questions settle most of the layout. What single thing moves through this pipeline, and what makes it start. The artifact is usually a container image, a versioned package, or a bundle. Naming it forces the diagram to be about promotion rather than about tasks, and promotion is what readers ask about: what is running in production, and how did it get there.

The trigger belongs on the left edge with the event named, not the vendor. Push to main, tag matching v*, pull request opened, schedule at 02:00 UTC, manual dispatch. A diagram that opens with a tool logo tells you who sells the runner. A diagram that opens with "push to main" tells you when the thing happens, which is the question people actually arrive with.

If your answer to the first question is "three different things", you have three diagrams. A monorepo that builds an API image, a web bundle, and a Terraform plan should not draw all three in one frame. The shared prefix (checkout, install, lint) is the only part they have in common, and it is the least interesting part of any of them.

The five stages, left to right, with the artifact as an object

Source, build, test, publish, deploy. Almost every pipeline in production is a variation on those five. Left to right beats top to bottom because promotion already reads as rightward movement in every other diagram your team owns, and because gates sit naturally between columns.

Make the artifact a shape, not a label on an arrow. A build stage that produces ghcr.io/acme/api:sha-9f2c1a deserves its own node, because the registry is the join between the CI half and the CD half of the picture. When an incident asks which image is in production, the diagram needs a place to point at.

Test is one stage, not five. Unit, contract, integration, and end to end runs belong inside one node with the list underneath, unless they run in different environments or gate different things. The exception earns its own box: a security scan that can block the publish is a gate, so draw it as a gate rather than as another test.

# .github/workflows/release.yml, trimmed to what the diagram shows
on:
  push:
    branches: [main]

jobs:
  build:            # node: Build image
    outputs:
      image: ghcr.io/acme/api:${{ github.sha }}
  test:             # node: Test suite (unit, contract, integration)
    needs: build
  publish:          # node: Registry, the artifact object itself
    needs: test
  deploy-staging:   # node inside the Staging zone
    needs: publish
    environment: staging
  deploy-prod:      # node inside the Production zone, behind a gate
    needs: deploy-staging
    environment: production   # the approval lives here: draw it as a gate

Flow or sequence: pick the shape that answers the question being asked

A flow diagram answers "what happens next". Stages as boxes, arrows for progression, gates as decision shapes. It is the right form for onboarding, for the header of a runbook, and for any reader who does not know which system owns which step, because it maps to time rather than to ownership.

A sequence diagram answers "who calls whom". Lifelines for the git host, the CI runner, the artifact registry, the secret store, and the target cluster, with messages between them. Reach for it when the interesting failure is a handoff: an OIDC token exchange that expires mid-deploy, a self-hosted runner that cannot reach a private registry, a webhook that fires twice. A flow diagram will never reveal that credentials are fetched at deploy time rather than at build time.

Most teams need the flow diagram on the wiki and the sequence diagram in the security review. Drawing both is cheaper than arguing about which single diagram serves both audiences, and the two only need to agree on stage names.

Keep it under twenty five nodes, then split by axis

A pipeline diagram stops working somewhere around thirty shapes, which is roughly where readers start scanning instead of reading. Twelve to twenty five nodes covers a real pipeline including environments and gates. Past that, split rather than shrink the font.

That number is not only taste. Datadef enforces the same budget in code when it draws infrastructure from a repository: a module zone holds at most eight nodes before its remainder collapses into one counted node, and the whole canvas targets forty. Run against a real Azure platform of 123 declared resources and 30 data lookups spread over five stacks, the curation produced 36 nodes in 12 zones, with the largest zone holding nine. A delivery pipeline is a smaller subject than a cloud platform, so a pipeline diagram that needs more than thirty shapes is almost always two diagrams.

Three splits work. By artifact, one diagram per deployable. By half, a CI diagram that ends at the registry and a CD diagram that starts there, with the same artifact node drawn in both so the seam is obvious. By altitude, one overview for the wiki and one detailed view per stage for the team that owns that stage.

Collapse repetition instead of drawing it. A matrix that builds three architectures is one node reading "build, matrix: amd64, arm64, armv7". GitHub caps a single matrix at 256 jobs per workflow run, which is the upper bound on how many identical boxes a faithful drawing could contain, and the only part of those 256 that carries information is the number. Twelve services deployed by the same reusable workflow is one node with the count, not twelve identical lanes. In the Datadef editor those become a zone with a count, and the full list stays in the accompanying doc rather than on the canvas.

A first draft beats a blank canvas

Describe the pipeline in one paragraph, naming the trigger, the artifact, and the gates, and generate the first pass. Correcting a wrong diagram takes minutes, while starting from an empty grid takes an afternoon. The result stays editable, so the draft is a starting point rather than a fixed image. See templates for a shape to start from.

FAQ

What should a CI/CD pipeline diagram show?

One artifact moving through five stages: source, build, test, publish, deploy. Add the trigger event on the left edge, the environments the artifact lands in, and every gate that can stop it. Individual shell commands, linter names, and per-step durations belong in the pipeline config and the run log, not on the diagram.

Should a CI/CD diagram be a flowchart or a sequence diagram?

Use a flowchart when the question is what happens next: stages, arrows, gates as decision shapes. Use a sequence diagram when the question is who calls whom: lifelines for the git host, the runner, the registry, the secret store, and the deploy target. Onboarding and runbooks want the flowchart, while security reviews and handoff debugging want the sequence.

How many stages should a CI/CD pipeline diagram have?

Five is the usual answer: source, build, test, publish, deploy. Teams that separate delivery from deployment add a release stage between publish and deploy. Going past seven stages normally means steps inside a stage were promoted to stages, which makes the diagram longer without making it clearer.

How do I diagram a pipeline that deploys many services?

Draw the pipeline once and put the multiplicity on a single node, for example "deploy, 12 services via the shared reusable workflow". Parallel lanes multiply shapes without adding information, because the lanes are identical by construction, and a GitHub Actions matrix alone can expand to 256 jobs in one run. Keep the service list in the accompanying document instead.

What tool should I use to draw a CI/CD pipeline diagram?

Any tool that keeps the diagram editable and lets it be regenerated cheaply. A diagram drawn once in a general drawing app and exported as a static image is accurate for roughly one sprint. Tools that generate from a description or from the repository, and that publish an embed URL the README points at, survive the next pipeline change.