Microservice Call Sequence Diagram Template
Order creation call chain across client, API gateway, order service, inventory service, message queue and notification service, with activation bars and an asynchronous event. For microservice design documents, exported as PNG, Word or PowerPoint for free.
Edit the text, pick a theme, export Word / PowerPoint / PDF
When to use it
Microservice architecture design, integration notes and technical reviews. activate / deactivate draws the period during which a service is handling a request; the message queue decouples the notification from the main call chain, so synchronous calls and asynchronous events are easy to tell apart.
Making it yours
- Add a service with
participant X as Name; participants are laid out left to right in the order they first appear. - Synchronous calls use
->>plus a-->>reply; asynchronous events use a single->>with no reply. - Add timeouts and fallbacks with
alt Inventory service timed out … else … endaround the reservation. - Add
autonumberunder the first line if you want numbered messages.
Mermaid code
sequenceDiagram
participant C as Client
participant G as API gateway
participant O as Order service
participant I as Inventory service
participant Q as Message queue
participant N as Notification service
C->>G: POST /orders
G->>O: Create order
activate O
O->>I: Reserve stock
activate I
I-->>O: Stock reserved
deactivate I
O->>Q: Publish "order created" event
O-->>G: 201 with order id
deactivate O
G-->>C: Return order id
Q->>N: Consume event
N-->>C: Push "order placed" notificationAsk an AI for one with this structure
Send the prompt below to ChatGPT or Claude, then paste the whole reply into the editor; the code inside is detected automatically.
Draw a microservice order creation sequence diagram in Mermaid sequenceDiagram syntax with participants Client, API gateway, Order service, Inventory service, Message queue and Notification service. The client calls the gateway, which calls the order service; the order service synchronously reserves stock with the inventory service, publishes an "order created" event to the queue and returns the order id; the notification service consumes the event and pushes a notification to the client. Use activate/deactivate for the order and inventory services. Output only the mermaid code block.
FAQ
- What is the difference between activate and the + / - shorthand?
O->>I: Reserve stockfollowed byactivate Iis the same asO->>+I: Reserve stock, and-->>-matches deactivate. The long form reads more easily; AI-generated code uses both.- Too many participants make the diagram wide
Merge minor participants (for example gateway and client), or group services with
boxand shorten names. SVG export scales without loss.- How do I name the event on the queue?
Put it in the message text in quotes, for example "order created". Avoid semicolons in message text.
More in this category
User Login Authentication Sequence Diagram TemplateLogin sequence diagram with user, web app, auth service and database: submit credentials, look up the user, verify the password, return a token or 401, with alt branches and a note. For API docs and system design; free PNG, Word and PowerPoint export.
Online Payment Sequence Diagram TemplatePayment sequence diagram with user, merchant system, payment provider and bank: create the payment, checkout page, charge, synchronous result, asynchronous webhook and retry on failure. For payment integration docs; free PNG, Word and PowerPoint export.
Updated 2026-09-05