MermaidJS turns a request flow into a readable sequence diagram from compact text. Each service becomes a lifeline, arrows show messages, and time moves downward. section 8.5
Use the diagram to separate user-blocking work from asynchronous fan-out:
- Place gateway checks, validation, database reads, and writes above the response line. section 8.5
- Place emails, webhooks, and external API calls below the response line when they run asynchronously. section 8.5
- Keep the rendered picture for structure and a message list for precise auditing. section 8.5
Endpoint documentation
Feed a route definition, its flow, the handler source, and imports into a Mermaid sequenceDiagram request. A Cal.com POST /api/book/event flow exposes six service lifelines and the split between work before 201 Created and asynchronous work afterward. section 8.5
POST /api/book/event sequence. Six service lifelines, time flowing top to bottom. Everything above the 201 Created runs while the user waits; everything below fans out async.

Inspect the rendered endpoint sequence to see lifelines, message order, and the synchronous/asynchronous boundary. section 8.5


