The CI/CD Diagram Worth Drawing: Gates, Artifacts and the Way Back

Most CI/CD diagrams show four boxes and an arrow. Here is how to draw the one your team can actually use: triggers, gates, one artifact, environments, approvals and rollback.

DoneDeploy engineering28 November 20268 min read
The CI/CD Diagram Worth Drawing: Gates, Artifacts and the Way Back

Search for a CI/CD diagram and you will find the same picture many times over: code, build, test, deploy, four boxes and an arrow, perhaps with a loop back to “plan”. It is a fine picture for a slide. It is not much use to the engineer who has to work out why a change reached staging but not production, or what happens when a release goes wrong at 6 p.m.

A useful CI/CD diagram answers different questions. What starts a run? What has to pass before anything moves on? Which artifact is deployed, and where was it built? Who approves production, and how do you get back? This post is how we draw that diagram when we review a client’s delivery setup, and what to do when every service turns out to need a different one.

We covered the CI half in detail in The CI Process, Step by Step. Here the subject is the map of the whole path, from push to production and back again.

What the usual diagram leaves out

The four-box diagram is not wrong. It is just missing the parts where things actually break:

  • Triggers. A push to a branch, a pull request, a merge to main, a tag and a nightly schedule usually run different jobs. If the diagram does not say which, nobody can predict what a given event will do.
  • Gates. The point of a pipeline is that some things stop it. A diagram without gates suggests every change flows straight through.
  • The artifact. Is the image deployed to production the one that was tested, or was it rebuilt by another job? This is one of the most common gaps we find, and the four boxes hide it.
  • Environments and promotion. Staging and production are not one “deploy” box. How a change moves from one to the next is the heart of the CD half.
  • People. Somewhere a person reviews code and somewhere a person, or a rule, allows production. Those are part of the process and belong on the map.
  • The way back. Rollback is a path through the system like any other. If it is not drawn, it is usually not practised.

The layers to draw

We draw a CI/CD diagram in layers, each answering one question. You can do it on a whiteboard, in a diagramming tool or as text in the repository; the tool matters much less than the content.

Layer What to draw The question it answers
Triggers Each event and the jobs it starts What runs when I push, open a PR, merge or tag?
Gates Every check that can stop the flow, and its threshold What has to be true before this moves on?
Artifact Where it is built, where it is stored, how it is named Is what we deploy what we tested?
Environments Each environment and the arrow into it How does a change get from staging to production?
Approvals Who or what allows each step, by role Who said yes, and where is that recorded?
Credentials What each stage can access, and how it gets in What could this job touch if it went wrong?
Rollback The path back from each environment How do we undo this, and how long does it take?

The credentials layer is the one most diagrams skip. It is also the one that turns a picture into a security review: if a test job can reach production, the diagram should show it, and then someone should fix it. Our post on secrets management covers how to replace stored keys in pipelines with short-lived credentials.

A diagram with those layers

Here is a typical shape for a containerised service with GitOps, written as text so it can live in the repository next to the pipeline it describes:

 TRIGGER          STAGE                          GATE / OUTPUT
----------------------------------------------------------------------------
pull request --> lint, types, unit tests --> must pass to merge
--> build image once --> image:sha-abc123 in registry
--> integration tests --> must pass to merge
--> secret, dependency and --> blocks above agreed severity
image scans
--> human review --> required approval
|
merge to main ------> |
v
--> update staging manifest --> Argo CD syncs image:sha-abc123
in GitOps repo to STAGING
--> smoke and end to end tests on staging
|
v
release PR --> bump production manifest --> human approves the PR
to the same digest
|
v
Argo CD syncs image:sha-abc123 to PRODUCTION
|
ROLLBACK <-----------+ revert the manifest commit; Argo CD syncs the
previous digest. No rebuild, no hand-run commands.

A few things are visible here that the four-box version hides. The image is built once and the same digest goes all the way through. Production is changed by a reviewed commit, not by a pipeline job holding production credentials. And the way back is drawn as clearly as the way forward: revert a commit, let the GitOps tool sync.

Your diagram will differ. The point is that every arrow says what moves along it, and every box says what can stop it.

Draw it as it is, not as it should be

The most useful version of this diagram is the honest one. Draw what really happens today by reading the pipeline files and the deploy history, not what the team believes happens. The gaps between the two are the findings.

When we review a client’s pipelines, these are the kinds of surprises the honest diagram tends to surface:

  • A deploy job that rebuilds the image instead of promoting the tested one.
  • A check that runs but does not block anything, because it was set to “allow failure” during an incident and never changed back.
  • A production deploy that can only be run from one person’s laptop.
  • A rollback that, once drawn, turns out to be “fix forward and hope”.
  • A pipeline token with far wider access than any stage actually needs.

None of these show up on a four-box diagram. All of them show up the moment you try to draw each arrow with the artifact, the gate and the credentials written next to it.

When every service has its own diagram

Drawing one service’s diagram is an afternoon’s work. The harder discovery comes when you draw the second and third. In many teams each service was set up by whoever built it, so each one has a different pipeline, a different way of tagging images and a different idea of what blocks a merge. You do not have one CI/CD diagram. You have one per service, and they disagree.

That is the problem our platform engineering service is built for. Rather than fixing each pipeline separately, we turn the diagram you want into a golden path: the recommended way to build, test, deploy and monitor a service, delivered as a template with the pipeline, Helm chart and monitoring already in place.

In practice it works like this. Picture a team with several services, each deployed a slightly different way, and a small group of people who are the only ones able to change any of it. The work goes in this order:

  1. Draw what exists. We review the current pipelines and environments and talk to the developers who use them, to find which requests and steps come up most often.
  2. Agree one target diagram. Triggers, gates, a single artifact, the environments, who approves production and the rollback path, written down and agreed with your team.
  3. Turn it into a template. A new service starts from the golden path and gets the agreed pipeline, Helm chart and monitoring on day one. AI drafts the templates; engineers review them, and every change that reaches production is approved by a person.
  4. Move one team first. Existing services move onto the path one at a time, starting with a single team, so the path is tested on real work before anyone else depends on it.
  5. Add preview environments where they help. For changes that are hard to judge from code alone, each pull request can get its own environment on Kubernetes, so reviewers can try the change before it merges.

The result is that the diagram stops being documentation of how things happen to work and becomes the way things are built. When the path changes, it changes in one place, through a pull request, and every service that follows it picks up the change. It is built on the CI, cloud and Kubernetes setup you already have, and the code lives in your Git. Like our other work it is sold as a fixed-price package, agreed after a free first consultation.

A platform does not have to be large. A few templates, one golden path and preview environments may be enough for a small team. If you only have one or two services, a single well-drawn diagram and a tidy pipeline may be all you need, and our CI/CD and GitOps service covers exactly that.

Keep the diagram alive

A diagram drawn once and filed away is wrong within months. A few habits keep it honest:

  • Keep it in the repository, next to the pipeline code, as text or in a format that diffs well.
  • Change it in the same pull request that changes the pipeline. Reviewers should see both.
  • Redraw it after incidents. If a release went wrong in a way the diagram did not predict, the diagram was missing something.
  • Show it to new joiners first. If a new engineer cannot follow a change from push to production with it, it needs work.

The same idea applies if AI agents are part of your delivery process: their path to production should be on the diagram too, and in our setup it is the same pull request path everyone else uses. We explained why in AI Agents in Your Infrastructure.

Where to start

You can do the first useful version this week:

  • Pick your most important service and draw its CI/CD diagram from the pipeline files, with all seven layers.
  • Mark every place where the drawing and the team’s belief disagree.
  • Check one thing in particular: is the artifact in production the exact one that was tested?
  • Draw the rollback path, then try it once in staging.

If you draw two or three services and find they all disagree, that is the moment a golden path pays off. Book a free call and we will look at your diagrams with you.