sysgraph Docs
Reference

Mermaid markers

sysgraph keeps catalog, role, endpoint, decision and flow links in %% lines, which Mermaid ignores as comments. A flow therefore opens unchanged in any Mermaid tool, and in sysgraph it comes with all its links. You never have to write these markers yourself — the editor produces them — but knowing what they mean helps when you work in the code view.

Participants

Written right above the participant definition:

MarkerMeaning
%% @item <id>Links the participant to a catalog item. An item of another workspace is written <id>@<workspace>.
%% @role <id>The participant's role (appearance).
%% @color #hexThe participant's color.
    %% @item pay
    %% @role svc
    %% @color #2fbf7f
    participant P as Payment Service

The participant type uses Mermaid's own syntax: participant DB@{ "type": "database" } as Order DB.

Messages

Written right above the message:

MarkerMeaning
%% @ep <id>Links the message to an endpoint; the message text starts with the endpoint label (e.g. POST /orders).
%% @tone success|error|warning|infoColors the arrow and text.

Notes

Written right above the note:

MarkerMeaning
%% @ref <flow>Links the note to another flow (a reference). The expand suffix shows it expanded in the preview.
%% @adr <decision>Links the note to an architecture decision.

Blocks and activation

MarkerMeaning
%% @color #hex (above a block)The block's color.
%% @autoThe activate / deactivate lines that follow are fixes produced by auto activation.

Portable definitions

So that links aren't lost when a flow is copied into another workspace or tool, sysgraph writes the definitions into the flow when needed:

MarkerMeaning
%% @roledef <id> {json}A role's definition.
%% @itemdef <id> {json}A catalog item's definition.
%% @epdef <id> {json}An endpoint's definition.
Note

Mermaid doesn't see these lines. When you open the flow in GitHub or Notion the diagram is drawn exactly the same; only the sysgraph-specific links go unused there.