ZenUML is an alternative sequence diagram notation with a more code-like syntax than the standard Mermaid sequence diagram. Rather than listing each message on a separate line, ZenUML uses a nested structure that mirrors how actions and responses group together naturally.
Both ZenUML and the standard sequence diagram (sequenceDiagram) produce similar output; ZenUML may feel more intuitive to authors who prefer an indented, block-based writing style.
zenuml
@Actor Customer
@Boundary Website
@Control SupportAgent
Customer -> Website.openChat("Start chat") {
Website -> SupportAgent.notify("Customer waiting")
SupportAgent -> Customer.greet("Hello! How can I help?")
}
Customer -> SupportAgent.describe("I can't find my order")
SupportAgent -> Customer.sendLink("Here is your order tracking link")
Customer -> SupportAgent.confirm("Found it, thank you!")
ZenUML diagrams begin with participant declarations (using @Actor, @Boundary, @Control, and similar tags) followed by message chains. Nested braces group related responses under their triggering action.
```mermaid
zenuml
@Actor Customer
@Boundary Website
@Control SupportAgent
Customer -> Website.openChat("Start chat") {
Website -> SupportAgent.notify("Customer waiting")
SupportAgent -> Customer.greet("Hello! How can I help?")
}
Customer -> SupportAgent.describe("I can't find my order")
SupportAgent -> Customer.sendLink("Here is your order tracking link")
Customer -> SupportAgent.confirm("Found it, thank you!")
```
For more ZenUML syntax see the ZenUML documentation at mermaid.js.org