Vercel Workflow SDK 5.8: Which Steps Are Safe to Run Early?

Vercel cut step-to-step overhead from 85 ms to 7 ms. See how speculative execution works, which steps need a retry policy, and how to roll out the upgrade.

Published

Vercel Workflow SDK 5.8: Which Steps Are Safe to Run Early?

Vercel Workflow SDK 5.8 cut the wait between steps from 85 ms to 7 ms in Vercel’s benchmark. Before upgrading, find the steps that charge a customer, send a receipt, or otherwise change something outside the workflow. Whether the engine can safely start those steps early depends on what happens if it calls them again.

Where the time went in 5.8

A durable workflow records progress so it can resume after an interruption. That bookkeeping shows up in the gap between the last line of one step and the first line of the next. If your agent streams a response, calls tools, and returns to the model, it pays for those handoffs throughout the turn. Here are Vercel’s measurements as of November 2026. November 25 release notes

What Vercel timedWorkflow 5.2.0Workflow 5.8.0
Gap between steps, p7585 ms7 ms
Overhead across a five-turn agent loop with streaming, p753,023 ms912 ms
Elapsed overhead for 256 parallel steps, p7513,534 ms2,466 ms
Function time beyond step work for those 256 steps, median run1,446 s105 s
From resuming a hook after 1 s idle to the next step starting, p75425 ms184 ms

The fan-out rows answer different questions. A caller waiting for all the branches saw about 2.5 seconds of overhead on 5.8. Across the functions doing that work, the runtime consumed 105 seconds beyond the steps themselves. The latter is the figure to consider when reviewing compute usage. To translate usage into cost on your plan, see Vercel pricing.

For a sense of elapsed time including the work, Vercel’s median long run took 111 seconds on 5.8 and 3.0 minutes on 5.2. Both included 102 seconds of simulated step work. If an external service takes most of your time, that portion remains in your latency budget.

How Vercel measured the gap

Vercel runs the same benchmark app on separate production deployments in iad1, using the managed Vercel World. It warms the deployments before collecting samples. The standard step exchanges 1 KB of JSON in each direction and does 100 ms of simulated work. Vercel excludes simulated work from overhead and pools samples across runs. At p75, three quarters of the samples fall at or below the reported value. The 5.2 step-gap and resume figures date to November 12, 2026. The other release figures date to November 24. Benchmark methodology

The streaming agent benchmark makes that subtraction concrete. Each version ran the loop 15 times with streaming. The simulated model streamed tokens, called two tools in parallel on each of the first four turns, then answered on the fifth. Vercel subtracted 900 ms of model and tool work on the critical path. The remaining 912 ms measures what the runtime added across the loop. A team seeing slow responses can use that distinction to decide whether to investigate model latency or the orchestration around its tools.

How a step starts before its record is durable

With speculative execution, the engine can begin an eligible step while the write recording its start is still in flight. On the Node.js engine, when nothing else can change the workflow’s next decision, the orchestrator can also pass an inline step’s result back to the workflow while its outcome is being saved. The writes still commit in order. Overlapping the work with those writes removes waits between steps. Runtime tuning

That overlap matters if the step reaches a payment service and the worker then loses confirmation. The payment may have succeeded. Another attempt must leave the customer with the same charge. This property is idempotency, and the receiving service has a part in it.

How a charge survives a lost response
Workflow step

chargeUser sends the payment request with its stepId.

The response is lost. The step retries with the same stepId.

Payment service

Stripe creates the charge under that idempotency key.

Stripe recognizes the key. The customer has one charge.

Keep a keyed payment retryable

In Vercel’s payment example, getStepMetadata() supplies an ID unique to this step invocation. It stays stable across retries and speculative re-execution. Pass it to the configured Stripe client as a request option, where Stripe can use it to deduplicate the charge. Step idempotency

TypeScript
import { getStepMetadata } from "workflow";

async function chargeUser(userId: string, amount: number) {
  "use step";
  const { stepId } = getStepMetadata();

  await stripe.charges.create(
    { customer: userId, amount, currency: "usd" },
    { idempotencyKey: stepId },
  );
}

An existing step that already does this can keep its retry policy. The key protects attempts at that particular step. If duplicate checkout requests can start separate workflow runs for the same order, address duplicate starts separately. Each run can reach its own valid payment step.

Give an unkeyed receipt one attempt

Vercel’s other example sends a receipt through SMTP. A mail server can accept the message before the sender gets confirmation, and SMTP has no idempotency key to pass back on another attempt. Set the retry policy on the step function itself. The snippet assumes your mail client is configured. Errors and retries

TypeScript
async function sendReceiptEmail(to: string, orderId: string) {
  "use step";
  await smtp.sendMail({ to, subject: `Your receipt for order ${orderId}` });
}

sendReceiptEmail.maxRetries = 0;

With zero retries the engine waits for the start to be recorded and runs the step at most once. If the attempt fails, the SDK leaves recovery of that send to you. If the outcome is ambiguous, check the mail provider’s record before resending.

Audit the steps before switching engines

  • Find each "use step" that writes outside the workflow. For an agent, follow each tool call down to the API or database operation it actually performs. The production agent guardrails playbook shows where to put that check.
  • Ask what a customer would see if the external write succeeded and its response vanished. Trace every side effect in the step. A keyed charge and an unkeyed receipt in the same function still leave the receipt exposed.
  • Where the receiver supports deduplication, verify that every attempt sends the same key for the same operation. Where a duplicate would be harmful and you cannot make the operation idempotent, isolate it in a step with maxRetries = 0 and decide who can reconcile a failure.
  • Keep retryable work eligible where it is safe. In Vercel’s agent benchmark, making a model step wait for its start record with maxRetries = 0 added about 70 ms per turn on 5.8.0. Agent benchmark

Upgrade without stranding active runs

For an application already on 5.2, install workflow@5.8.0 or later and deploy it. To install the release Vercel benchmarked, use the command below. If you are on 4.x, start with the major-version migration guide.

Bash
npm install workflow@5.8.0

A World is the backend that provides the workflow’s queue and durable storage. Vercel’s maintained Worlds support the new engine. For a third-party World, check support for World spec version 9 before expecting the release’s gains. World implementation guide

Each run keeps the engine it starts withHow the SDK and World select the execution model during rollout
Already running
Started on an older versionContinues on that version through completion.
New runs after the upgrade
Compatible WorldUses the new engine by default.
Third-party World without spec 9Continues to create runs on the previous engine.
Spec pinned to 8Creates runs on the previous engine by choice.

As of Nov 27, 2026 · Source: Vercel Workflow changelog and runtime tuning guide

If several deployments or worker processes share a World, set WORKFLOW_SPEC_VERSION=8 on the upgraded processes while you bring them all to 5.8.0 or later. Once they are ready and your steps are safe, remove the pin to enable the new engine for new runs. You can keep the pin if you need longer. Once spec 9 or later runs exist, keep the upgraded SDK in place because older releases fail writes to those runs. Spec version settings

One setting deserves a separate decision for approval workflows. Vercel’s 184 ms resume figure followed a one-second pause. A hook resumed after more than five seconds may incur more overhead. If fast resumption matters, WORKFLOW_ORCHESTRATOR_HOOK_LINGER_MS controls how long the idle orchestrator stays live for open hooks, capped by WORKFLOW_ORCHESTRATOR_LINGER_MS. A longer window spends more compute waiting for a reply. Hook linger settings

Published
Category
Build
Related Articles
Claude Agent Teams: Setup, Use Cases and Limits

Claude Agent Teams: Setup, Use Cases and Limits

Enable Claude Code agent teams, split a review across sessions, and choose when peer discussion earns the extra usage. Includes setup and recovery steps.Nov 27, 2026Build
Odysseus AI: The Official Repository, What It Does, and How to Start

Odysseus AI: The Official Repository, What It Does, and How to Start

Find PewDiePie’s official Odysseus repository and demo, see how local and external models connect, and start the workspace with its Docker commands.Nov 27, 2026Build
Boris Cherny and How He Uses Claude Code

Boris Cherny and How He Uses Claude Code

How Boris Cherny created Claude Code, why he changed his mind about Plan Mode, and what developers can learn from his talks and interviews.Nov 27, 2026Build
Claude Code /ship

Claude Code /ship

Use /ship on your first branch, ask Claude to show its findings before it pushes fixes, and use /steward to watch checks and comments on an open PR.Nov 27, 2026Build
Anthropic's Python to Rust Migration: The Method, Step by Step

Anthropic's Python to Rust Migration: The Method, Step by Step

How Anthropic moved its Messages API from Python to Rust: the old service as the check, Claude agents fixing each difference, and a checklist to copy.Nov 26, 2026Build
NotebookLM API Guide to Notebooks, Sources and Audio Overviews

NotebookLM API Guide to Notebooks, Sources and Audio Overviews

Create a Gemini Notebook from code, add a source and see which Google API can generate an Audio Overview for a personal or business workflow.Nov 26, 2026Build
Grok API: Get a Key and Make Your First Request

Grok API: Get a Key and Make Your First Request

Get a Grok API key, send the official first request, choose a model, and see how billing and rate limits work when you call Grok from code.Nov 26, 2026Build
Claude Code Skills: Where They Live and How to Add One

Claude Code Skills: Where They Live and How to Add One

Add a Claude Code skill from a copyable SKILL.md example. See which copy wins, how slash commands work, and when a team can block inline shell commands.Nov 26, 2026Build
Newsletter

One letter, every Sunday.Working systems, not hot takes.

Weekly. No spam. Unsubscribe anytime.