Workflow Diagram
Workflow Diagram

Sequence behavior on a timeline, mapped onto the objects diagram, with step-by-step playback.

A workflow diagram visualizes behavior: the ordered messages exchanged between objects during a process. It is generated from a workflow definition (a .wf artifact) and rendered as a sequence diagram — participants as lanes, messages as arrows over time.

In Studio you can also read the same workflow on the workflow objects diagram (wf-objects-diagram): the structural objects diagram with sequence steps mapped onto links. Playback animates each step on both surfaces at once.

Diagram source format

Workflow source text follows the Mermaid sequence diagram grammar: one construct per line, optional sequenceDiagram header, participant declarations, messages as <from><arrow><to>: <label>, and Mermaid-style fragments (alt, opt, loop, par, critical, box, rect) closed with end. Line comments use %%.

The example below is valid in both Mermaid and Studio:

sequenceDiagram
  participant Customer
  participant API
  Customer ->> API: Submit order
  API -->> Customer: Order accepted

Compatible with Mermaid

You can paste or author diagrams that follow the public Mermaid sequence syntax. Studio parses the same line-oriented body Mermaid documents for sequenceDiagram:

ConstructSyntax (summary)Notes
HeadersequenceDiagramOptional in .wf; ignored on parse, not re-emitted when saving from Visual.
Participantsparticipant <id> or participant <id> as <label>Order in the file sets column order left to right. Participants also appear when first used in a message.
MessagesA ->> B: TextSee Message arrows for all ten arrow literals.
Fragmentsalt, opt, loop, par, … endSee Fragments for each frame type and section keywords.
Notesnote left of <id>: … / note right of <id>: …Single-line note text in source.
Comments%% …Ignored, as in Mermaid.

Message arrows

Every message line uses the same template:

<from><arrow><to>: <label>

<from> and <to> are participant ids. Spaces are optional (A ->> B : Hello equals A->>B:Hello). Self-messages (A->>A: retry) are allowed and render as a loop on that participant’s lane.

Studio accepts exactly these arrow literals (longest match wins, so C-->A is participant C, arrow -->, participant A — not a merged id):

ArrowLineArrowheadTypical use
->SolidNoneSignal or flow without a directed arrowhead
-->DottedNoneWeak, return, or asynchronous line without a filled head
->>SolidFilledDefault request — synchronous call or send
-->>DottedFilledDefault reply — response or callback
<<->>SolidBoth endsBidirectional exchange on one line
<<-->>DottedBoth endsBidirectional, non-primary link
-xSolidCrossLost message, failure, or cancellation
--xDottedCrossDotted failure / negative ack
-)SolidOpen (async)Fire-and-forget or async dispatch
--)DottedOpen (async)Dotted async message

In the visual editor, arrows containing -- (-->, -->>, <<-->>, --x, --)) render as dotted lines; the rest are solid.

Example mixing request, reply, and async:

  Client ->> API: Submit order
  API ->> Worker: Enqueue job
  Worker -) API: Accepted (async)
  API -->> Client: Order id

Any other arrow token (for example Mermaid half-arrows or central () connections) is not supported yet and produces a parse error.

Fragments

Fragments group messages inside labeled frames on the diagram (and in the steps view). Syntax matches Mermaid fragments: open with a keyword, optional title on the same line, put participant / message lines inside, close with end on its own line. Fragments can be nested — each end closes the innermost open frame.

KeywordMeaningSection separatorsTitle
altAlternative paths (if / else)else — one or more alternative branchesOptional after alt, e.g. alt Payment declined
optOptional block (may not run)None — single block onlyOptional, e.g. opt Retry
loopRepeated stepsNoneOptional, e.g. loop Poll until ready
parParallel branchesand — starts the next branchOptional on par and on each and
criticalCritical region with guarded optionsoption — circumstance-specific branchOptional on critical and each option
boxGroup participants visually (vertical box)NoneOptional; in Mermaid you may prefix a color name — stored as title text
rectHighlight a region (background)Nonerect alone, or rect rgb(…) / rect rgba(…) — color token after rect is kept as style metadata

Rules:

  • else only immediately inside an open alt; otherwise the parser reports `else` without matching `alt`.
  • and only inside par; otherwise `and` without matching `par`.
  • option only inside critical; otherwise `option` without matching `critical`.
  • A frame must contain at least one message (or a participant line) before end; empty altend is an error.
  • Titles may be quoted: alt "HTTP 4xx".

Alternative (alt / else):

  alt Card approved
  Client ->> API: Capture payment
  else Card declined
  Client ->> API: Show error
  end

Optional (opt):

  opt Cache hit
  API -->> Client: Cached response
  end

Loop (loop):

  loop Every 5s
  Worker ->> API: Heartbeat
  API -->> Worker: OK
  end

Parallel (par / and):

  par
  API ->> Email: Send receipt
  and
  API ->> Analytics: Track event
  end

Critical (critical / option):

  critical Process payment
  API ->> Gateway: Charge
  option Gateway timeout
  API -->> Client: Payment pending
  end

Grouping (box) and highlight (rect):

  box Backend services
  participant API
  participant Worker
  API ->> Worker: Run job
  end

  rect rgb(240, 248, 255)
  Client ->> API: Login
  end

Studio-specific behavior

TopicBehavior
autonumberLines like Mermaid’s autonumber are accepted but not stored in .wf; toggle message numbers in the Visual editor toolbar instead.
configOptional header keys (maxMessageLineSymbols, minParticipantsDistance) before participants — an iomodel layout extension, not in stock Mermaid.
ParticipantsIn the model, participants resolve to objects; unresolved references surface when structure changes.
Not yet supportedactivate / deactivate, break, create / destroy, actor, stereotype JSON, links, central () arrows, half-arrows, and other extensions outside the table above.

Mermaid docs as reference

For arrow types, fragment keywords, and message patterns, use the Mermaid sequence diagram syntax as the authoritative reference; Studio implements the subset above.

What it shows

  • Participants (which are model objects).
  • Ordered messages with arrows and replies.
  • Optional grouping and an autogenerated steps list.
  • The same steps overlaid on the objects diagram when you switch layout mode.
  • Animated playback that walks through messages one step at a time.
sequenceDiagram
  Customer ->> API: Submit order
  API ->> Billing: Charge payment
  Billing -->> API: Payment confirmed
  API -->> Customer: Order accepted

Layout modes

The visual workflow editor toolbar offers three layouts:

ModeWhat you see
SequenceClassic sequence diagram only
SplitSequence on the left, workflow objects diagram on the right
ObjectsWorkflow objects diagram full width

Use Split when you want behavior and structure side by side. Use Objects when the architectural context matters more than the timeline.

Workflow objects diagram

The workflow objects diagram (wf-objects-diagram) is the same canvas as Explore / the Objects diagram: objects as nodes, YAML links as edges, automatic layout. The workflow is overlaid on top — each sequence message is mapped to a link between the participant objects.

SituationOn the objects diagram
Message A ->> B and a YAML link exists between those objectsThe link carries the sequence step (highlighted, numbered when selected)
Reply message B -->> AMaps to the same link as A ->> B (reply direction is normalized)
Several messages between the same pairOne link can represent multiple sequence steps
Message with no matching YAML linkA virtual link is drawn in a distinct color — behavior exists in the workflow but not yet in the model

Virtual links are a signal to align structure with behavior: open the link sidebar and use Create model link to add the missing YAML relationship.

View vs editor on the objects pane

ModeObjects shownLinks shown
ViewWorkflow participants and their parent containers onlyLinks that appear in the workflow
EditorFull modelAll YAML links; mapped sequence steps highlighted on their links

Linked selection

Selecting a message in the sequence diagram selects the corresponding link (or virtual link) on the workflow objects diagram, and vice versa. The link sidebar opens two tabs:

  • Workflow steps — which sequence messages use this link
  • Edit link — change the underlying YAML link (or create one from a virtual link)

Unresolved participants (no model object yet) appear as top-level gray nodes on the objects pane until you bind them to real objects.

Playback and animation

Click Play in the workflow toolbar to enter playback mode. A Play panel opens on the right with transport controls and a scrollable step list.

Controls

ControlEffect
Play / PauseAuto-advance through steps
StopExit playback and clear highlights
Previous / NextMove one step manually
Show all stepsKeep every step played so far visible on the workflow objects diagram (not only the current one)

Each row in the step list shows the step number, participants, arrow type, and message text. Click a row to jump to that step.

What animates

During playback, the current step is emphasized on both diagrams:

  • Sequence — the active message and its participants are highlighted; earlier steps stay visible in muted tones.
  • Workflow objects diagram — the active step renders as a highlighted arrow (or on its mapped link). Previous steps remain in softer colors. With Show all steps, multiple played arrows are laid out to reduce overlap.

Branches, parallel, and async

ConstructPlayback behavior
alt / elseRadio buttons on each branch let you choose which path playback follows; unselected branches are dimmed
parAll branches run in parallel — several steps can be active at once
Async arrows (-) , --))The next step can start without waiting for the async message to finish

For alt, the first branch is selected by default. Change the selection before or during playback to explore a different path.

Behavior on structure

Playback connects the timeline to the architecture: you see which objects talk on the sequence diagram and how they are wired on the workflow objects diagram at the same time.

Sequence diagram and steps list

The sequence diagram shows participants as lanes and messages as arrows over time. Use it to read ordering, fragments, and reply/async arrow styles.

Participants are model objects

Map messages to objects

Each participant resolves to a real object in the model.

Keep behavior aligned

If a participant references a renamed or missing object, it appears unresolved.

Embed in specs

Reference the workflow from a specification page to give a process end-to-end context.

Behavior derived from the model

Because participants are objects, the workflow diagram stays consistent with structure. Update the model, and the workflow continues to reference the same objects.

Name messages as actions from the sender’s perspective (Charge payment, Confirm order). Clear message labels make the sequence read like a story.

Last updated on