Encryption in the event log
Durability depends on an event log that records step arguments and return values so a run can resume after a crash or deployment. That log can hold sensitive material — customer data, model context, credentials, tool-call results — so v5 encrypts every payload end to end before it leaves your code. Workflow and step inputs and outputs, hook payloads, and stream data are protected with AES-256-GCM under a unique key per run. With encryption on, any Workflow SDK backend, Vercel included, stores only ciphertext; plaintext is decrypted in your deployment or in authorized observability tools.
On Vercel this requires no setup and no code changes. Each run's key is derived from a deployment-scoped key, so a run can only decrypt its own data, and application logic stays as it is:
workflows/onboard-customer.ts
export async function onboardCustomer(
customer: Customer,
) {
"use workflow";
// The customer record is stored
// encrypted in the event log
const account = await createAccount(customer);
await sendWelcomeEmail(account.email);
return account.id;
}
async function createAccount(
customer: Customer,
) {
"use step";
// ...and arrives here decrypted,
// inside your deployment
return db.accounts.create(customer);
}
Because Vercel manages keys by default, observability is unaffected: names, timings, and statuses remain visible. Payloads can be decrypted in the dashboard or the CLI — in your browser or terminal, under the same permissions as the project's environment variables, with every request written to the team audit log.
# Payloads show as 🔒 Encrypted
npx workflow inspect run <run-id>
# Decrypts locally, if you have access
npx workflow inspect run <run-id> --decrypt
Self-hosted Worlds and cross-run writes
Encryption lives in the SDK, so self-hosted Worlds can protect payloads before they reach storage, queues, or streams. A custom World implements getEncryptionKeyForRun() with its own key management, returning the same 32-byte key for a given run on every call so the SDK can encrypt new payloads and decrypt them during replay:
world.ts
import type { World } from "@workflow/world";
type RunKeyProvider =
World["getEncryptionKeyForRun"];
export const getEncryptionKeyForRun:
RunKeyProvider = async (run) => {
const runId =
typeof run === "string" ? run : run.runId;
// Return the same 32 bytes for a run
// every time, so replays can decrypt
return keyStore.getRunKey(runId);
};
Cross-run writes are sealed as well. Resuming another run's hook, starting a run in a different deployment, or writing into a forwarded stream encrypts the payload to the target run's public key, so the writer never needs to read that run's existing payloads. Retention is also configurable: with experimental_retention: 0, inputs, outputs, and stream contents are deleted the moment a run completes or fails, while the run's metadata stays visible in observability.
Observability and regional placement
The trace viewer has been redesigned with span search, zoom, a minimap, and local inspection during development. v5 also introduces run attributes: searchable, plaintext context such as an order ID that you can use to find runs. Since attributes are plaintext, they should not hold secrets.
v4 pinned every run to iad1, so a step executing in any other region made cross-region requests to record its progress. v5 runs Workflow infrastructure in every Vercel Function region, and each run has a home region serving its state, queue dispatch, and streams without round trips on the hot path. A run starts in the region of the function that starts it, so a multi-region deployment keeps runs near the users who trigger them:
app/api/checkout/route.ts
import { start } from "workflow/api";
import { processOrder } from "@/workflows/process-order";
export async function POST(request: Request) {
const order = await request.json();
// Runs in the region that served this request
const run = await start(
processOrder,
[order],
);
return Response.json({ runId: run.runId });
}
Passing a region to start() places a run elsewhere — next to the database it reads and writes, or in a region where customer data must stay:
app/api/checkout/route.ts
// Keep this customer’s run data in Frankfurt
const run = await start(
processOrder,
[order],
{ region: "fra1" },
);
The region option governs where a run's data lives; steps execute where the app is deployed, so deploy there as well to have them run in that region. Existing v4 runs remain in iad1.
Reliability and performance
Regional isolation also helps availability: a disruption in one region need not halt new runs in healthy ones. Where Vercel Function failover is configured, steps can execute in a fallback region while state stays pinned to the run's original home region — it does not migrate. Anonymized telemetry and customer collaboration surfaced dozens of rare runtime bugs and race conditions, now fixed, and the SDK self-recovers from more classes of intermittent network errors. The result: almost no runs fail or stall because of a platform or runtime bug.
v4 paid a queue hop to start each step and another to continue the workflow — tolerable for slow automations, costly for agent loops with thousands of sequential events, high-throughput token streams, and tool chains. v5 rewrites large parts of the engine to cut queue hops, networking, and CPU work: an invocation can run several steps inline, including parallel ones, before yielding for a wait, a hook, or an approaching timeout, and step creation is folded into execution. Measured across the benchmarked workloads, latency and overhead improved 1.6× to 25×, with no major breaking changes.
Against v4.8.12 on Vercel, v5.2.0 shows the following. In a five-step benchmark, p75 step-to-step overhead fell from 618 ms to 109 ms. In a 1,020-step benchmark, v4's p75 overhead grew with the event log, reaching 1,748 ms in the final sampled range; v5 held it to 70 ms, and median time to finish all 1,020 steps dropped from 21.0 minutes to 3.0 minutes.
On the Vercel World, v5.2.0 writes streams over WebSockets by default. Replaying a 52.4-second agent response, median delivery fell from 226.1 seconds to 53.5 seconds — a measure of delivery of the recorded response, not of model generation speed. Payload compression further shrinks stored and transferred data, with AI token streams averaging around 80% smaller.
These figures cover one workload in one region against the Vercel World; they indicate runtime overhead rather than predict every application's results. They were measured October 8, 2026, on Vercel production in iad1, each version in a separate deployment of the same app, with steps taking 1 KB of JSON in and out. Tails and the full methodology are in the performance documentation.
Measurement | v4.8.12 | v5.2.0 | Change |
|---|---|---|---|
First step, p75 | 418 ms | 172 ms | 2.4× faster |
Between steps, p75 | 618 ms | 109 ms | 5.7× faster |
Late-run overhead, p75 | 1,748 ms | 70 ms | 25× lower |
1,020 steps, median | 21.0 min | 3.0 min | 7× faster |
Resume, p75 | 699 ms | 425 ms | 1.6× faster |
Stream delivery, median | 226.1 s | 53.5 s | 4.2× faster |
Chunk trip time, p75 | 172 ms | 102 ms | 1.7× faster |
Runs with a chunk delayed >1 s | 6 / 10 | 0 / 10 | 100% fewer |
Worlds as the durability layer
Durable functions rest on a World: the interface for storing progress, dispatching work, and delivering streams. The same foundation now backs fx and durable-harness. Shared storage, queue, and streaming improvements benefit any World consumer, though optimizations inside the Workflow replay runtime apply to Workflow SDK only.
- Workflow SDK: durable application logic via
use workflowanduse step. - WorkflowAgent: an AI SDK agent loop inside a workflow with
@ai-sdk/workflow. - fx: embed and extend a native coding agent with libfx.
- durable-harness: durability beneath an existing harness, with support for Pi and OpenCode and experimental integrations for Claude Code and Codex in Vercel Sandbox.
- eve: agents with durable sessions powered natively by Workflow SDK and Worlds.
v5 also adds in-flight cancellation with AbortController, searchable run attributes, and more framework integrations. The v5 upgrade docs cover the changes; new projects install the SDK:
pnpm add workflow@latest
A Python SDK with the same durable workflows, steps, sleeps, and hooks is now in beta.
Built for Production
It also expanded the runtime's reach across languages and the ecosystem's embrace:
As part of this release, the TypeScript SDK has been graduated from alpha to beta, and the runtime now supports Python, Rust, Go and PHP as well. Version 5 is already available in the Vercel CLI, with a Cloud deployment story and simplified pricing tiers shipped alongside it. Catch up on the previous episodes at [the link in the post].



