Vercel's Workflow SDK now sends event writes and stream writes to Vercel Workflows over a WebSocket by default. A WebSocket is a long-lived connection that carries many messages, replacing one HTTP request per write. Vercel says the change applies once developers upgrade to version 5.2.0 or later.
No code changes are needed beyond the upgrade, Vercel says. Existing streaming code works as written, including steps that write bursts of chunks such as AI tokens. New runs use the WebSocket after deployment, while in-flight runs finish on the deployment they started on.
Vercel reports a benchmark that replayed an AI agent's token stream. The full response arrived 4.2 times faster than with version 4.8.12, and no chunk was delayed by more than a second.
Event writes also change. Every step start and completion counts as an event write, so workflows with many steps now make fewer HTTP requests. Vercel says this efficiency improves performance and reduces costs. The queue handler opens the connection for every delivery. Version 5 is a major release, so people on 4.x are pointed to an upgrade guide.
Source: Workflow SDK now writes over WebSockets on Vercel – Vercel.