Vercel Workflow SDK 5.2.0 switches writes to WebSockets

Vercel's Workflow SDK now sends event writes and stream writes to Vercel Workflows over a WebSocket by default. The change arrives with [email protected] and does not require code changes for existing streaming code.
- Workflow SDK 5.2.0 sends event and stream writes over WebSockets by default.
- Existing streaming code works without changes after the upgrade.
- New runs use the upgraded transport after deployment, while in-flight runs stay on their starting deployment.
- Vercel reports a 4.2× faster full response in an AI token stream benchmark.
- The company says no benchmark chunk was delayed over a second.
WebSockets replace per-write HTTP requests
Previously, the SDK used one HTTP request for each event write, or one request for each write group when handling streams. With [email protected] or later, those writes use a WebSocket instead.
Event writes include every step start and completion. According to Vercel, workflows with many steps will therefore make fewer HTTP requests. The company says the resulting efficiency also improves performance and reduces costs.
Vercel says the queue handler opens the connection for every delivery. For streams, a burst of chunks, such as AI tokens, is sent over the WebSocket once it opens. Existing streaming code continues to work as is.
Upgrade activates the change for new runs
Adopting the new transport requires upgrading the package, with Vercel showing npm install workflow@latest as the installation command. No additional code change is needed beyond upgrading to version 5.2.0 or later.
After the upgraded version is deployed, new runs use WebSockets. In-flight runs finish on the deployment on which they started, so an active workflow does not switch transport because of the upgrade.
Vercel directs users to its World documentation for getting started. Users on the 4.x release line should begin with the upgrade guide because version 5 is a major release.
Vercel reports faster delivery for AI streams
Vercel measured the change in a benchmark that replayed an AI agent's token stream. The company says version 5.2.0, which writes streams over a WebSocket by default, delivered the full response 4.2× faster than version 4.8.12.
Vercel also reports that no chunk in the benchmark was delayed by more than a second. The result points to a specific benefit for workflows that produce many small writes in sequence, including streams of AI output.
For users, the update offers a transport change that can be adopted through a package upgrade while preserving existing streaming code. For applications with many workflow steps or streamed chunks, Vercel's stated benefits are fewer HTTP requests, faster delivery and reduced costs.
Vercel: Workflow SDK now writes over WebSockets on Vercel


