dotFactory
Documentation / Run and observe

Runs

Run and observe

Admission, the worker data plane, statuses, effects, values, and stopping a Run.

A Run is one admission of a trigger through to quiescence. It is recorded as an append-only journal: admissions, claims, firings, scope closes, aborts and the terminal outcome. The pages you read are projections of that journal.

Admission

Admission checks the trigger's seed against its types and queues a Run. It returns immediately — the Run is queued until a worker claims it — and it records both the factory id and the exact version digest, so the Run stays reproducible after the factory changes.

Admission can be:

  • asynchronous (the default): POST /api/runs answers 202 with a Run id;
  • synchronous: {"sync": true} runs it inline for a caller that wants the finished result.

The data plane

The app and scheduler are the control plane: they only admit Runs. Execution belongs to the worker, which claims one task at a time and runs it. A task is a structural unit of scheduling — one firing of the Run or of an enclosing scope — not a separate trace: its node span sits under the Run.

  • Several workers, and several threads inside one worker (FCT_WORKERS, eight by default), can execute different firings of the same Run concurrently.
  • A claim is an append-only lease. A worker that dies leaves its task claimable when the lease expires; the next worker folds the journal back into a cursor and continues inside the open scope.
  • A machine-backed step (a container or sandbox runner) records its machine in a durable ledger. If the worker dies mid-step — a deployment restarts it — the next worker reattaches to the same machine and continues within the step's original timeout instead of provisioning another one. A container step also caches its image's contract, so a verification normally provisions only the machine that runs the gate, not a second one just to read the interface.
  • An agent step does the same for its machine and its session: the retry waits on the run already in flight instead of prompting the model again, and a hosted harness (Codex Cloud) records its session the same way. A session that is gone or no longer answers is released and started fresh.
  • Admission is idempotent per outbox request: a request still waiting to start is never queued twice.

Statuses

status meaning
queued admitted, not yet claimed by a worker
running a worker is executing its task
succeeded the graph reached quiescence
failed a node or adapter raised an execution error
aborted an operator stopped it, or a system abort ended it

There is no partial success: a Run reaches quiescence or it does not. On a terminal Run the flow dims and labels nodes that never fired, so you can see how far it got.

Long Run errors show a short preview. Select Show full error to expand the complete message; the expanded view is preserved in the page URL.

The flow and nodes

The Run's flow uses the factory version recorded when the Run was admitted. If that version is unavailable, the page reports that the graph cannot be loaded. Older Runs without a recorded version show the current factory graph with a warning that it may differ. The agent-readable Run snapshot reports whether its flow's version was verified.

The Run page opens on the flow: the factory's graph with the admitted trigger highlighted. Selecting a node narrows the log and trace to it. A node's status is its own outcome; a step that was skipped is labelled as such, and an effect stays neutral until it actually writes something.

The Nodes table lists each step's output ports. Selecting a node with ?node=<node> narrows the values and logs; ?open=<node>#<attempt> keeps that node's recorded output open. The URL is the view, and the same URL answers JSON with Accept: application/json or ?format=json for an agent.

Effects

An effect step performs an external action — commenting, merging, uploading — through its adapter. Each firing records:

  • the status;
  • the node and the adapter's one-line summary;
  • an optional locator: a path, URL or commit id, linked when it is a URL.

A Run's result should be legible without opening its recorded values: the Effects table is where that happens.

Values and secrets

The Values panel shows what each node produced. Values are behind an explicit Reveal, and secret values are redacted server-side before they leave the store, so they cannot leak through a screenshot, a trace or the API.

Logs and trace

OpenTelemetry logs and spans are attached to the Run. They are folded behind a disclosure because the flow and nodes are the everyday view; the trace is for the debugging session where you need to know which firing waited on which. Worker, node and task identities are attributes on the spans.

A container step is a black box to the engine, so the image reports its own phases if it can: the fresh-container verifier posts a span for the attempt, the clone and ancestry proof, and each gate stage (python, frontend, browser) under the step's trace. A verification that feels slow can therefore be read from the trace instead of guessed at from a capped log.

Stopping a Run

An operator may stop a queued or running Run:

  • Stop on the Run page;
  • POST /api/runs/<id>/cancel;
  • host cancel <run_id>.

A queued Run ends immediately without executing anything. A started Run aborts like a system error: it is recorded aborted, and no further node runs. A finished Run keeps its outcome — there is nothing to cancel.

Testing one step

A Run executes the whole graph, so a step that sits behind an agent waits for the agent first. The factory page's Run a step opens /factories/<id>/steps: it lists the leaves reachable from the root flow, renders the selected leaf's declared in: ports as a form (a secret is a password field), and executes only that step.

  • Run executes the step through its normal runner and backend.
  • Dry run resolves the spec and envelope without provisioning anything.
  • Describe asks a container image for its describe contract.

A choice port renders as a selector: pick the variant (public, ghcr, ecr for the verifier's source) and the form shows that variant's fields, with its secret masked. A list or map still has no flat form and stays a JSON field. The value is always the tagged record the declaration expects — {"ghcr": {"image": "…", "username": "…", "token": "…"}} (spec §4); a bare image reference is a string, not a source, and the container adapter refuses it.

The form is prefilled from the factory's own in:. A step says what it expects (repo: "…", token: github_token(…), source: { ghcr: { … } }), so the page resolves what it can and marks each such input factory: leave it blank and the step runs with the declared value, including a credential, config or github_token call. A secret is resolved on the server and is never sent to the browser; a value that is not itself secret can be prefilled, and any field may be overridden. What genuinely needs a Run — a branch, a sha or an attempt produced by an earlier step — stays blank, is not marked factory, and has to be typed. A blank bound secret stays inherited even when another field of the same choice is overridden, so a stored pull token is used with a new image. Filling a non-secret part of a choice asks for the rest of that variant; picking a different variant replaces the declared one.

The JSON boxes add inputs the declared interface does not cover and, for a container step, override its runner config for that one invocation (image, cpu, timeout, params, …). Neither is stored. A composite target is refused: name one of its leaves.

POST /api/factories/<id>/steps is the same probe from an integration. A real container run is synchronous and can take as long as the step's timeout; dry run and describe return before run.

When the deployment exports telemetry, a debug run is a step span under the HTTP request and a container step adds container describe / container run children; a failure carries its message as fct.error and a log record. That is where to look when the browser only shows a timeout or a status code.

Reading history

The Runs page lists recent Runs across your factories; the factory page lists that factory's last hundred, with status counts and the average and p95 duration. The dashboard splits the latest outcomes into recent successes and recent failures, each row naming the factory, trigger, status and a one-line outcome — the error, or the last effect's summary.

Your factories

Your factories will appear here. Create one and open it beside this guide.