Skip to main content

Overview

Mermaid is a diagram and flowchart tool that converts text-based syntax into visual diagrams. It supports various diagram types including flowcharts, sequence diagrams, class diagrams, state diagrams, and more. The tool generates high-quality images (PNG, SVG, or PDF) from Mermaid code. Runs in E2B sandbox environment, so you don’t need to install mermaid-cli locally. The conversion process is executed securely in an isolated environment with Node.js and Chromium pre-installed.

Key Features

MERMAID_CONVERT

  • Convert Mermaid diagram code to PNG, SVG, or PDF images
  • Runs securely in E2B sandbox environment - no local installation required
  • Supports all Mermaid diagram types
  • Background color options: transparent or white (PNG only)
  • Clean, high-quality diagram output
  • Returns a signed URL for downloading the generated image

Authentication

No authentication required for Mermaid tools.

Example: Business Approval Workflow

Example: Sequence Diagram

Example: State Diagram

Supported Diagram Types

Basic Syntax Examples

Flowchart

Sequence Diagram

Class Diagram

State Diagram

Styling and Theming

Custom Colors

Node Styling

Use Cases

  • Business Process Documentation: Approval workflows, operational procedures
  • System Architecture: API interactions, microservices communication
  • Database Design: ER diagrams, schema relationships
  • Project Planning: Gantt charts, timelines
  • Technical Documentation: Class diagrams, state machines
  • User Experience: User journeys, interaction flows
  • Version Control: Git branching strategies, release processes

Best Practices

Diagram Design

  • Keep diagrams focused and not too complex
  • Use clear, descriptive labels
  • Apply consistent styling
  • Add notes for important context
  • Use appropriate diagram type for the use case

Formatting

  • Use proper indentation for readability
  • Group related elements together
  • Use comments to explain complex logic
  • Test diagrams before using in production

Performance

  • Large diagrams may require longer timeout
  • Consider splitting very complex diagrams
  • Use SVG for web display (smaller file size)
  • Use PNG/PDF for documents and presentations

Accessibility

  • Use high contrast colors
  • Include descriptive labels
  • Provide alternative text descriptions
  • Ensure font sizes are readable

Output Format Recommendations

Limitations

  • Very complex diagrams may hit timeout limits
  • File size limits apply for output-files API
  • Background color option only works with PNG format
  • Some advanced Mermaid features may require specific versions
For complete Mermaid syntax reference, visit Mermaid Documentation.