Vercel's Workflow SDK now writes events and streams over WebSockets, delivering an AI agent's token stream 4.2× faster
Synopsis
Starting with version 5.2.0, Vercel's Workflow SDK sends event writes and stream writes to Vercel Workflows over a WebSocket by default, replacing one HTTP request per write, or per write group for streams, with no code change beyond the upgrade. In a benchmark replaying an AI agent's token stream, v5.2.0, which writes streams over a WebSocket by default, delivered the full response 4.2× faster than v4.8.12, with no chunk delayed over a second.
Interpretation
The Workflow SDK now writes events and streams to Vercel Workflows over a WebSocket instead of issuing a separate HTTP request for each write. Previously, every event write, and every write group of a stream, required its own HTTP request. In a benchmark replaying an AI agent's token stream, v5.2.0, which writes streams over a WebSocket by default, delivered the full response 4.2× faster than v4.8.12, with no chunk delayed over a second.
Upgrading to workflow@5.2.0 or later enables the change, and existing streaming code works as is. A step that writes a burst of chunks, such as AI tokens, sends them over the WebSocket once it opens. After the upgrade is deployed, new runs use it, while in-flight runs finish on the deployment they started on.
Perspective
The demonstrated scope is the Workflow SDK on Vercel Workflows: after upgrading to workflow@5.2.0 or later, new runs use the WebSocket by default, and in-flight runs finish on the deployment they started on.
The 4.2× figure and the absence of any chunk delayed over a second come from one benchmark replaying an AI agent's token stream, and the material does not give the test's other conditions.
