# Workflow is 10x faster, again

> Source: <https://vercel.com/changelog/workflows-speculative-execution>
> Published: 2026-11-25 00:00:00+00:00

**Key takeaway:** Upgrading to workflow@5.8.0 cuts p75 step-to-step overhead from 85 ms to 7 ms and a 256-step fan-out's added overhead from 13.5 seconds to 2.5 seconds, but only for idempotent steps or those marked maxRetries = 0.

[Workflow SDK](https://workflow-sdk.dev) 5.8 runs workflows on a new execution engine, rebuilt for performance. Step-to-step latency is 12x lower, and large fan-outs, like running 256 steps in parallel, use 14x less function time outside your step code. This directly improves turn times for [durable AI agents](https://vercel.com/blog/making-every-harness-durable), among many other improvements.

To get the new engine, upgrade to `workflow@5.8.0` or later. New runs will use the new engine by default, and runs already started on an older version will safely keep running on that version. Make sure your steps are [idempotent where possible](#speculative-execution-for-retryable-steps) to get the most out of this upgrade.

In our [benchmarks](https://workflow-sdk.dev/docs/performance) comparing `5.2.0` to `5.8.0`, p75 step-to-step overhead fell from 85 ms to 7 ms. The median run, including 102 seconds of step work, finished in 111 seconds instead of 3.0 minutes. Running 256 parallel steps in a fan-out added 5.5× less overhead, 2.5 seconds instead of 13.5 seconds, and the median run spent 14× less time in functions beyond the steps' own work, 105 seconds instead of 1,446. A five-turn agent loop that streams its tokens through durable streams and calls tools added 0.9 seconds of overhead instead of 3.0 seconds, 3.3× less. Consult the [benchmarks page](https://workflow-sdk.dev/docs/performance) for how we measure these numbers.

Resuming after 1 second idle time went from 425 ms to 184 ms, 2.3× faster. Resumptions more than 5 seconds out might see slightly larger overhead. You can choose to [keep functions warm for longer](https://workflow-sdk.dev/docs/configuration/runtime-tuning#workflow_orchestrator_hook_linger_ms) to optimize time-to-resume at the cost of additional compute time.

Many of the above benefits rely on speculative execution of Steps. Only Steps that are idempotent can be run in this way. A step that passes its `stepId` as an [idempotency key](https://workflow-sdk.dev/docs/foundations/idempotency#step-idempotency), like the Stripe charge below, is already safe and needs no changes. If your step is sensitive and can't be retried, mark it with [`maxRetries = 0`](https://workflow-sdk.dev/docs/foundations/errors-and-retries) to opt out and ensure it still runs at most once.

You should already be making Steps idempotent wherever possible, or flag them with `maxRetries = 0`, to ensure Workflow SDK doesn't re-run your Steps when it's not safe to do so.

Upgrade to `workflow@5.8.0`. To keep creating runs on the previous engine after upgrading, set [`WORKFLOW_SPEC_VERSION=8`](https://workflow-sdk.dev/docs/configuration/runtime-tuning#workflow_spec_version). If you're on 4.x, start with the [upgrade guide](https://workflow-sdk.dev/docs/whats-new), since v5 is a major release.

**Using a third-party World?** All [Worlds maintained by Vercel](https://workflow-sdk.dev/worlds) already support the new engine. A third-party World needs to [support World spec version 9](https://workflow-sdk.dev/worlds/building-a-world#supporting-spec-9-runs-experimental) before upgrading gives you any of these improvements. Until it does, new runs keep using the previous engine.
