Syntax

Sub-processes

Draw a sub-process's steps inside it or collapse it, and write event sub-processes, transactions and ad-hoc sub-processes.

A sub step stands for a stage with steps of its own. On its own line it's drawn collapsed, with a plus at the bottom. Indent steps under it, and the canvas draws them inside it:

Flowmark
process Returns

start Return requested
sub Handle return
  start Return received
  user Inspect item
  xor Damaged?
    yes -> Refund partially
    no -> Refund in full
  service Refund partially
    -> #refunded
  service Refund in full
  xor #refunded
  end Refund issued
user Close return
end Return closed
  • The steps inside are a path of their own, with their own start and end events. Write them two spaces deeper than the sub line, after its own lines such as note: or on:.
  • The arrow from the line above goes into the sub-process. The sub-process goes on to the line after its steps, like any step. A blank line after the steps starts a new path instead.
  • Arrows stay at one level. A step inside can't point to a step outside, or the other way round. Point to the sub-process itself, and put boundary events on it to leave it early: on:timer(P5D) Took too long -> Escalate.
  • A sub-process inside a sub-process works the same way, one indent deeper.

The steps inside keep the sub-process's lane, so a lane line can't go inside it. To move them to another lane, move the sub-process.

Collapse a sub-process

Write (collapsed) at the end of the sub line to draw it collapsed. It becomes a box the size of a task, with a plus at the bottom. Its steps stay in the text, indented under it as before, but the app doesn't draw them until you expand it again.

Flowmark
process Returns

start Return requested
sub Handle return (collapsed)
  start Return received
  user Inspect item
  end Return checked
user Close return
end Return closed
  • (collapsed) goes after the name, before or after an #id: sub Handle return (collapsed) #handle. It works on every kind of sub-process, as in sub:transaction Book trip (collapsed).
  • The checks still run on the steps inside. A problem inside a collapsed sub-process still shows on the Problems list.
  • A message to or from a step inside is drawn to the collapsed sub-process. Notes, data and groups of the steps inside are hidden with them.
  • A sub-process with no steps inside is always drawn collapsed. So (collapsed) on it means nothing, and the app doesn't keep it.
  • A sub-process name can't end with (collapsed).

Handle something at any time (event sub-process)

sub:event is an event sub-process. It isn't on any path. It runs when its start event's trigger happens while the process runs, such as a cancellation that can come in at any point.

Flowmark
process Order fulfilment

start Order placed
user Pick items
user Pack parcel
end Order shipped

sub:event Handle cancellation
  start~message Order cancelled
  service Refund payment
  end Order cancelled out
  • It has one start event, and that start takes a type: start:message, start:timer(P30D), start:error, start:escalation, start:signal, start:conditional or start:compensation.
  • Error, escalation and compensation starts catch what the work round it throws. Only an event sub-process's start can be one. On the canvas, Change type on that start offers them.
  • start: stops the work round it, as an interrupting boundary event does. start~ lets the work go on alongside it.
  • It has no arrows in or out. Put it after the main path, with a blank line before it.
  • Inside a sub-process, an event sub-process handles what happens while that sub-process runs.

A deadline or failure on one step isn't an event sub-process. Put a boundary event on that step instead: on:timer(PT4H) Not resolved in time -> Escalate.

Succeed or undo together (transaction)

sub:transaction is a transaction. Its steps succeed together or are undone together, such as booking a flight and a hotel for one trip. The app draws it with a double border.

An end:cancel inside it cancels it. An on:cancel on it says where the flow goes then.

Flowmark
process Trip booking

start Trip requested
sub:transaction Book trip
  on:cancel Booking cancelled -> Tell traveller
  start Booking started
  service Book flight
  service Book hotel
  xor Both booked?
    yes -> Trip booked
    no -> Booking failed
  end Trip booked
  end:cancel Booking failed
user Send itinerary
end Itinerary sent

send Tell traveller
end Traveller told

Steps in any order (ad-hoc sub-process)

sub:adhoc is an ad-hoc sub-process. Its steps are done in any order, as often as needed, until the work is done. Researching a question is one example. The tools an AI agent picks from are another. The app draws it with a ~ at the bottom.

Flowmark
process Customer research

start Question asked
sub:adhoc Research question
  task Read past tickets
  task Interview customers
  task Draft findings
    -> Review findings
  task Review findings
user Present findings
end Findings presented
  • Its steps don't connect to the line above them, and it has no start or end event inside. Each step goes on a line of its own.
  • Write an arrow only where one step has to wait for another, as Review findings waits for Draft findings above.
  • Like any step, the sub-process itself follows the line above it and goes on to the line after its steps.

On the canvas

Right-click a sub-process and select Add steps inside to add a start and an end inside it, then build on them. An ad-hoc sub-process gets one task instead.

Kind in the same menu, or in the Properties panel, makes it an event sub-process, a transaction or an ad-hoc sub-process. Dragging a sub-process moves its steps with it.

To collapse a sub-process that has steps inside, select it and turn on Collapsed. It's on the selection bar, in its right-click menu and in the Properties panel. To expand it, click the plus at its bottom, or turn Collapsed off.

When you pick a step hidden inside a collapsed sub-process, from search, a comment or a list, the app expands the sub-process first so the step shows.

In BPMN

  • The steps go inside the subProcess element.
  • An event sub-process has triggeredByEvent="true".
  • A transaction is a transaction element, and an ad-hoc sub-process an adHocSubProcess.
  • A collapsed sub-process's shape has isExpanded="false". Its steps are drawn on a diagram page of their own, as bpmn.io draws a drill-down.

Files from other BPMN tools import the same way. A sub-process with isExpanded="false", or whose steps are drawn only on a page of their own, comes in collapsed. The app reads colours and groups from every page.

Penna doesn't keep an ad-hoc sub-process's ordering or completion condition, and says so on import.

On this page