Process Runs
Some work takes longer than a request: an export that reads six weeks of schedules, a file that is parsed row by row, an AI section of a documentation page. On Klok such work is a run: a task with steps, reported by the routes that do it, against a process definition that says what the process is. Process runs shows every run of the tenant with the failed, stale and overdue ones first, and lets an operator decide what each process is. Without it, every service would keep its own job table, and nobody would notice when a job had stalled.
- In the menu: Run → Process runs (
/tasks), with the tabs Overview, Runs and Processes - For: operators on duty and anyone investigating a flow read; developers and admins of the tenant or of the run's domain, and platform staff, cancel runs and save process definitions
- Reads: the tenant's task API (
klok-api-tasks) with your own login; the runs and the process definitions are objects in the tenant's ODL, and klok.dev keeps none of them
What You See
| Tab | What it holds |
|---|---|
| Overview | Three figures (running, needing attention, failed; running and failed open Runs filtered by them), then one list with what needs attention first: failed and partially finished runs of the last day, stale and overdue runs, and running ones that have gone quiet. A process filter and Needs attention, Running and All narrow it. The list refreshes on its own |
| Runs | Every run of every process, filtered by process, status and the time it was last updated; More filters adds the correlation id, the parent run, stale and overdue. The filters stay in the address, so a filtered view can be linked |
| Processes | What each process is: its steps, which of them are mandatory, its expected duration and its limits, and how many of its runs are running or failed |
A run's status is a dot and a word, Pending, In progress, Finished, Partially finished, Failed or Cancelled, with at most one muted word after it:
| Word | Means |
|---|---|
| stale | No step has reported anything for longer than the process allows (ten minutes unless the process says otherwise) |
| overdue | The run has been open longer than the process's expected duration; it is flagged, never failed for it |
| quiet | A running run that has said nothing for ten minutes |
A run that stays silent past its fail limit (two hours unless the process says otherwise) is failed by the platform.
Walkthrough: Find Out Why A Run Failed
-
On Overview, open the failed run by its name.
-
The run's page says what went wrong: the error with its code and whether it can be retried, the step it happened in, and the progress so far. Under it are the steps in the order the process defines them, each with its status, duration, route and message, and the run's events.
-
The route of the failed step names the integration project to look at, and the correlation id on the right finds the same transaction in Run → Logs. A retryable error means the run can be started again once the other system answers; the run is started again by the integration that owns it, not from this page.
Walkthrough: Deal With A Stale Run
-
Open the run marked stale. In the example, an employments file was published at 08:15, but the step parsed, which the example consumer
KLK017P1_EmploymentsFileExamplereports, never started. -
Find out why the step's route is silent: its project's last build and deployment under Repositories, its subscription under Broker, its log events under Logs.
-
If the run should not go on, choose Cancel run and confirm. The task API publishes a cancel command (
KlokTaskCommandV1); the route doing the work takes it at its next check and the run ends Cancelled, a normal ending that is not retried. A worker that never checks for cancellation cannot be cancelled.
Walkthrough: Say What A Process Is
-
Open Processes. Each row says what its definition holds, for example
v3 · 3 steps (3 mandatory) · expected PT10M, or Not defined — completes only explicitly for a task type without a definition, such asai.chat. -
Open a process. The steps are offered from what the projects declare: a developer declares a route's step in the project's
application.properties(<RouteId>.task.step=…), and the declaration reaches klok.dev with the documentation of the project's next build onmain. Each step shows the route that declared it. -
Under Completion and time limits, set when a run is done (for example when every mandatory step is terminal), the expected duration that makes a run overdue, the stale limit and the fail limit, or Never fail for silence for a process that waits for a poller.
-
Save writes the definition to the ODL as a new version. The platform works out every run's status and progress from it, and reads a changed definition within half a minute.
The Runs tab is the place to look for one process across time, for example every run of the schedule export:
What Happens In Git
Nothing on this page writes to Git. Runs are operations, not code, and their state lives in the tenant's ODL.
| In klok.dev | Where it lands | Approved by | By hand |
|---|---|---|---|
| Cancel run | A cancel command, KlokTaskCommandV1, published by the tenant's task API; the route doing the work ends the run |
Nobody: a developer or admin of the run's domain cancels | POST /api/tasks/{id}/cancel on the tenant's task API |
| Save a process definition | The KlokProcessDefinitionV1 object of the task type in the tenant's ODL, one version up, with who saved it |
Nobody | PUT /api/odl/dev.klok.klok.datamodel.common.kloktaskevent_v1.KlokProcessDefinitionV1/<task type> on the tenant's ODL API |
| The steps a process is built from | Declared in each project's application.properties, in Git |
Merged like any change to the project | A merge request to the project |
A definition written by hand is what the platform reads within half a minute, and a run started by a route, a worker or a REST call shows up on the next refresh: klok.dev caches nothing. See What klok.dev Does In Git for every page.
Who Does What
| Automation | Kloker | You |
|---|---|---|
The routes publish a status event for every step. KLK002E8_TaskStateMaterializer keeps each run as a KlokTaskV1 object in the ODL and works out its status and progress from the process definition. KLK002I2_TaskStaleDetector checks every minute and flags stale and overdue runs and fails silent ones. None of it uses AI |
Kloker's own long-running work shows up here as runs: every AI section of the documentation is an ai.chat run. Beside the page, Ask Kloker answers questions about what you see |
Decide what a process is and save it; cancel a run; find out why a run failed and have it started again |
See You, The Automation And Kloker.
How It Connects
Process runs rests on the ODL (Operative Data): a run and a process are objects there, and the same records can be opened under Operative data. The status events travel on the broker like everything else (Broker). A run's correlation id leads to its transaction in Logs, and a file that a file flow brings in can start a run of its own (File Flows). See How The Run Pages Fit Together.
Today the materializer reads the task events of the tenant's common domain only, and the framework publishes a run's
events in the domain of the application that reports it, so runs reported by applications in another domain do not
appear here yet. A tenant without its own task API sees not activated for this tenant.
Read More
- klok.dev's reference for the three tabs and the run page: Tasks and processes
- How a route reports its work as a task: Async tasks
- Monitoring And Runtime Health and Logging, Tracing, And Correlation