Workflow DevKit - Make any TypeScript Function Durable

2 min read Original article ↗

Workflow DevKit is in beta

use workflow brings durability, reliability, and observability to async JavaScript. Build apps and AI Agents that can suspend, resume, and maintain state with ease.

Reliability-as-code

Move from hand-rolled queues and custom retries to durable, resumable code with simple directives.

export async function welcome(userId: string) {
  "use workflow";
  const user = await getUser(userId);
  const { subject, body } = await generateEmail({
    name: user.name, plan: user.plan
  });
  const { status } = await sendEmail({
    to: user.email,
    subject,
    body,
  });
  return { status, subject, body };
}

Queueing the getUser step...

Effortless setup

With a simple declarative API to define and use your workflows.

Observability. Inspect every run end‑to‑end. Pause, replay, and time‑travel through steps with traces, logs, and metrics automatically.

Universally compatible. Works with the frameworks you already use with more coming soon.

Reliability, minus the plumbing

Start with plain async code. No queues to wire, no schedulers to tune, no YAML. Best‑in‑class DX that compiles reliability into your app with zero config.

See every step, instantly

Inspect every run end‑to‑end. Pause, replay, and time‑travel through steps with traces, logs, and metrics automatically captured — no extra services or setup.

A versatile paradigm

Workflows can power a wide array of apps, from streaming realtime agents, to CI/CD pipelines, or multi day email subscriptions workflows.

Build anything with

Build reliable, long-running processes with automatic retries, state persistence, and observability built in.

export async function aiAgentWorkflow(query: string) {
  "use workflow";

  // Step 1: Generate initial response
  const response = await generateResponse(query);

  // Step 2: Research and validate
  const facts = await researchFacts(response);

  // Step 3: Refine with fact-checking
  const refined = await refineWithFacts(response, facts);

  return { response: refined, sources: facts };
}

Get started quickly

See Workflow DevKit in action with one of our templates.

Create your first workflow today.

Get started