The gap between an AI demo and a process you can rely on
AI can draft emails, read invoices and pull details out of documents. But a demo runs once, from start to finish, while someone watches. A business process runs hundreds of times, talks to systems that sometimes fail, and may have to wait days for a person to make a decision.
So what happens if a server restarts while a customer onboarding is half done? Does it start again and create a duplicate customer? Does it stop without telling anyone? Or does it carry on from where it left off?
On 12 November 2026 Vercel released Workflow SDK 5, the latest version of its toolkit for exactly this problem. We build on Vercel, so here is what the release changes and where it fits.
What a durable workflow is
A durable workflow records its progress as it goes. The result of each completed step is saved, so after a crash, a deployment or a timeout the run picks up where it stopped instead of starting over. It can also pause for an hour, for three days or until someone approves something, without keeping a server busy while it waits.
With Workflow SDK this is ordinary TypeScript. A function marked "use workflow" describes the process. Functions marked "use step" do the actual work, and the SDK retries them automatically if they fail.
An example: onboarding with an approval step
Here is a simplified version of a common onboarding process: create the customer, set up their access, wait for a manager to approve the commercial terms, then send the welcome email. It is illustrative rather than production code.
import { createHook, sleep } from "workflow";
export async function onboardCustomer(customer: NewCustomer) {
"use workflow";
const account = await createCrmRecord(customer);
await provisionAccess(account.id);
// Pauses here, without holding a server open, until someone approves.
using approval = createHook<{ approved: boolean }>({
token: `terms-approval:${account.id}`,
});
await notifyManager(account.id);
const decision = await Promise.race([
approval,
sleep("3d").then(() => "timeout" as const),
]);
if (decision === "timeout" || !decision.approved) {
await flagForReview(account.id);
return;
}
await sendWelcomeEmail(customer.email);
}
async function createCrmRecord(customer: NewCustomer) {
"use step";
// An upsert, so a retry finds the existing record instead of adding a second.
return crm.customers.upsert({ externalId: customer.id, ...customer });
}
And the endpoint that the manager's approval button calls:
import { resumeHook } from "workflow/api";
export async function POST(request: Request) {
await requireManager(request); // never resume a run for an anonymous caller
const { accountId, approved } = await request.json();
await resumeHook(`terms-approval:${accountId}`, { approved });
return Response.json({ ok: true });
}
Three things are worth noticing:
- A restart loses nothing. If the server restarts while the run is waiting for approval, the run resumes at the same point. The CRM record and the access set-up are not repeated.
- Durability doesn't make a step safe to retry. A step can fail after the CRM has created the record but before the result is saved. That is why
createCrmRecorduses an upsert keyed on the customer's ID rather than a plain insert. Payments and emails need the same care. - The approval endpoint is a way into your process. In a real system it checks who is calling before it resumes anything.
What's new in Workflow SDK 5
Encrypted workflow data
To be able to resume, a workflow stores the inputs and results of every step, and those often include customer details and documents. Version 5 encrypts that data with AES-256-GCM, using a separate key for each run. On Vercel this works without any set-up. Self-hosted installations have to provide their own keys.
There is one catch. The new run attributes (see below) are stored as plain text, so put an order number in them, never a customer's name or email address.
Lower overhead
Vercel reports improvements of 1.6× to 25× in latency and overhead between versions 4.8.12 and 5.2.0. These are Vercel's own figures, measured on one workload in one US region, and the largest applies to one specific kind of overhead. A workflow that spends ten seconds waiting for an ERP system will not become ten times faster.
Choosing where workflow data lives
Workflow infrastructure now runs in every Vercel Functions region, and each run has a home region. By default that is the region of the function that starts the run, and it can be set explicitly; Vercel's example is Frankfurt. The setting controls where the run's data is stored, not where your code runs, and the announcement does not mention a London region.
For UK GDPR this is only part of the picture. The AI providers, logs and other systems a workflow talks to matter just as much.
Easier to investigate
A redesigned trace viewer and searchable run attributes make it quicker to answer the question support teams always ask: what happened to this order? You can find a run by its order or customer reference and see whether it is waiting for approval, retrying a failed call or stuck.
Where it fits, and where it doesn't
Workflow SDK is a tool for developers, not a ready-made automation product. For a simple "when this happens, do that" between two popular apps, a low-code tool or an integration the software already offers is usually cheaper and quicker.
It earns its place when a process spans several systems, follows business rules, waits for people, runs over hours or days, or has to be audited. Our article on the five signs your business is ready for automation covers how to choose the first process worth automating.
The same applies to AI. In a workflow, the model reads the invoice or drafts the reply, and the workflow decides what happens next and when a person must approve it. A model should not approve a payment just because it can read the invoice. Our article on AI-assisted development explains how we use AI in our own engineering.
