You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue gathers all known performance issues that are NOT due to edge-cases.
If your workflow performs well in most cases, but hits performance problems in some cases, please open a separate issue, and optionally link it here.
Known bottlenecks
Replay invocation overhead
Between every step, the workflow enqueues an event replay. This means invocation overhead, queue overhead, and initial state fetching overhead on each step call.
Events come with user payloads, which the World backend may choose to resolve lazily, requiring further network roundtrips, usually when the user payload is large
Keeping your step inputs/outputs small is the best way to reduce network overhead here at this point in time
Using DurableAgent/WorkflowAgent will almost certainly result in large step inputs/outputs as the full conversation needs to be passed to/from the LLM. This can be reduced to some extent.
Consider turning off the collectUIChunks option if don't need it
All step inputs, outputs, and hook inputs need to be serialized and loaded on every replay. Many common operations e.g. passing step outputs into new steps frequently when modifying a large data structure, accumulate copies of this data structure, which can easily lead to
When a step output is passed as a step input, or similar re-use of payloads, the runtime should detect this and de-duplicate by passing references only. This requires further thinking and is not currently in progress.
Alternatively, the runtime could store diffs only, and merge them at replay time. This requires further thinking and is not currently in progress.
Cold starts
Workflow "use workflow" and "use step" functions get bundled separately (< 5.0.0-beta.5) or as one bundle (>= 5.0.0-beta.5), each of which can incur cold starts separate from the API bundles that start the workflows.
On Vercel, using Fluid compute (highly recommended) will intelligently pre-warm your functions (and reduce costs)
Use >= 5.0.0-beta.5 to half the amount of bundles that need to be warm
Cross-region networking
Your app, workflow runtime, and DB should all run in the same network region.
As of May 5, 2026, workflows run against iad1 (us-east), so it's recommended to run your workflow-enabled app and the connected databases or other services in the same region. See #1931 for updates.
A note on pre-releases
Performance improvements go through a QA phase before being released as 5.x..x-beta releases currently. If you want the latest improvements now, considering using pre-releases (nightly build) by installing tarballs from https://workflow-tarballs.labs.vercel.dev/
This issue gathers all known performance issues that are NOT due to edge-cases.
If your workflow performs well in most cases, but hits performance problems in some cases, please open a separate issue, and optionally link it here.
Known bottlenecks
Replay invocation overhead
Between every step, the workflow enqueues an event replay. This means invocation overhead, queue overhead, and initial state fetching overhead on each step call.
>=5.0.0-beta.5removes 90%+ of this overhead ([core] Combine flow+step bundle and process steps eagerly #1338), but still spawns new invocation for:await Promise.allcalls)Replay event fetching overhead
>=5.0.0-beta.5ensures only new events are fetched in many cases, instead of re-fetching all events>=5.0.0-beta.16([world-vercel] Switch event endpoints to v4 wire format #2055) reduces the network overhead for large payloads considerablycollectUIChunksoption if don't need itEvent payload overhead
Cold starts
Workflow "use workflow" and "use step" functions get bundled separately (<
5.0.0-beta.5) or as one bundle (>=5.0.0-beta.5), each of which can incur cold starts separate from the API bundles that start the workflows.The best ways to reduce this overhead are:
sourcemapoption in builders #1842)>= 5.0.0-beta.5to half the amount of bundles that need to be warmCross-region networking
Your app, workflow runtime, and DB should all run in the same network region.
As of May 5, 2026, workflows run against
iad1(us-east), so it's recommended to run your workflow-enabled app and the connected databases or other services in the same region. See #1931 for updates.A note on pre-releases
Performance improvements go through a QA phase before being released as
5.x..x-betareleases currently. If you want the latest improvements now, considering using pre-releases (nightly build) by installing tarballs from https://workflow-tarballs.labs.vercel.dev/