Sequence Diagrams
Last updated
Was this helpful?
Last updated
Was this helpful?
Marmaid's Sequence diagrams are interaction diagrams that depict how processes interact with one another in a time-ordered sequence. They are widely used in system design, workflow analysis, and documenting user interactions. Each participant or actor is represented, and the sequence of messages exchanged between them is visualized to provide insights into the flow of information.
Sequence diagrams are particularly useful for:
Visualizing the flow of messages in a system.
Clarifying system requirements and interactions.
Documenting complex workflows.
Debugging and optimizing processes.
From the Code IDE, click Apps and Agents from the left-hand panel.
Select Mermaid. Paradime will automatically start a new Mermaid project.
In the terminal that appears, use the arrow keys to select "Sequence Diagram."
A new sequenceDiagram.mmd
file will be created in your editor with this starter template:
Click the eye icon (👁️) in the top right corner of your Mermaid file to preview the diagram.
Edit and update your .mmd
file as needed—the preview will update automatically.
Define participants and the interactions between them:
Participants can be implicitly created or explicitly defined:
Participants represent entities that interact within the sequence. They can include:
Users
Systems or subsystems
External services
Devices
Actors can be specified explicitly to use the actor symbol:
Actors are visually distinct from participants to represent active agents more prominently.
Sequence diagrams support various message types with different arrow styles:
->
: Solid line without arrow
-->
: Dotted line without arrow
->>
: Solid line with arrowhead
-->>
: Dotted line with arrowhead
-)
: Solid line with open arrow (asynchronous)
--)
: Dotted line with open arrow (asynchronous)
Example:
Activations: Highlight active participants during a message exchange:
Stacked Activations: Multiple activations for the same participant:
Add notes for additional context:
Loops: Repeated interactions:
Conditionals: Alternate paths:
Parallel Actions: Show simultaneous actions:
Critical Sections: Represent mandatory sequences:
Use clear labels: Ensure participants and messages are descriptive and unambiguous.
Keep diagrams concise: Avoid overloading with unnecessary details.
Group participants logically: Arrange participants in a meaningful order.
Use notes for clarity: Add notes to explain complex interactions.
Regular updates: Keep diagrams up-to-date to reflect current workflows.
Customize sequence diagrams with CSS for a polished appearance:
Show sequence numbers for message arrows:
Highlight specific interactions with colored backgrounds:
For more syntax options and advanced features, visit the official Mermaid documentation.