Cloudflare Workers now allow pending work to continue for as long as 20 minutes when the runtime is updated, up from the previous 30‑second window. Engineers who rely on long‑running HTTP requests, AI streaming, or persistent WebSocket connections should note that updates will no longer cut these operations off as quickly.
What Changed in the Runtime Update Process
When a new runtime version becomes ready, new HTTP requests are routed to it immediately. Existing processes that are still running the older version stop accepting new traffic but keep handling any in‑flight requests. Each of those processes now enjoys a grace period of up to 20 minutes before any remaining work is forcibly terminated.
Impact on Long‑Running Workloads
The extended window directly benefits workloads that naturally exceed a few seconds, such as:
- AI inference endpoints that stream results back to the client.
- WebSocket‑based applications that maintain open, bidirectional channels.
- Any HTTP handler that performs extended processing before responding.
During the grace period, the older runtime continues to serve those requests, while the newer runtime handles fresh traffic. Once the period expires, any request or connection still attached to the old process is terminated.
Operational and Design Considerations
Even with a longer grace period, engineers should design for interruption:
- Reconnect logic: WebSocket clients must be able to detect a disconnect and re‑establish the session.
- Idempotent retries: HTTP clients should safely retry failed calls, preserving any side‑effects.
- State persistence: Applications should store intermediate state externally so that a restart can resume work without loss.
- Hibernation awareness: Connections using the WebSocket Hibernation API may still drop before the grace period ends; handling such cases remains necessary.
These practices help ensure continuity regardless of when the runtime finally shuts down the old process.
Related CloudNinjas coverage: hands-on guides.
What This Means For Practitioners
From an operational standpoint, the longer grace period reduces the urgency of coordinating runtime updates with traffic spikes, but it does not eliminate the need for resilient client‑side logic. Teams should audit their Workers code for retry safety, verify that any long‑running state is externalized, and test WebSocket reconnection paths. Monitoring should include alerts for unexpected connection terminations that could indicate the grace period is being exceeded. By treating the extended window as a safety net rather than a guarantee, engineers can maintain high availability while still benefiting from faster runtime rollouts.


