Skip to content
Dashboard

A new programming model for durable execution

Head of Workflows

Vercel Workflows is the easiest way to write long-running, durable, reliable, and observable agents and backends.

The built in observability dashboard for Workflow SDK on Vercel.The built in observability dashboard for Workflow SDK on Vercel.The built in observability dashboard for Workflow SDK on Vercel.The built in observability dashboard for Workflow SDK on Vercel.
The built in observability dashboard for Workflow SDK on Vercel.

Link to headingBuilt for agents, backends, and long-running workloads

Link to headingHow it works

Link to headingThe programming model: your code is the orchestrator

export async function createSite(input: { userId: string }) {
"use workflow"
const profile = await fetchUserProfile(input.userId)
const plan = await generateSitePlan(profile)
const site = await buildSite(plan)
return site
}
async function fetchUserProfile(userId: string) {
"use step"
return db.user.findUnique({ where: { id: userId } })
}
async function generateSitePlan(profile: unknown) {
"use step"
return callModel({ prompt: `Generate a site plan for ${JSON.stringify(profile)}` })
}
async function buildSite(plan: unknown) {
"use step"
return provisionSite(plan)
}

A workflow that creates a site in three durable steps. "use workflow" marks the function as a workflow, and "use step" isolates each unit of work with automatic retries, persistence, and observability.

Link to headingVercel Workflows in action: Guillermo's infinite chess game

Link to headingWhy Workflows matters for agents

Link to headingSecure by default

Link to headingFor building agents

import { DurableAgent } from "@workflow/ai/agent";
import { getWritable } from "workflow";
import type { UIMessage, UIMessageChunk } from "ai";
export async function bookingAgent(messages: UIMessage[]) {
"use workflow";
const writable = getWritable<UIMessageChunk>();
const agent = new DurableAgent({
model: "anthropic/claude-haiku-4.5",
system: "You are a flight booking assistant.",
tools: { searchFlights },
});
await agent.stream({ messages, writable });
}
async function searchFlights(args: { from: string; to: string }) {
"use step";
const result = { flights: [{ from: args.from, to: args.to, price: 199 }] };
return result;
}

A booking agent that streams durable output to the client. Tools marked with "use step" get automatic retries and persistence.

// app/api/chat/route.ts
import { createUIMessageStreamResponse, type UIMessage } from "ai";
import { start } from "workflow/api";
import { bookingAgent } from "@/workflows/booking-agent";
export async function POST(req: Request) {
const { messages }: { messages: UIMessage[] } = await req.json();
const run = await start(bookingAgent, [messages]);
return createUIMessageStreamResponse({
stream: run.readable,
headers: { "x-workflow-run-id": run.runId },
});
}

The API route starts the workflow and returns the durable stream. The run ID enables reconnection.

"use client";
import { useChat } from "@ai-sdk/react";
import { WorkflowChatTransport } from "@workflow/ai";
export function BookingChat() {
const { messages, sendMessage } = useChat({
transport: new WorkflowChatTransport(),
});
// ...
}

The client reads the stream and resumes from where it left off if the connection is interrupted.

Link to headingFor agents to build with

npx workflow inspect runs <wrun_id>

npx skills add vercel/workflow

Link to headingRun Workflows anywhere

Link to headingHow Vercel customers use Workflows

Link to headingMux powers durable video and AI pipelines

The real complexity isn't the models, it's everything around them. Workflow SDK took a big chunk of that off our plate so we could focus on building the product.
Dylan Jhaveri Director of Self Service @ Mux

Link to headingDurable runs hundreds of AI agents for 3 million small businesses

Workflow gave our six engineers the ability to ship production AI infrastructure without ever hiring for infra.
Osama Kahn CPTO @ Durable

Link to headingFlora orchestrates creative AI agents across 50+ image models

We stopped having infrastructure debates and started having product debates.
Alec Jo Head of Applied AI @ FLORA

Link to headingWhat's next: Workflows 5 and Python support

Link to headingWorkflows 5

Link to headingPython support

from vercel.workflow import Workflows
wf = Workflows()
@wf.workflow
async def create_site(*, user_id):
profile = await fetch_user_profile(user_id)
plan = await generate_site_plan(profile)
return await build_site(plan)
@wf.step
async def fetch_user_profile(*, user_id):
return await db.user.find_unique(id=user_id)
@wf.step
async def generate_site_plan(*, profile):
return await call_model(
prompt=f'Generate a site plan for {json.dumps(profile)}'
)
@wf.step
async def build_site(*, plan):
return await provision_site(plan)

Link to headingGet started