Sequence Diagrams

What are Sequence Diagrams?

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.


Creating Your First Sequence Diagram

  1. Launch DinoAI: From Code IDE, access DinoAI to start creating diagrams.

  2. Use a Simple Prompt: Tell DinoAI what kind of Sequence Diagram you want to create. For example:

- "Create a mermaid sequence diagram showing the interaction between user, API, database, and analytics service"

- "Generate a mermaid sequence diagram for my dbtβ„’ run process with all system interactions"

- "Build a mermaid sequence diagram showing data validation workflow between different services"
  1. Get Your Diagram: DinoAI will generate a complete .mmd file with proper Mermaid syntax.

  2. Preview Your Work: Click the eye icon (πŸ‘οΈ) to preview your diagram in real-time as you edit.

  3. Iterate and Refine: Modify the generated .mmd file directly, or ask DinoAI to make specific changes.

Example:

Reusable Sequence Diagram prompts for you and your team

You can create custom, standardized .dinoprompts for Mermaid's Sequence Diagram that ensure consistency across your data team. See step-by-step guide.


Diagram Syntax Guide

Basic Syntax

Define participants and the interactions between them:

Participants

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

Actor Symbols

Actors can be specified explicitly to use the actor symbol:

Actors are visually distinct from participants to represent active agents more prominently.

Message Arrows

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:

Advanced Message Features

  • Activations: Highlight active participants during a message exchange:

  • Stacked Activations: Multiple activations for the same participant:

Notes

Add notes for additional context:

Conditional and Loop Blocks

  • Loops: Repeated interactions:

  • Conditionals: Alternate paths:

Parallel and Critical Regions

  • Parallel Actions: Show simultaneous actions:

  • Critical Sections: Represent mandatory sequences:

Data Team Examples

ETL Workflow

System Monitoring

Best Practices

  1. Use clear labels: Ensure participants and messages are descriptive and unambiguous.

  2. Keep diagrams concise: Avoid overloading with unnecessary details.

  3. Group participants logically: Arrange participants in a meaningful order.

  4. Use notes for clarity: Add notes to explain complex interactions.

  5. Regular updates: Keep diagrams up-to-date to reflect current workflows.

Advanced Features

Styling

Customize sequence diagrams with CSS for a polished appearance:

Sequence Numbers

Show sequence numbers for message arrows:

Highlighting Regions

Highlight specific interactions with colored backgrounds:


Additional Resources

For more syntax options and advanced features, visit the official Mermaid documentation.

Last updated

Was this helpful?