SequenceDiagrams

Syntax reference

Every construct the editor understands, with a live example. Paste any snippet into the editor to try it.

Title

Set a diagram title.

title: My Diagram
A -> B: hello
My DiagramABhello

Solid message

A synchronous call with a solid arrow.

A -> B: request
ABrequest

Dashed message

A response or async return with a dashed arrow.

A --> B: response
ABresponse

Open (async) message

An open arrowhead for async messages.

A ->> B: async event
ABasync event

Lost message

A message that never arrives.

A -x B: dropped
ABdropped

Bidirectional message

Arrowheads on both ends.

A <-> B: sync
ABsync

Bold message

An emphasized message.

A => B: important
ABimportant

Self message

A participant messaging itself.

A -> A: internal work
Ainternal work

Participant alias

Give a participant a short id used elsewhere.

Payment Service as pay
Client -> pay: charge
Payment ServiceClientcharge

Note

Attach a note to one or more participants.

A -> B: hi
note A: a single-participant note
ABhia single-participant note

If / else block

A conditional branch.

if: authorized
  A -> B: proceed
else: denied
  A -> B: stop
end
if authorizeddeniedABproceedstop

Group block

Group related messages.

group: retry
  A -> B: attempt
end
group retryABattempt

Dividers

Visual separators: thin, regular, dashed, bold.

A -> B: one
--: phase two
A -> B: two
ABonephase twotwo

Delay

Indicate elapsed time.

A -> B: start
...: some time later
B --> A: done
ABstartsome time laterdone

Order

Force participant order.

order: B, A
A -> B: hi
BAhi

Autonumber

Number every message automatically.

// autonumber
A -> B: first
B -> A: second
AB1. first2. second

Label formatting

Inline *italic*, **bold**, ~~strike~~, and `code`.

A -> B: **bold** and *italic* and `code`
ABbold and italic and code

Icons

Font Awesome {fa…} tokens are recognized and ignored in v1.

A -> B: {fa-user} sign in
AB sign in

Comments

Lines starting with // are ignored.

// this is a comment
A -> B: hi
ABhi