Back Home

推論系統

Vercel Cuts Agent Step Waits; Check Retries and Backend Before Upgrading

Official benchmarks for Workflow SDK 5.8 show reduced scheduling waits and extra function time in multi-step tasks. Actual gains still depend on workload, safe retry design, and backend support.

Sacamol · CC BY-SA 3.0 · Image source
zh-Hant

Developers using Workflow SDK to connect models and tools may now be able to reduce the wait between each agent step. On November 25, Vercel released a new execution engine in version 5.8. In an official comparison of 5.2.0 and 5.8.0, p75 overhead between steps fell from 85 milliseconds to 7 milliseconds. This improves workflow execution mechanics; it should not be read as model generation or the entire agent becoming twelve times faster. Official announcement

Workflow SDK lets developers write workflows in asynchronous JavaScript that can continue running after crashes, deployments, or long waits. This is useful for agents that need multiple rounds of model and tool calls, but the workflow itself also adds scheduling overhead. Background on version 5

Look at wait time and function time separately

In the official 256-step parallel test, extra latency fell from 13.5 seconds to 2.5 seconds. After subtracting the work performed by the steps, the median cumulative function time per run fell from 1,446 seconds to 105 seconds. The latter adds together execution time across multiple functions, so it differs from the elapsed time users wait for a task to finish. Parallel test results

A five-round streaming test that more closely resembles agent usage showed p75 extra overhead falling from 3,023 milliseconds to 912 milliseconds, with 15 runs per version. p75 means that three quarters of samples were at or below that value. These figures measure the execution engine’s overhead, not model inference performance. Agent test

The official methodology used the iad1 region in Vercel’s production environment and managed World. Each step used 1 KB JSON inputs and outputs, performed 100 milliseconds of simulated work, and then excluded that work time from the measurement. The documentation also cautions that results vary by region, backend, and workload. It is therefore reasonable to infer that workflows with many short steps are more likely to benefit substantially; if most time is spent on model generation, the overall improvement will be smaller. The sources above do not include a comparison of actual bills, so the reduction in function time should not be treated as a direct discount on costs. Measurement method and limitations

Before speeding things up, make sure retries won’t charge twice

Several benefits of the new version rely on “speculative execution,” which the official guidance limits to steps that are safe to run more than once. This requires steps to be idempotent: repeating the same operation should have the same effect as running it once. New engine requirements

For example, if a payment succeeds but the response is lost because of a network failure, a retry should not charge the customer again. The SDK’s stepId remains the same across retries and can be passed to external APIs that support idempotency keys to identify and reject duplicate requests. Idempotency design

For operations that are not safe to repeat, the official guidance is to set maxRetries = 0 to opt out of speculative execution and retries. This also means there will be no automatic retry after a failure. Ordinary steps retry up to three times by default, so check side effects such as payments, email sending, and data writes before upgrading. Release notes, retry rules

For self-hosted backends, upgrading the package isn’t enough

After upgrading to [email protected] or later, new tasks use the new engine by default, while tasks already in progress keep their existing version. Vercel says the Worlds it maintains are supported. Third-party Worlds must support spec version 9; otherwise, new tasks will continue to use the old engine. Upgrade requirements

World is the backend interface responsible for workflow storage, step queues, and data streaming. Supporting the new version involves contracts for write coordination, scheduling order, and queue deduplication. For teams running their own backend, confirming that the implementation supports the new version is as necessary as updating the package to get these benefits. Backend implementation documentation

Sources

  1. Workflow is 10x faster, again
  2. Workflow SDK 5: built for production
  3. Performance
  4. Idempotency
  5. Errors & Retrying
  6. Building a World