Skip to content

agents.wfRepeatable workflows for coding agents.

Coding agents that follow your process. TypeScript fixes the steps, the agents do the thinking, and runs are durable and event-driven. Your workflow is your code, not a feature of someone's platform.

sh
bun add -g agentswf

Code decides, agents think ​

An implementer on claude, a reviewer on codex, and a loop until the reviewer's typed answer approves. DONE and VERDICT are TypeBox schemas: { summary } and { approved, changes }.

ts
const implementer = await wf.agents.open({
  key: "implementer",
  runtime: "claude",
});
const reviewer = await wf.agents.open({
  key: "reviewer",
  runtime: { harness: "codex", model: "gpt-6-luna", placement: "headless" },
});
let prompt = `Implement this task: ${task}`;
for (let round = 1; round <= 3; round++) {
  const work = await implementer.run({ prompt, schema: DONE });
  if (!work.outcome.answered)
    return wf.stop(`implementer: ${work.outcome.reason}`);
  const review = await reviewer.run({
    prompt: "Review the change.",
    schema: VERDICT,
  });
  if (!review.outcome.answered)
    return wf.stop(`reviewer: ${review.outcome.reason}`);
  if (review.outcome.value.approved)
    return { approved: true, rounds: round };
  prompt = `Make these changes:\n${review.outcome.value.changes.join("\n")}`;
}
return { approved: false, rounds: 3 };

The loop and its limit are code; the reviewer's verdict is a checked boolean, not a guess from prose. The implementer works in a pane in Herdr, a terminal multiplexer, where you can watch it and type to it; Herdr is optional, and every agent can run headless instead. The engine handles an agent that goes quiet, answers in the wrong shape, or hangs. Why agents.wf says what this is for.

From hand-run to automated ​

  • By hand: you prompt one agent, paste its output to another, and decide when it's done.
  • A workflow: awf run review-loop.ts runs the same steps every time and records each turn. If a workflow with stages stops part-way, a continue reuses the stages that finished.
  • On its own: a workflow with events gets a run per pull request. Your CI or a webhook sends it events, awf tick on a schedule brings timers due (Hosting events), and between them the run parks. A person can answer it in the terminal, or through a chat app or script you connect.

How it works ​

  1. Your code calls agent.run({ prompt, schema }).
  2. awf hands the prompt to a coding agent, in a Herdr pane you can watch or headless.
  3. The agent works in your repo with its own tools and skills, then answers by running wfa result.
  4. awf checks the answer against your schema. A wrong shape goes back to the agent to fix; a quiet agent gets a nudge.
  5. await returns a typed value, and your code decides what happens next.

awf run ./workflow.ts runs the workflow, prints its result, and keeps a record of the run in .awf/runs. How it works has the rest.

Built for agents to write ​

Your coding agent writes the workflow. Every page here is also Markdown for it to read, and the API is one page. After a change it runs the typechecker and awf test, which catch its mistakes before any agent starts. What it writes is agents, prompts, schemas and plain for and if, so you can review it in a minute: Quick start says what to check.

Write the workflow with a frontier model, then run it on cheaper or open-weight ones: each agent's model is one line, and Cost shows what the change did to a run.

Open, and shaped by use ​

  • Open source. MIT licensed, on GitHub.
  • In its evaluation phase. The design is still moving, and what people build with it decides where it goes. Hit a bug, missing a use case, or have a better idea for the design? Open an issue.
  • What runs today and what is next: status.
  • How it is tested: the test levels, from free to live agents. What was measured: findings.

Your first workflow ​

The quick start takes you from install to a first run and its result.