Processes — write one, run it

A process is the thing you explain to every new colleague: how a customer is taken on, how a month is closed, how a job is handed over. Written once, it stops being folklore.

In kyte a process is a document. The text is the process — not a form around it, not rows in a table. You write the steps the way you would say them out loud, and kyte reads them: who carries which step, where a decision sends the work, what starts the whole thing. Everything the list shows beside it — its owner, its category, whether it can run — is read out of that text when you save.

Two tabs: Processes, the documents, and Runs, every time one was carried out.

Writing one

+ New process asks for four things and writes the document for you: a title, a description, an owner (a person from your workspace, not a name you type) and a category. Under Starts you say what sets it off — by hand, or a write on a kind of record.

What comes out is a document with one step in it. Open it, press the pencil, and write the rest:

## 1 · Create the master data
- type: task
- who: [[x-kyte/person/mara-mohrmann]]

Company, contact and VAT id in the CRM.

## 2 · Credit check
- type: approval
- who: [[x-kyte/person/selina-zoppke]]

Every heading is a step. The lines under it say what kind of step it is and who carries it; anything else is prose, for the person doing the work. The full list of what you can write is in the process document.

Saving never refuses. A half-written process is the normal state of writing one — kyte lists what is missing under the steps, and only Start run stays grey until the gaps that matter are closed.

The agent writes them too

"Write me a process for handling a complaint" — the agent writes the document, and you see it before it lands. "Add a step for the credit check after step one" works the same way: it reads the document, changes it, and shows you what it changed.

Running one

Start run makes a run: a copy of the plan, frozen at that moment. Editing the process tomorrow never rewrites what happened today.

A run shows four kinds of row:

  • what has happened — ticked off, with the date and who did it
  • the one step that is open — the only row with buttons
  • a decision — answered from the run's data, with the branch it did not take marked
  • what is still ahead — there, and quiet about it

The progress counts work. Decisions are not work (nobody ticks them off), and a step a decision stepped over is not work either, so the bar reaches the end when the work does. When the last step is ticked, the run finishes itself.

Runs stay in the list when they are finished — In progress or Completed, with who started it, and a failed automatic run says why right there in the list, because nobody was watching when it went wrong.

Steps find their person

A step that names somebody shows up in their task list, one at a time: only the step that is open right now. Ticking the task off ticks the step off, and ticking the step off closes the task. Whichever place you work in, the other one agrees.

Decisions read your data

A decision is a question with two ways out:

## 3 · A customer from Hamburg?
- type: decision
- if data.record.address_city == Hamburg → 3a
- else → 3b

data.record is the record the run is about — the customer who set it off. So decisions are made on the data your company already has, not on something somebody retypes into the run. Once the question has an answer, the branch that was not taken is marked as not needed and stops counting as work.

Runs that start themselves

A process can say what starts it:

x-kyte/trigger:
  - on: create
    table: core.organizations

A new customer then starts the run, wherever they came from — a form, an import, or the agent. The run carries that record with it, and one run per process per record at a time, so a process that writes the table it watches cannot chase its own tail.

One process inside another

A step can call another process and wait for it:

## 3 · Credit check
- type: process
- process: [[x-kyte/process/credit-check]]

The called process runs as a run of its own — its own row in the list, its own tasks for the people it names — and starts with everything the calling run knows. When it finishes, everything it learned comes back and the step ticks itself off. If it was cancelled or failed, nothing is ticked: the step keeps waiting and says why.

Processes under processes

A process can say where it belongs in the list:

x-kyte/parent: [[x-kyte/process/taking-on-a-customer]]

This changes nothing about how it runs. It is only the list: the child sits under its parent, folded away until you open it, however deep you nest them. Runs nest the same way — a run started by a step sits under the run that called it.

When the agent does the work

A step can be the agent's. It starts by itself when the run reaches it, works in a session named after the process, and says why it is there. That has a page of its own: processes that run themselves.