PlantUML Activity Diagram: CI/CD Pipeline Visualization

Visualize CI/CD pipeline stages with PlantUML activity diagrams. Model build, test, deploy stages with parallel jobs, gates, and rollback paths.

Activity Diagrams

Detailed Explanation

CI/CD Pipeline Visualization with Activity Diagrams

Activity diagrams are an excellent way to document CI/CD pipelines because they naturally support sequential stages, parallel jobs, and conditional gates.

Basic Pipeline

@startuml
title CI/CD Pipeline

start

:Checkout source code;

partition "Build Stage" {
  fork
    :Build frontend;
  fork again
    :Build backend;
  fork again
    :Build Docker images;
  end fork
}

partition "Test Stage" {
  fork
    :Unit tests;
  fork again
    :Integration tests;
  fork again
    :E2E tests;
  end fork
}

if (All tests passed?) then (yes)
  partition "Deploy to Staging" {
    :Deploy to staging;
    :Run smoke tests;
  }
else (no)
  :Notify team via Slack;
  stop
endif

if (Manual approval?) then (approved)
  partition "Deploy to Production" {
    :Blue-green deploy;
    :Health check;
    if (Health check OK?) then (yes)
      :Switch traffic;
    else (no)
      :Rollback;
      :Alert on-call;
    endif
  }
else (rejected)
  :Log rejection;
  stop
endif

:Update deployment dashboard;
stop

@enduml

Key Patterns

Parallel Jobs: Use fork/fork again/end fork for jobs that run concurrently in the same pipeline stage.

Partitions: Group related activities with partition "Stage Name" { ... } to visually separate pipeline stages.

Gates: Model manual approval gates with if blocks. Include both the approval and rejection paths.

Rollback: Always document the rollback path. This is the most valuable part of the diagram for incident response.

Colors and Styling

skinparam partition {
  BackgroundColor LightBlue
  BorderColor DarkBlue
}

skinparam activity {
  BackgroundColor White
  BorderColor Black
}

Color-coding partitions by environment (blue for staging, green for production) helps readers quickly identify where in the pipeline a given activity occurs.

Use Case

Documenting CI/CD pipelines for new team members, creating runbooks for deployment procedures, presenting pipeline architecture to engineering leadership, and designing rollback strategies for production deployments.

Try It — PlantUML Editor

Open full tool