id), runs it on the
active environment module, captures its
output, and persists the result to the database. Process execution does not
block the client request unless block: true is set.
Process Model
Each process has the following fields:id: stable database identifier (auto-incrementing integer, persists across restarts)ref: optional reference label (trimmed; must be non-empty if present, unique)state: lifecycle phase (see below)exitState: execution outcome (see below)error: error message if the process failed, otherwisenullcode: the submitted sourcetimeoutMs: per-process timeout in milliseconds.null= no enforcement,undefined= 30s defaultenvConfig: opaque configuration passed through to the environment moduleoutput: structured key/value payload emitted bycyrnel.output(...)stdout,stderr: captured text outputcreatedAt: ISO-8601 timestamp of creationcompletedAt: ISO-8601 timestamp of completion, ornullif still running
Process creation records and execution results are persisted in the
database. Runtime state (running/queued/terminating) is ephemeral and
held in memory, restarting the API clears active executions but the
creation record and any completed results survive.
Process states
Process exit states
Create a Process
POST /processes
codeis required and must be a string.refis optional, trimmed, unique if provided, and must be non-empty if present.timeoutMsis in milliseconds. Must be a positive integer, ornullto disable enforcement, orundefinedto use the default (30s). This is a hard enforcement ceiling, execution is terminated when the wall clock exceeds this value.envConfigis optional, opaque configuration passed through to the environment module. Its shape is environment-dependent and validated by the module itself.autoruncontrols whether execution starts immediately. Whentrue(default), the process is queued and runs right away. Whenfalse, the process is created inidlestate and must be started via the run signal.
201):
block: true and autorun: true, cyrnel polls until state === "idle"
before responding. The HTTP status is still 201.
Run an Existing Process
POST /processes/:id/signals/run
- The process must currently be
idle. - If the process has stored outputs (any of
exitState,output,stdout,stderris non-empty),force: trueis required to overwrite them. block: truewaits until the run completes.
200): the process record.
Kill a Process
POST /processes/:id/signals/kill
- If the process is
queued, it transitions straight toidlewithexitState = "canceled". - If
running, it moves toterminatingfirst, then toidlewithexitState = "canceled"once the environment confirms. - If already
idle, the call returns409.
200): the process record.
Inspect a Process
/output, /stdout, and /stderr return 409 unless the process is
idle.
Filtering /processes
Query parameters:
state: One ofidle | queued | running | terminatingstatus: One ofsuccess | failed | timeout | canceled | nullref: Exact match (trimmed, non-empty)
Delete a Process
DELETE /processes/:id
The process must be idle. The record is permanently removed from the
database.