What is a sequence diagram?
A sequence diagram is a UML diagram that shows an interaction over time. Participants (people, services or objects) sit across the top, each with a vertical lifeline. Messages travel between the lifelines as arrows, from top to bottom in the order they happen. Solid arrows are calls or requests, and dashed arrows are responses.
What is in the template
The template shows a login. The browser sends POST /login to the API, the API asks the database for the user, the database returns a row, and the API answers the browser with 200 and a token.
How to draw one
- Pick one scenario, such as "a user logs in", and use it as the title.
- Add the participants from left to right, in the order they first appear.
- Add each message in time order, with the call and its key details.
- Add the responses as dashed arrows back to the caller.
- Show alternatives, such as a failed login, as a separate diagram or a labelled branch.
When sequence diagrams help most
- Designing an API or an integration before writing code.
- Explaining a bug that only happens when events arrive in a certain order.
- Documenting sign-in, payment and other flows that cross several systems.
Use this template in Starlex
Open a project, go to Notes, then Diagrams, choose New diagram and pick Sequence diagram. To add it to a diagram you already have, use Insert, then From template.
- More than a hundred shapes, with connectors that stay attached when you move things.
- Pages and layers for large diagrams, and automatic tree, grid and circle layouts.
- Import draw.io files and Mermaid flowcharts, and export to PNG, SVG or draw.io.
- Embed the diagram in an issue or a note, where it always shows the latest version.
Frequently asked questions
What is the difference between a sequence diagram and a flowchart?
A flowchart shows the steps of a process. A sequence diagram shows the messages between participants and the order in which they happen.
What do the dashed arrows mean?
Dashed arrows are return messages: the response to an earlier call.
Can I add the sequence diagram to an API issue?
Yes. Embed it in any issue description or note, and readers always see the current version.
