Dev Studio Open tools

The difference between sequence diagrams and activity diagrams

By Nexo Design · Published 22 November 2026 · 3 min read

Sequence diagrams and activity diagrams both describe behaviour, and both are part of UML, so they're easy to confuse. The short version: a sequence diagram shows who talks to whom, and in what order; an activity diagram shows what steps happen, and under which conditions.

The clearest way to see the difference is to draw the same scenario both ways.

The same scenario, drawn twice

Scenario: a customer checks out, the shop reserves stock, charges the card, and either confirms the order or releases the stock if payment fails.

As a sequence diagram

PlantUML · sequenceOpen in Sequence Diagram
@startuml
actor Customer
participant Shop
participant Inventory
participant Payments

Customer -> Shop: Checkout
Shop -> Inventory: Reserve items
Inventory --> Shop: Reserved
Shop -> Payments: Charge card
alt approved
  Payments --> Shop: Charge ID
  Shop --> Customer: Order confirmed
else declined
  Payments --> Shop: Declined
  Shop -> Inventory: Release items
  Shop --> Customer: Payment failed
end
@enduml
Sequence diagram of checkout: Customer, Shop, Inventory and Payments exchange messages, with an alt block for approved and declined payment
The sequence view: messages between participants over time

As an activity diagram

PlantUML · activityOpen in Activity Diagram
@startuml
start
:Customer checks out;
:Reserve items;
:Charge card;
if (Payment approved?) then (yes)
  :Confirm order;
else (no)
  :Release items;
  :Show payment error;
endif
stop
@enduml
Activity diagram of checkout: start, reserve items, charge card, a decision on whether payment was approved, then confirm the order or release items and show an error, then stop
The activity view: steps and decisions, regardless of who performs them

The sequence diagram tells you that the Shop is the one coordinating, and exactly which messages travel between systems. The activity diagram hides those details and makes the decision point and the two outcomes much easier to see at a glance.

Side-by-side comparison

AspectSequence diagramActivity diagram
Main questionWho interacts with whom, in what order?What steps happen, and when do they branch?
LayoutParticipants across the top, time flowing downSteps flowing from start to end
Main elementsParticipants, lifelines, messages, activationsActions, decisions, merges, forks, swimlanes
Branchingalt, opt and loop blocks; becomes crowded quicklyNative and easy to read
Parallel workpar blocksFork and join bars
Best audienceDevelopers building or integrating the systemsDevelopers, analysts and business stakeholders
Typical usesAPI calls, authentication, service integrationsBusiness processes, algorithms, user journeys, pipelines

When to choose a sequence diagram

  • You're designing or documenting an API or integration and the order of calls matters.
  • You need to show which component is responsible for each request.
  • You're debugging a timing problem, such as a race between two services, and need to see what happens when.
  • You want to show synchronous vs asynchronous communication.

When to choose an activity diagram

  • The process has many decisions or loops.
  • You're explaining a business workflow to people who don't care which microservice does what.
  • Work happens in parallel and you need to show where it joins back up.
  • You want to show hand-offs between teams, using swimlanes.

Using both together

On larger features, teams often draw an activity diagram first to agree on the overall process, then a sequence diagram for each tricky step to agree on the technical contract. For example, the "Charge card" step above might get its own sequence diagram showing retries, idempotency keys and webhook callbacks.

Activity diagrams with swimlanes sit in the middle: they show both the steps and roughly who performs them, without the message-level detail of a sequence diagram.

A quick decision rule

If the interesting part is the conversation, draw a sequence diagram. If the interesting part is the decisions, draw an activity diagram. If you aren't sure, sketch the activity diagram first; it's usually quicker and will show you which steps deserve a closer look.