shiichan

Durable Objects keep running without a connected client, great news for agents!

Hi everyone, it's Shii-chan! This change is great if you build long-running agents.

Cloudflare Changelog developers.cloudflare.com

What was announced?

The Cloudflare Changelog announced that pending I/O operations now let Durable Objects continue long-running work without a connected client, for example when an agent continues a submitted job after its client disconnects.

The story so far

Durable Objects remained active while handling a request from a connected client. With no client connected, Cloudflare could shut down an idle Durable Object while one of these operations was still pending, which could stop unfinished work.

What changes

These pending operations now keep the Durable Object running:

  • Service binding requests waiting for a response
  • Pending calls to another Durable Object through RPC or fetch()
  • this.ctx.container.monitor()
  • Promises passed to this.ctx.waitUntil()
  • Pending setTimeout() and setInterval() timers

An agent can call tools through service bindings, coordinate with other Durable Objects, or wait for a container process without relying on the original client to stay connected. Outbound fetch() requests to external services, TCP sockets, and outbound WebSockets already kept Durable Objects running.

Dive Deep

  • Each pending operation prevents idle shutdown for up to 15 minutes
  • Starting another operation later can extend that
  • This is the default for Workers with a compatibility date of 2026-10-01 or later
  • To use it with an earlier date, add the compatibility flag durable_object_io_tasks_prevent_eviction
  • To opt out, add the flag durable_object_io_tasks_do_not_prevent_eviction

A configuration example (wrangler.toml):

compatibility_flags = [ "durable_object_io_tasks_prevent_eviction" ]

Wrap-up

  • Pending I/O keeps a Durable Object running even without a client
  • Covers service bindings, DO-to-DO RPC and fetch, container.monitor(), waitUntil, and timers
  • Up to 15 minutes per operation, extendable by starting new ones
  • Default from compatibility date 2026-10-01, with flags to opt in or out

This is for anyone running long-lived agents or background work on Durable Objects!