Skip to content

Diagram Types

EventFlow auto-generates visualizations from your .flow files. Three diagram types serve different audiences and purposes.

Overview

DiagramAudienceShowsWhen CreatedBest For
Lane DiagramPM, Design, QAEvent flow between actorsSessions 1-2 (First)Event Storming, Collaborative sessions
State DiagramDevelopersState transitionsSession 4 (After derivation)Technical documentation
Combined DiagramFull teamBoth events and statesSession 5 (Review)Complete system overview

Diagram Creation Order

EventFlow follows a lane-first approach to diagram creation:

  1. Sessions 1-2: Create Lane Diagrams (events and actors) with the full team
  2. Session 4: Derive states from lane diagram wait points (developer only)
  3. Session 4+: Generate State Diagrams from derived states
  4. Session 5: Review Combined Diagrams with the full team

This order ensures:

  • Non-technical stakeholders participate in early sessions without state confusion
  • States are systematically derived from wait points, not invented arbitrarily
  • Technical complexity is introduced only when the event flow is complete

States are defined explicitly in event handlers using the moves to #state syntax.

Generating Diagrams

bash
# Generate Lane diagram (default for multi-actor)
eventflow diagram order.flow --type=lane

# Generate State diagram (default for single machine)
eventflow diagram order.flow --type=state

# Generate Combined diagram
eventflow diagram order.flow --type=combined

# Output formats
eventflow diagram order.flow --format=html  # Interactive
eventflow diagram order.flow --format=svg   # Static
eventflow diagram order.flow --format=png   # Image

Choosing the Right Diagram

  • Non-technical stakeholders → Lane Diagram
  • Technical documentation → State Diagram
  • Complete system review → Combined Diagram

Lane Diagram

"Who communicates with whom?"

Best for non-developers. Shows actor-to-actor communication via events.

Example

From this EventFlow:

flow
scenario: order process

  on :checkout from @customer (api)
    validate stock
    emit :payment_request to @payment

  on :payment_success from @payment
    send confirmation to @customer

Generates:

@customer@system@payment:checkoutvalidates:payment_request:payment_success:confirmation

Lane Rules

  1. Automatic inference - lanes created from @actor usage
  2. Order - lanes appear in order of first usage
  3. Arrows = Events - all arrows represent event communication

State Diagram

"How does the machine transition between states?"

Best for developers. Shows state machine logic.

Example

@order#cart:checkout#awaiting_payment:payment_success:payment_failed#paid#payment_failed:stock_reserved#fulfilled─── = transition, green = final state

State Diagram Features

  • Shows all states in the machine
  • Shows transition triggers (events)
  • Shows branching paths
  • Highlights initial and final states

Combined Diagram

"Full picture: who talks to whom, and what state changes occur?"

Best for complete system documentation.

Example

@customer@order@payment#cart:checkout#awaiting_payment:payment_requestprocesses:payment_success#paid:confirmed#fulfilled○ = initial, ● = state, green = final, ═══> = event

Combined Diagram Features

  • Shows both event flow AND state changes
  • Events as horizontal arrows
  • States as vertical progression
  • Clear machine boundaries

Interactive HTML Features

When generating HTML format:

  • Zoomable diagram - pan and zoom for large systems
  • Clickable elements - click states and events for details
  • Scenario walkthrough - step-by-step animation
  • Source highlighting - click diagram → highlight code
  • Toggle views - switch between diagram types
  • Event flow animation - visualize event propagation
bash
eventflow diagram system.flow --format=html --serve
# Opens interactive diagram in browser

System Diagrams

For multi-machine systems, diagrams show all machines:

bash
eventflow diagram system.flow --type=lane
@customer@order@payment@inventory:checkout:pay_request:pay_success:reserve:reserved:confirmed

Released under the MIT License.