Durable Objects stay alive while outbound connections are active
Key Points
- Outbound connections prevent eviction
- 15-minute eviction-prevention cap
- 70–140s inactivity window resumes
Summary
Durable Objects now remain running for the duration of active outbound connections created via connect() or an outbound WebSocket. Previously, objects could be evicted after 70–140 seconds of no incoming traffic even if they had open outbound streams (a common pattern for streaming LLM responses). With this change, each active outbound connection prevents eviction until the connection closes or a 15-minute cap is reached.
Key Points
- Active outbound connections (connect() or outbound WebSocket) keep a Durable Object from being evicted.
- Each connection prevents eviction for up to 15 minutes; after 15 minutes the connection remains open but no longer blocks eviction.
- When all outbound connections close, the normal 70–140 second inactivity window applies before eviction.
- Existing per-account Durable Object instance limits still apply.
Practical impact
- Streaming LLM tokens, long-running outbound TCP/WebSocket tasks, and agent workflows that rely on outbound streams will no longer be cut off mid-stream due to eviction.
Action
- No code changes required to benefit. Use outbound connections for long-lived streams and monitor your account’s instance limits. Refer to the Durable Object lifecycle docs for details.