UML sequence diagram messages, examples
Participants, lifelines, call, reply and async messages and loop/alt/opt fragments in UML sequence diagrams, with editable login and payment examples.
What is a sequence diagram
A sequence diagram shows, in time order, the messages that users and system parts exchange. Time runs from top to bottom.
- Explaining flows that cross several servers (login, payment, ordering)
- API design and incident write-ups
- UML interaction diagrams in classes and exams
Symbols and meanings
| Symbol | Meaning |
|---|---|
| Participant and lifeline | A box on top and a dashed line below. |
| Actor | A human participant; a stick figure. |
| Synchronous message | A call that waits; solid line, filled head. |
| Reply | The answer; dashed line, open head. |
| Asynchronous message | Sent without waiting; solid line, open head. |
| Combined fragment | loop, alt and opt boxes. |
Basis: UML 2.5 시퀀스 다이어그램(OMG): 생명선, 동기·응답·비동기 메시지, 결합 조각(loop·alt·opt)
How to draw one
- Place participants left to right, starting with whoever asks first.
- Drop a dashed lifeline under each participant.
- Draw requests as solid lines with filled arrowheads and replies as dashed arrows.
- Wrap repeats in loop, branches in alt/else, optional parts in opt.
- Name each message with a verb phrase.
Mermaid sequenceDiagram: actor U as User, participant S as Server, U->>S: request, S-->>U: reply, loop/alt/else/opt … end.
Common mistakes
- A reply (dashed) with no request before it.
- A participant that sends or receives nothing.
- A branch written only in a message name, without an alt box.
- Messages out of time order.
The editor's notation check flags these mistakes every time the picture changes.
12 sequence diagram examples
- Login sequence diagram
- Online payment sequence diagram
- ATM withdrawal sequence diagram
- Food delivery sequence diagram
- REST API call sequence diagram
- Vending machine sequence diagram
- Chat message sequence diagram
- File upload sequence diagram
- Library loan sequence diagram
- Email verification sequence diagram
- Elevator call sequence diagram
- Coupon checkout sequence diagram