Flowmark reference

The complete Flowmark syntax, exactly as the assistant and connected AI apps get it.

This is the reference the in-app assistant has in its instructions and connected AI apps get from lookup_guidance with the topic flowmark. For a walk-through, start at What is Flowmark and the syntax pages.

Flowmark syntax (what write_diagram takes and get_diagram returns)
  process <name>
  lanes <Lane A> | <Lane B>          optional, fixes lane order
  lane <name>                         following nodes go in this lane
  lanes Sales | Operations > Warehouse | Operations > Shipping
                                      "A > B" makes B a lane inside A (a team in a department); steps go in the inner lanes,
                                      so write "lane Warehouse", never "lane Operations", before a step
  pool <name> [(below)]               an outside party (customer, supplier, bank) drawn as a black-box pool above the process, or below it
  pool <name> (below, beside <pool>, multiple)
                                      options in one bracket, any of them: beside puts it on the right of that pool, in its row on its side,
                                      each pool only as wide as it needs (pools side by side); multiple marks a party with many participants
  data <name> [(list)]                a data object: a document or record the process passes along (an order, a form); (list) for many of them
  store <name>                        a data store: a system or database that keeps data beyond the process (CRM, ERP)
  <kind>[:<event>[(<arg>)]] <name> [#id]
      kinds: start end catch throw task user service manual script rule send receive call sub xor and or eventgw complex
      events: message timer error signal conditional escalation terminate compensation link cancel multiple parallel; timer args are ISO 8601 (P2D, PT4H, R/P1W), or ${field} for a date each case holds that no duration gives (catch:timer(${startDate}) First day arrives); a time after something (day 25, 30 days after) is a duration (P25D)
      a message, signal, error, escalation or link arg names what is sent or awaited when it isn't the event's name, in brackets (start:message(Claim form) Claim received; throw:signal(Order cancelled) Tell warehouse); without them it's all the name. Events with the same one share it
  Indented lines under a node:
    <label> [<condition>] (default) -> <target>    explicit flow; label, condition and (default) are optional
    on:<event>(<arg>) <name> -> <target>          interrupting boundary event; on~<event>(<arg>) for non-interrupting
    doc: <text>                                   documentation: the longer description, hidden on the diagram; repeat for more lines
    note: <text>                                  a short note shown beside the node on the diagram (an SLA, a system, "manual for now"); repeat for more lines
      right under a "lane <name>", "data <name>" or "store <name>" line, note: notes the lane or the data; indented deeper than an arrow (or on: line, or => / <= line) right above it, it notes that flow or message:
        yes -> Ship order
          note: Same day if before noon
        => Customer: Invoice
          note: By email
    => <pool>: <message>                          the node sends a message to an outside pool, or to another party's step (by name or #id)
    <= <pool>: <message>                          the node receives a message from an outside pool, or from another party's step;
                                                  indented under an on:message line, that boundary event receives it ("Customer cancels" while the task runs)
    reads: <data>                                 the node uses a data object or store; writes: <data> when it creates or changes one
    repeat: loop | parallel | sequential          an activity that repeats: while a condition holds, or once for each item (all at once, or one after another)
    property: <name> = <value>                    a custom property, not drawn (Owner = Finance, System = SAP)
    calls: <process>                              under a call activity: the process it runs, by the name of its diagram (list_diagrams shows them), or of a process outside Penna
    color: <name or #RRGGBB>                      colours the node above it: its outline, and a faint wash in its fill. Indented deeper than an arrow, the flow; under a lane, pool, data, store, group or => line, that element
  note <text>                         a note on its own, drawn above the process (who owns it, when it was reviewed); several "note" lines in a row are one note (a color: line under it colours it)
  group <label>: <step>, <step>       a dashed box with a label round steps that belong together (a phase); "group: A, B" has no label. Changes no flow; group steps that follow one another
  on:compensation <name> -> <activity> links a task to the activity that undoes it; that activity has no other flows.
  throw:link <name> ends a path that goes on at catch:link <name> (an off-page connector, for a long diagram or a path that would cross it); several throws may lead to one catch.
  multiple: any one of several triggers; parallel: all of them (start, catch, on:). throw and end take multiple too. cancel: an end or on: event of a transaction.
  complex: a gateway with a rule xor, and, or can't say ("two of three reviews in"); name it with the rule.
  Steps indented under a sub, after its own lines, are drawn inside it, as a path of their own with a start and an end. Flows stay inside;
  the flow from the line above goes into the sub-process, and the sub-process goes on to the line after its steps, like any step:
    sub Handle return
      start Return received
      user Inspect item
      end Return checked
    user Refund customer
  sub <name> (collapsed) draws a sub-process that has steps inside small, with a +, its steps kept but hidden until someone expands it; write it only when the user asks to collapse one.
  sub:event <name> an event sub-process: it runs when its start's trigger happens while the process runs (start:message Order cancelled), with no flows in or out;
    start~<event> lets the work round it go on, start:<event> stops it. Put it after the main path, with a blank line before it.
    Its start can also be start:error, start:escalation or start:compensation: it catches what the work round it throws (only an event sub-process's start can).
    It's for what can happen at any point (a cancellation); a deadline or failure on one step is an on: boundary event on that step.
  Steps indented under a pool line are that party's own steps, a path of their own with a start and an end;
  flows stay inside the pool, and messages join it to the process. Write them only when the user asks for that party's side, as in "from both sides" or "show what the supplier does":
    pool Customer
      start Needs goods
      send Place order
        => Receive order: Order
      end Order placed
  lane and lanes lines indented under a pool line split its steps into the pool's own lanes, nested and written as the process's are; use them only when the user names roles on that party's side:
    pool Supplier
      lane Sales
      receive Take order
      lane Warehouse
      task Ship goods
      end Shipped
  "=>" or "<=" lines under a pool line, before its steps, are the pool's own messages, to or from another pool.
  A message line can end with (envelope: start) or (envelope: reply): it draws the message itself on its line, a white envelope for the message that starts an exchange, a grey one for its reply.
  sub:transaction <name> a transaction: its steps complete together or are undone; end:cancel inside cancels it, and on:cancel on it leads to what happens then.
  sub:adhoc <name> an ad-hoc sub-process: the steps indented under it are done in any order, as often as needed (research, a checklist, an AI agent's tools).
    It has no start or end inside, and its steps don't connect to the line above; write an arrow only where one step must wait for another.
  A doc: line before the first node documents the process.
  Names, labels and notes can be styled: **bold**, *italic*, `code` and ~~struck~~. Use it sparingly, when the user asks or a word needs stress.
  Inside a paragraph each node connects to the node on the line above it. A blank line starts a new paragraph (a new path).
  A node with explicit "->" lines does not continue to the next line, and end events never do.
  Targets are node names (case-insensitive) or #id; give a node an #id when its name is not unique or it has no name (e.g. merge gateways: "xor #merge").
  // starts a comment when it begins the line or follows a space (links like https://… are kept).
  get_diagram prints every node with its #id. Keep those ids when you rewrite a diagram, so the user's references stay stable.

Example

The reference ends with this example.

Flowmark
process Purchase request
pool Supplier (below)
data Purchase request
store ERP
lanes Employee | Manager | Procurement

lane Employee
start Need identified
user Submit purchase request
  writes: Purchase request
lane Manager
xor #resubmitted
user Review request
  reads: Purchase request
  note: SLA 2 working days
  on~timer(P2D) Review pending two days -> Send reminder
xor Request approved?
  yes -> Send purchase order
  needs changes -> Revise request
  no (default) -> Notify rejection

lane Procurement
send Send purchase order
  => Supplier: Purchase order
  writes: ERP
end Order placed

lane Employee
user Revise request
  -> #resubmitted

lane Manager
send Notify rejection
end Request rejected

send Send reminder
end Reminder sent

On this page