Your AI agent is mid-task. It has called three tools, accumulated context, and is halfway through a multi-step workflow. The server restarts. The run dies. You start over from zero. This is not an edge case — it is the default failure mode for every async AI agent running on stateless infrastructure, and in 2026 most of them still have no answer for it.
Vercel’s Workflow Development Kit ships a fix that takes two string literals. The SDK just hit a broad public beta update — v5.0.0-beta.36, released July 22 — adding NestJS support, tighter run safeguards, and hook retention. It has been generally available since April 2026, has processed over 100 million runs across 1,500-plus customers, and the core mechanic has not changed: add "use workflow"
to any async function and it becomes durable.
Two Directives, No Infrastructure #
The Workflow Development Kit introduces two JavaScript string literal pragmas — identical in form to "use strict"
, but for durability. "use workflow"
marks the outer function. "use step"
marks individual units of work inside it. That is the entire API surface you interact with to get a production-grade durable execution system.
Under the hood, the runtime records every step, input, output, , and error in an event log. When a crash, deployment, or scale event hits, the runtime replays the log deterministically to reconstruct state. The workflow resumes from the last successful step — not from line one. Each step also compiles into an isolated API route, so the parent workflow suspends with zero compute cost while the step runs. No queues to provision. No YAML state machines. No Kubernetes operator.
export async function processOrder(orderId: string) {
"use workflow";
const inventory = await checkInventory(orderId);
const payment = await chargeCustomer(orderId);
await sendConfirmation(payment);
}
async function checkInventory(id: string) {
"use step";
return await db.inventory.check(id);
}
async function chargeCustomer(id: string) {
"use step";
return await stripe.charge(id);
}
If chargeCustomer
throws on the first attempt, the Workflow Dev Kit retries it up to three times automatically. If the server dies between checkInventory
completing and chargeCustomer
starting, the workflow resumes exactly there — inventory check is not re-executed, and you are not double-charged. This is the class of problem that used to require Temporal, a dedicated worker fleet, and a week of architecture meetings.
AI Agents That Survive Deploys #
The SDK’s WorkflowAgent
— the flagship addition in AI SDK v7, shipped June 25 — applies the same model to LLM-driven agent loops. Every tool call becomes a durable step. Every LLM completion is persisted. When the process crashes mid-agent-run, it resumes from the last completed tool call, not from the user’s original prompt. Clients can reconnect to a run’s stream at any time; the stream is not lost with the process. Human-in-the-loop approval flows that need to survive days work correctly because the agent simply s, releases compute, and waits.
import { WorkflowAgent } from "@vercel/ai-sdk";
const agent = new WorkflowAgent({
model: openai("gpt-5"),
tools: { searchFlights, bookFlight, sendConfirmation },
});
Each tool in that object, if marked with "use step"
, is now retryable, observable, and persisted independently. That is the difference between a demo agent and a production agent.
What the July 2026 Update Adds #
The v5.0.0-beta.36 release focuses on NestJS users and baseline safety. Specifically:
NestJS support: A newworkflow-nest build --vercel
command emits a Vercel Build Output API directory, enabling NestJS apps to deploy on Vercel with the Workflow Dev Kit. Note the breaking change:NestLocalBuilder
moved from the package root to@workflow/nest/builder
, so importingWorkflowModule
no longer pulls the build toolchain into the runtime bundle.Run safeguards now default: TheWORKFLOW_PRECONDITION_GUARD
event-creation guard is enabled by default. Runs are capped at 25,000 events each. Terminal run protections blockhook_received
events from landing on completed runs — a common source of ghost state in long-running workflows.Hook retention: Configurable minimum retention periods for Hook tokens after run completion — useful for workflows that need to be observable after they finish.Performance: Stream writing now batches chunks, replay payload preparation runs concurrently, and decompressed representations are cached. All meaningful for high-throughput agent workloads.
The concurrent v4.6.1 release addresses reliability across Next.js, SvelteKit, and Nitro integrations, adds base-path-aware routing, and exposes health checks on workflow routes.
Not Experimental, Not Vercel Lock-In #
One hundred million runs since October 2025 is a number worth taking seriously. The Workflow Dev Kit is open source, runs on any platform through a “Worlds” adapter system, and the community has already shipped adapters for Postgres, Redis, Turso, Jazz Cloud, and Cloudflare. If you are running heavy event sourcing or need weeks-long human-in-the-loop s with complex backoff trees, Temporal is still the right call. For TypeScript-native applications on Next.js, SvelteKit, or now NestJS — the Vercel Workflow Development Kit’s tradeoff is straightforwardly correct.
Getting Started #
Install the SDK and the Vercel world adapter:
npm install @vercel/workflow @vercel/workflow-world
The July 2026 changelog covers upgrade steps for existing users. Full documentation including the AI agent guide is at workflow-sdk.dev.
Two string literals separate an agent that dies on redeploy from one that resumes from the last completed step. That is a genuinely good ratio of effort to reliability gained.