Skip to main content

PlantUML Activity Diagrams

This page tests the English A11y descriptions for activity diagrams, including decision points, partitions, loops, and parallel execution.

Simple activity diagram with decision point

Graphviz installation check

PlantUML source for "Graphviz installation check"
@startuml

start

if (Graphviz installed?) then (yes)
:process all\ndiagrams;
else (no)
:process only
__sequence__ and __activity__ diagrams;
endif

stop

@enduml

Activity diagram with 2 activities and 1 decision point.

Flow:

  • Start
  • Decision: Graphviz installed?
  • - Yes: Step. process all diagrams
  • - No: Step. process only sequence and activity diagrams
  • Stop

Activity diagram with partitions

Partitions group related activities into named sections with letter-prefixed step numbering:

Software Development Lifecycle

PlantUML source for "Software Development Lifecycle"
@startuml
!theme plain
title Software Development Lifecycle

start
:Gather requirements;

partition "A: Analysis" {
:Identify stakeholders;
:Create user stories;
:Define acceptance criteria;
}

partition "B: Design" {
:Create domain model;
:Design architecture;
:Review with team;
}

partition "C: Implementation" {
:Write code;
:Write tests;
:Code review;
}

stop
@enduml

Activity diagram with 3 partitions and 10 activities.

Flow:

  • Start
  • Step. Gather requirements
  • Partition A: Analysis, consisting of:
  • Step. Identify stakeholders
  • Step. Create user stories
  • Step. Define acceptance criteria
  • End partition A.
  • Partition B: Design, consisting of:
  • Step. Create domain model
  • Step. Design architecture
  • Step. Review with team
  • End partition B.
  • Partition C: Implementation, consisting of:
  • Step. Write code
  • Step. Write tests
  • Step. Code review
  • End partition C.
  • Stop

Activity diagram with while loop

A while loop repeats activities as long as a condition is true:

Data processing loop

PlantUML source for "Data processing loop"
@startuml
start
while (data available?) is (yes)
:read data;
:process data;
endwhile (no)
stop
@enduml

Activity diagram with 2 activities.

Flow:

  • Start
  • Repeat while data available? (yes), consisting of:
  • Step. read data
  • Step. process data
  • End repeat.
  • Stop

Activity diagram with repeat/repeat while (do-while loop)

A repeat loop executes activities at least once, then checks the condition:

Item processing with repeat

PlantUML source for "Item processing with repeat"
@startuml
start
:initialize;
repeat
:process item;
:check result;
repeat while (more items)
:finalize;
stop
@enduml

Activity diagram with 4 activities.

Flow:

  • Start
  • Step. initialize
  • Repeat while more items, consisting of:
  • Step. process item
  • Step. check result
  • End repeat.
  • Step. finalize
  • Stop

Activity diagram with fork/join (parallel activities)

Fork and join show activities that execute in parallel:

Parallel task execution with fork

PlantUML source for "Parallel task execution with fork"
@startuml
start
:Prepare;
fork
:Task A;
fork again
:Task B;
end fork
:Finalize;
stop
@enduml

Activity diagram with 4 activities.

Flow:

  • Start
  • Step. Prepare
  • Parallel execution 1, consisting of:
  • Branch 1:
  • Step. Task A
  • Branch 2:
  • Step. Task B
  • End parallel execution 1.
  • Step. Finalize
  • Stop

Activity diagram with split (parallel activities)

Split is an alternative syntax for parallel execution:

Parallel task execution with split

PlantUML source for "Parallel task execution with split"
@startuml
start
:Prepare;
split
:Task A;
split again
:Task B;
end split
:Finalize;
stop
@enduml

Activity diagram with 4 activities.

Flow:

  • Start
  • Step. Prepare
  • Parallel execution 1, consisting of:
  • Branch 1:
  • Step. Task A
  • Branch 2:
  • Step. Task B
  • End parallel execution 1.
  • Step. Finalize
  • Stop

Activity diagram with partitions without letter prefix

When partition names don't start with a letter prefix like "A:", steps get plain numbering that resets per partition:

Research workflow

PlantUML source for "Research workflow"
@startuml
start
partition "Gather information" {
:find sources;
:read documents;
}
partition "Write up" {
:create design;
:implement;
}
stop
@enduml

Activity diagram with 2 partitions and 4 activities.

Flow:

  • Start
  • Partition: Gather information, consisting of:
  • Step. find sources
  • Step. read documents
  • End partition.
  • Partition: Write up, consisting of:
  • Step. create design
  • Step. implement
  • End partition.
  • Stop

Combined: partitions with loops and decisions

A more complex diagram combining multiple constructs:

Sprint workflow

PlantUML source for "Sprint workflow"
@startuml
!theme plain
title Sprint Workflow

start
:Sprint planning;

partition "A: Development" {
:Pick user story;
while (story tasks remaining?) is (yes)
:implement task;
:write tests;
endwhile (no)
:create pull request;
}

partition "B: Review" {
if (review approved?) then (yes)
:merge to main;
else (no)
:address feedback;
endif
}

:Sprint retrospective;
stop
@enduml

Activity diagram with 2 partitions and 8 activities and 1 decision point.

Flow:

  • Start
  • Step. Sprint planning
  • Partition A: Development, consisting of:
  • Step. Pick user story
  • Repeat while story tasks remaining? (yes), consisting of:
  • Step. implement task
  • Step. write tests
  • End repeat.
  • Step. create pull request
  • End partition A.
  • Partition B: Review, consisting of:
  • Decision: review approved?
  • - Yes: Step. merge to main
  • - No: Step. address feedback
  • End partition B.
  • Step. Sprint retrospective
  • Stop

About Activity Diagram Support

Activity diagrams support the following constructs:

  • Decision points (if/else/endif) - shown as decisions with yes/no branches
  • Partitions (partition "name" { ... }) - group activities with labeled sections
  • While loops (while/endwhile) - repeat while condition is true
  • Repeat loops (repeat/repeat while) - do-while: execute at least once
  • Fork/join (fork/fork again/end fork) - parallel execution
  • Split (split/split again/end split) - alternative parallel syntax
  • Notes (note right:) - ignored in accessible description (visual only)