Diagram Desk

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
BrowserWeb serverDatabaseEnter ID and passwordSign-in requestLook up memberMember recordSession tokenHome screenErrorAsk to retryUseralt [Password matches][Wrong password]
Login sequence diagram

Symbols and meanings

SymbolMeaning
Participant and lifelineA box on top and a dashed line below.
ActorA human participant; a stick figure.
Synchronous messageA call that waits; solid line, filled head.
ReplyThe answer; dashed line, open head.
Asynchronous messageSent without waiting; solid line, open head.
Combined fragmentloop, alt and opt boxes.

Basis: UML 2.5 시퀀스 다이어그램(OMG): 생명선, 동기·응답·비동기 메시지, 결합 조각(loop·alt·opt)

How to draw one

  1. Place participants left to right, starting with whoever asks first.
  2. Drop a dashed lifeline under each participant.
  3. Draw requests as solid lines with filled arrowheads and replies as dashed arrows.
  4. Wrap repeats in loop, branches in alt/else, optional parts in opt.
  5. 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

Draw a sequence diagram from scratch

All SeewolLabs tools