Skip to main content
Version: 0.4.1

Model a business process

Write a business process as BPMN in the model: who does what, in which order. Kanoniq draws it in lanes; you never keep a .bpmn file beside the model. The guide grows one small model, a shop, a step at a time, and every step is a whole model that builds with no error or lint: type it into model/ in a repository kq init made, and check it with kq validate or in VS Code as you type. Every statement used here is described in full in Processes.

Name the people who do the work​

Each lane of a process is a job role, a position in your organization, written in the ecosystem with its persona, employee or freelancer. Each task names the function it performs, so write the functions too. The shop's fulfilment has a picker and a packer:

ecosystem shop "Shop" { domain fulfilment "Fulfilment" { function pick-items "Pick the items" function pack-parcel "Pack the parcel" } job-role picker "Picker" : employee job-role packer "Packer" : employee }

A job role is written in the ecosystem's block and nowhere else. See Job roles, and Model what the organization does for the functions.

Write the steps in order​

A process goes in an ecosystem or a domain, and lane <job role> makes a job role one of its lanes. A start begins it, a task is work, an end ends a path, and a then b is a sequence flow; a line may chain them. Every step sits in a lane with in <lane>, and via <function> after a task names the function it performs:

ecosystem shop "Shop" { domain fulfilment "Fulfilment" { function pick-items "Pick the items" function pack-parcel "Pack the parcel" process fulfil "Fulfil an order" { lane picker lane packer start received "Order received" in picker task pick "Pick the items" in picker via pick-items task pack "Pack the parcel" in packer via pack-parcel end shipped "Shipped" in packer received then pick then pack then shipped } } job-role picker "Picker" : employee job-role packer "Packer" : employee }

The function tells Kanoniq the task's systems, data and people. What data a process handles is never written: it comes from the functions its tasks perform. See Writing a business process.

Add a decision​

xor takes one of its ways out, and and all of them. A name follows a flow's target in brackets, [yes]; it is a name, never a condition. The picker checks the stock first:

ecosystem shop "Shop" { domain fulfilment "Fulfilment" { function pick-items "Pick the items" function pack-parcel "Pack the parcel" process fulfil "Fulfil an order" { lane picker lane packer start received "Order received" in picker xor in-stock "In stock?" in picker task pick "Pick the items" in picker via pick-items task pack "Pack the parcel" in packer via pack-parcel end shipped "Shipped" in packer end backorder "Back-ordered" in picker received then in-stock in-stock then pick [yes] in-stock then backorder [no] pick then pack then shipped } } job-role picker "Picker" : employee job-role packer "Packer" : employee }

Each way out of in-stock is a then line of its own, and each path ends in an end. See Writing a business process.

Bring in the customer​

A pool is a party outside your organization, a customer, a b2b-representative or an auditor; your own people are lanes. message from <party> on a start event or a task receives a message from a pool, and message to <party> on an end event or a task sends one:

ecosystem shop "Shop" { domain fulfilment "Fulfilment" { function pick-items "Pick the items" function pack-parcel "Pack the parcel" process fulfil "Fulfil an order" { pool shopper "Customer" : customer lane picker lane packer start received "Order received" in picker message from shopper xor in-stock "In stock?" in picker task pick "Pick the items" in picker via pick-items task pack "Pack the parcel" in packer via pack-parcel end shipped "Shipped" in packer message to shopper end backorder "Back-ordered" in picker message to shopper received then in-stock in-stock then pick [yes] in-stock then backorder [no] pick then pack then shipped } } job-role picker "Picker" : employee job-role packer "Packer" : employee }

The order arrives from the customer, and either end tells them how it went. Each message is a line of its own under its step. See Writing a business process.

See what you modeled​

The process view draws one process in BPMN: its lanes as bands, its steps left to right in the order of the flow, and the outside parties it exchanges messages with as pools above and below. The shop's, drawn from the last step:

The diagram in words

Fulfil an order · Process view

Process

  • Fulfil an order
  • Shop

Customer (Pool: Customer)

  • no steps drawn

Picker (lane: Job role: Employee)

  • Order received (Message start event)
  • In stock? (Exclusive gateway)
  • Pick the items (Task)
  • Back-ordered (Message end event)

Packer (lane: Job role: Employee)

  • Pack the parcel (Task)
  • Shipped (Message end event)

Flows

  • Order received → In stock?: sequence flow
  • In stock? → Pick the items: sequence flow, yes
  • In stock? → Back-ordered: sequence flow, no
  • Pick the items → Pack the parcel: sequence flow
  • Pack the parcel → Shipped: sequence flow
  • Customer → Order received: message flow
  • Shipped → Customer: message flow
  • Back-ordered → Customer: message flow

In VS Code, the viewer draws it as you type. See Process view.

Where next​

© 2026 Extenza Works. All rights reserved.