# How Werker works

> What happens between describing some work and getting a result in Werker, what the pieces are called, and which parts are built.

Source: https://werker.cloud/how-it-works (updated 2026-12-01)

You describe work in the web app, Werker generates an agent or a
workflow of several agents from the description, saves it, and runs it
in a sandbox. The core path (describe, generate, run, result) works
end to end on one machine at spike quality. Werker's own instance is
live and has run agents in a sandbox.

## From description to result

1. **Describe.** You type the work into the web app's new-work page. A
   workspace (one organisation's isolated space in a Werker install)
   owns everything that follows.
2. **Generate.** A model call decides whether the work is one agent
   (one job, with standing instructions for its role) or a workflow
   (ordered steps, each done by one agent, one agent possibly serving
   several steps). Both are saved. A saved agent whose role fits is
   reused instead of saved again.
3. **Ask or stop.** If the work needs something only you can give,
   generation pauses and asks, then continues with your answers. If it
   needs something not set up (no sandbox, a service not connected),
   nothing is saved and the page lists what to set up. A request that
   cannot be done fails with a reason and saves nothing.
4. **Run.** A run is one execution of a saved agent or workflow. Each
   step runs in a sandbox (an isolated container created for the run)
   and reports back. You watch it live in the browser.
5. **Result.** The run's result is the last step's markdown summary,
   plus any files the steps kept.

Generation can also read a repeating request ("every morning") and
save it as a schedule. Before anything is saved it shows a brief to
approve, which you can skip.

## What a step can report

A step ends with one of three statuses.

| Status      | Meaning                                                                                                                                           |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| done        | A markdown summary and the files to show. Everything in `/work` is saved to the run's project. The next step receives the summary and file paths. |
| failed      | Why the task cannot be done. The run fails.                                                                                                       |
| needs input | A question only you can answer. The run pauses, its sandbox is kept, and your answer restarts that step with the question and answer.             |

A done step can also list what it checked, assumed and worked around.
This is the agent's own report and nothing verifies it. It was built
on 2026-11-24 and has not been run with a real model.

## Runs survive crashes

Runs are durable: if the worker process stops, the run continues from
its last completed step and does not redo finished steps. Run state is
a file on the worker machine's disk, so a run cannot move to a
different worker machine. Durable recovery can repeat an external
action, such as opening a pull request, after a restart, and no
deduplication exists yet.

## Running again, editing and schedules

- **Run again** executes the saved definition as it is now, without
  going back through generation.
- **Edit** an agent's name, role and default task, and add, reorder
  and edit a workflow's steps. An edit changes later runs, not one in
  progress.
- **Stop** ends a queued, running or waiting run. **Archive** hides a
  finished run from lists and deletes nothing.
- **Schedules** run a saved agent or workflow every hour, day or week
  at a set time in a time zone. A schedule missed while no worker ran
  fires once, then continues.

## Equipment

Equipment is the first version of how an agent learns: a step that
finishes can report the procedure it worked out (commands, code and
checks that worked, as markdown). Werker saves it with that agent, and
the agent's later runs are given it to follow when it fits and correct
when it does not. Editing the agent's role or task sets it aside. The
agent still reasons on every run. One procedure per agent assumes an
agent does one kind of job.

## Versions, history and restore

Each saved change to an agent, workflow, factory or role preset is
kept as a numbered version, with who made it and when. A History sheet
shows what each version changed and restores an earlier one as a new
version, so nothing is removed. Restore follows the permissions and
rules of an edit. This was tested with unit, component and
disposable-database tests and has not been looked at in a browser.
Runs do not record which version they ran.

## Factories

A factory is a lasting place for a team of agents to work. Terms:

- **Factory team:** a lead and specialists, each a saved agent. The
  team can be written from a brief by one model call, and saved as a
  starter for new factories.
- **Room:** a thread where you and members talk. A message can address
  one member, several, or all, and members can ask each other. Other
  members read along and stay quiet unless the message is theirs. A
  turn limit per message (24 by default) stops members keeping a room
  running and spending indefinitely.
- **Decision inbox:** a workspace-wide, live list of runs paused for
  an answer, including questions members ask you.

Maturity: rooms and the inbox are a spike, checked by model-only evals
(a lead asking a specialist, a specialist asking you through the
inbox, a lead asking two specialists). Live sandbox-backed factory
runs are not verified. The factory screens are being redesigned: today
they expose per-member settings before the work starts. Writing a team
from a brief has run on a scripted model only, not a real one. Expect
this area to change.

## How well generation works

`pnpm eval:generation`, Werker's own check, ran 8 cases on 2026-11-09
against one model and all 8 passed, once each. Results vary between
runs, so this is not a pass rate. The plan cases (4), the setup case
and the web cases passed once each on 2026-11-23. Several runs per
case, harder cases and running the check in CI are not done.

## What is not built yet

- Triggers on incoming work, such as a new issue. Only schedules
  exist.
- The improvement loop that proposes changes to a definition from past
  runs. Scoring and versions exist; nothing proposes changes.
- Replaying equipment as a program with no model in the loop. This is
  where a cost saving would come from.
- Verification checks between steps.
- Live previews of dev servers that agents start inside sandboxes.
- Credits and billing.
- Moving runs between worker machines.

See [status](/status) for the full list, and
[connections](/docs/connections) for tools and credentials.
