UML sequence diagram template
An actor, a boundary, a controller and a store, with activations and a correct alt fragment already drawn. Rename the participants and the ordering survives.
Notation: UML 2.5.1Diagram: Sequence diagram
Open this template in Archyno
It opens as an editable model, not an image. Change it in the browser, then export to PNG, SVG, Mermaid, XMI, or a Sparx .qea file.
Open this templateWhat is on this diagram
- User
- The actor. A stick figure because they are outside the system.
- Web app
- The surface the request lands on. Rename to your entry point.
- Auth service
- Whatever decides. Swap for the collaborator your flow calls.
- Database
- The store. Delete it if your flow never reaches one.
- alt fragment
- The branch. Both guards are filled in - edit, do not remove.
- Activations
- The bars. They start when a call arrives and end at its reply.
How to make it yours
- Rename the four participants left to right, in the order the request actually travels.
- Rewrite the message labels as operations, not sentences - verify(session), not 'checks the session'.
- Keep every reply arrow dashed. A solid arrow back is a second call, and it means something else.
- Edit both guards on the alt fragment. An alt with one branch filled in is an opt.
- Stop at the first screen's worth. A sequence diagram that scrolls is two diagrams.
Common questions
What is an alt fragment in a sequence diagram?
A framed region split into compartments, one per alternative path, each with a guard in square brackets. Exactly one compartment runs. It is how a sequence diagram shows a branch, and it is the element that keeps a flow on one diagram instead of three.
Do I have to draw activation bars?
No, they are optional in UML 2.5.1, but they are worth keeping. The bar shows how long a participant is busy, which is the only way to see on the diagram that a synchronous call is blocking its caller for the whole nested exchange below it.
How many participants should a sequence diagram have?
Four or five, and rarely more. Past that the lifelines are too close to label and the diagram stops answering the question it was drawn for. If you need more, split the flow and reference the second diagram with a ref fragment.
Read the notation
Sequence diagrams
How to read and draw a UML sequence diagram: lifelines, activation bars, synchronous and asynchronous messages, replies, and the combined fragments (alt, opt, loop, par) that handle branching.
Communication diagrams
How to read and draw a UML communication diagram: objects, links, numbered messages, nested decimal sequencing, and when to prefer it over a sequence diagram.
Interaction overview diagrams
How to read and draw a UML interaction overview diagram: interaction occurrences, inline interactions, control flow between them, and how it keeps large sequence diagrams manageable.