Mermaid Sequence Diagram
Illustrate interactions between objects over time with sequence diagrams. Model message flows and communication in your systems.
Code
Preview
100%
Start typing to see your diagram
100% • Drag to pan
Quick Syntax Reference
Key syntax for creating sequence diagrams.
ParticipantsDefine actors and objects
sequenceDiagram
actor User
participant A
participant B as "Service B"MessagesSend messages between participants
A ->> B : Synchronous
A -->> B : Asynchronous
A ->> A : Self message
A ->>+ B : Activate
A -->>- B : DeactivateLoopsRepeat message sequences
loop Every minute
A ->> B : Ping
B -->> A : Pong
endAlternativesConditional flows
alt Success
A ->> B : Data
else Error
A ->> B : Error
endNotesAdd annotations
Note over A,B : Shared note
Note left of A : Left note
Note right of B : Right noteActivationLifeline activation
A ->>+ B : Activate B
B ->>+ C : Activate C
C -->>- B : Return
B -->>- A : ReturnUse Cases
Sequence diagrams illustrate how objects interact in a particular scenario.
API Documentation
Document API calls and responses.
System Integration
Show interactions between microservices.
Use Case Modeling
Visualize specific user scenarios.
Protocol Design
Design and document communication protocols.
Debugging
Trace and analyze system interactions.
Code Review
Review and discuss system designs.