The process document
A process is a markdown document. This page is the complete list of what kyte reads out of it.
Everything here is optional except the steps. A document with no header still works; a header kyte cannot read never swallows the steps under it.
The header
The block between the two --- lines at the top.
---
api: company-as-code.org/v0
type: process
id: taking-on-a-customer
title: Taking on a customer
owner: [[x-kyte/person/mara-mohrmann]]
x-kyte/category: Sales
x-kyte/parent: [[x-kyte/process/sales]]
x-kyte/agent: auto
x-kyte/trigger:
- on: create
table: core.organizations
x-kyte/data:
score: number
---
| key | what it does |
|---|---|
title |
the name everywhere. Changing it here renames the process. |
id |
the short name other documents call it by — [[x-kyte/process/taking-on-a-customer]]. Without one, its title is used. |
owner |
who owns it. A person: [[x-kyte/person/<name>]], written as their name in lower case with dashes. |
x-kyte/category |
what it is filed under: Sales, Finance, HR… anything you like. |
x-kyte/parent |
the process this one sits under in the list. Display only — it changes nothing about how it runs. |
x-kyte/trigger |
what starts it by itself. See below. |
x-kyte/agent |
how far the agent may go in this process: ask, build (the default) or auto. See processes that run themselves. |
x-kyte/data |
the fields a run fills in — their names, as a reminder for whoever writes the conditions. A run starts with them empty. |
api, type |
what kind of document this is. Written for you; leave them alone. |
Triggers
x-kyte/trigger:
- on: create # create · update · delete
table: crm.organizations
The write starts the process, wherever it came from — a form, an import, the agent. The run carries
the written record with it, which is what data.record in a condition reads.
A sentence works too, when nothing in kyte can watch it yet:
x-kyte/trigger: when a contract is signed
It is kept and shown, never fired. That is how a process says what starts it before anybody has modelled the thing that starts it.
The steps
Every heading from ## down is a step.
## 3a · Send the contract
- type: task
- who: [[role/sales]]
The signed PDF goes to the customer, the countersigned one into the folder.
The bit before the separator — 3a — is the step's key: what a branch points at. Leave it out
and the step is numbered by its position. The separator can be ·, ., ), : or a dash.
Lines starting with - that kyte knows are attributes; everything else under the heading is prose,
shown to whoever does the step.
| attribute | meaning |
|---|---|
- type: |
task · approval · decision · agent · process. Missing means task. |
- who: |
who carries it: [[x-kyte/person/mara-mohrmann]] or [[role/sales]]. A person with a login gets the step as a task in their own list. |
- prompt: |
an agent step's instruction — what the agent is told to do. |
- process: |
a process step's target: [[x-kyte/process/credit-check]]. |
- if … → 3a |
a decision's branch. |
- else → 3b |
where it goes otherwise. |
The five kinds of step
task — somebody does something. The ordinary case.
approval — somebody signs it off. It needs a who; an approval nobody is responsible for is
nobody's approval.
decision — a question with two ways out. It is not work: nobody ticks it off, it answers itself from the run's data.
## 4 · Score at least 70?
- type: decision
- if data.score >= 70 → 4a
- else → 4b
A condition reads one field, compares it with one value: data.score >= 70,
data.record.address_city == Hamburg. The operators are ==, !=, >, >=, <, <= and
contains. data.record is the record that started the run; everything else is what the run has
collected. While the data has no answer, both branches stay open and the run says it is waiting.
agent — the agent does it, with the instruction in - prompt:. See
processes that run themselves.
process — call another process and wait for it. See one process inside another.
How the work flows
Top to bottom, except at a decision: a decision goes to its branches, and a branch falls through to the first step that belongs to everybody again — which is how both ways out can lead back to the same final step.
## 4 · Local customer?
- type: decision
- if data.record.address_city == Hamburg → 4a
- else → 4b
## 4a · Kick off on site
- type: task
## 4b · Kick off over video
- type: task
## 5 · Send the welcome mail
- type: approval
- who: [[x-kyte/person/mara-mohrmann]]
Step 5 happens either way.
What kyte says about it
Saving never refuses — you are allowed to stop in the middle. Under the steps kyte lists what it found, at the line it found it.
Some of it only stops the run from starting:
- the process has no steps yet
- two steps share a key, so a branch could not say which one it means
- a decision with no branches, or a branch pointing at a step that does not exist
- a
processstep that does not say which process - steps that lead in a circle
The rest is said and nothing more: an approval with nobody to approve it, an agent step without an instruction, a step nothing leads to, a trigger kyte could not read.
Draft and published
A new process is a draft. It is listed like any other, with Draft in its status column — nothing is filtered away — and the funnel offers the four states when you want to narrow the list.
A draft runs: status says how far along the writing is, and the thing that decides whether Start run works is whether the document holds together. Ask the agent to publish one when it is ready: "publish the complaints process". It asks before it does.