Your first checked workflow
Fix a small bug, verify the result, then make the workflow your own.
An order total currently ignores item quantities. You'll run an agent that repairs it in an isolated workspace. Tests must pass before the workflow copies the result back.
Before you start: use the Ubuntu host setup, with Bun and Codex subscription login ready. This tutorial uses 0.0.1-alpha.6. Initial downloads and provider login take additional time; no model call happens during initialization.
1. Create a project
On your host, in a directory where you keep projects:
mkdir my-laufwerk-trial
cd my-laufwerk-trial
bunx laufwerk@0.0.1-alpha.6 init --example coding
bunx laufwerk@0.0.1-alpha.6 doctor
bun run --cwd laufwerk checkInitialization creates laufwerk/ with the coding workflow, a hello workflow, configuration, dependencies and a stable project ID. It also installs authoring skills for coding assistants. The type check should finish without errors. Resolve any failing local readiness checks before continuing.
Keep this terminal in my-laufwerk-trial for the remaining commands.
2. Get the small broken example
mkdir project
curl -fsSLo project/total.mjs https://www.laufwerk.dev/downloads/alpha6/first-workflow/total.mjs
curl -fsSLo project/verify.mjs https://www.laufwerk.dev/downloads/alpha6/first-workflow/verify.mjs
bun test ./project/verify.mjsThe tests should fail here. The function adds prices but ignores quantities. The first test expects 52, but gets 20. This is the bug the agent will fix. The host uses Bun for this check; the isolated Node-based agent environment will use node --test.
3. Run the coding workflow
bunx laufwerk@0.0.1-alpha.6 run coding --input '{"executionKey":"total-1","source":"project","request":"Fix total.mjs so each item price is multiplied by its quantity. Keep verify.mjs unchanged. Make no other changes.","verify":"node --test verify.mjs"}'The workflow opens an isolated copy of project, asks Codex to implement the change, runs the verification command in that same environment, closes the session, and writes back only if verification succeeded.
The CLI prints a run ID and the outcome. Expect completed (healthy). The exact run ID and model wording will differ. If the run fails, inspect the error with the debugging guide; do not delete its state or rerun indefinitely.
4. Check the result yourself
cat project/total.mjs
bun test ./project/verify.mjsExpect all three tests to pass. The function should now account for quantity, for example:
export function total(items) {
return items.reduce((sum, item) => sum + item.price * item.quantity, 0);
}The model may choose equivalent code. Review the actual change and confirm the tests were not modified. This fixture is a teaching exercise, not protection against an adversarial agent rewriting its verifier. The documentation repair example explains a stricter change boundary.
5. See what happened
bunx laufwerk@0.0.1-alpha.6 status
bunx laufwerk@0.0.1-alpha.6 studioOpen the local URL Studio prints. Find the coding run, inspect the model's work and the verification operation. Studio runs on your machine; it is not a hosted dashboard. Use port forwarding if your workflow runs remotely.
For live terminal progress, use a second terminal in this same project:
bunx laufwerk@0.0.1-alpha.6 status RUN_ID --watchReplace RUN_ID with the ID returned by your run.
6. Change the request
bunx laufwerk@0.0.1-alpha.6 run coding --input '{"executionKey":"total-2","source":"project","request":"Add a short comment above total explaining that it sums prices multiplied by quantities. Keep the tests unchanged.","verify":"node --test verify.mjs"}'A new attempt needs a new execution key. The same key refers to the same recorded execution, even if you edited the prompt or workflow. total-2 is a new run. Use the existing ID when inspecting or recovering the original run.
To see the failure boundary, use another new key and set verify to exit 1. The run should fail and its isolated change must not appear in your host project.
What you just built
Your request → isolated agent work → deterministic test → checked write-back
↓ failure
stop, inspectYou supplied the task and the definition of success. Laufwerk supplied the recorded execution, agent environment and explicit write-back boundary. Your next workflow uses the same pieces with your own rules.