Skip to content

WIP [DO] Durable Objects preShutdown hook - #32877

Draft
iglesiasbrandon wants to merge 1 commit into
productionfrom
docs/durable-objects-pre-shutdown-hook
Draft

WIP [DO] Durable Objects preShutdown hook#32877
iglesiasbrandon wants to merge 1 commit into
productionfrom
docs/durable-objects-pre-shutdown-hook

Conversation

@iglesiasbrandon

Copy link
Copy Markdown
Collaborator

Summary

⚠️ WIP — do not merge. Documents the proposed Durable Objects preShutdown() best-effort shutdown hook. This is drafted ahead of the feature shipping and depends on two open decisions:

  • Method identity is not finalized. This PR documents the plain named method preShutdown(info). An alternative proposal (a cloudflare:workers-exported symbol, invoked as [shutdown](info)) is still under discussion with no resolution yet. If that direction is chosen instead, the API reference section in api/base.mdx needs a structural rewrite, not a rename.
  • The feature itself is still gated off and partially implemented. Only the idle-eviction shutdown path is wired up so far; the code-update path is a follow-up. The feature is behind a disabled-by-default kill switch.

Files changed:

  • docs/durable-objects/api/base.mdx — new preShutdown method reference (signature, parameters, guarantees, TS + Python examples)
  • docs/durable-objects/concepts/durable-object-lifecycle.mdx — new "Shutdown notifications" section describing which shutdown causes trigger the hook
  • partials/durable-objects/working-without-shutdown-hooks.mdx — updates the existing guidance, which currently states shutdown hooks "are not provided"
  • docs/durable-objects/best-practices/rules-of-durable-objects.mdx — best-practice example showing preShutdown() used to reduce (not replace) checkpoint frequency

Documentation checklist

@github-actions github-actions Bot added product:durable-objects Durable Objects: https://developers.cloudflare.com/workers/learning/using-durable-objects/ size/m labels Aug 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/durable-objects/ @elithrar, @rita3ko, @irvinebroque, @vy-ton, @iglesiasbrandon, @joshthoward, @danlapid, @lambrospetrou, @mikenomitch, @cloudflare/product-owners
/src/content/partials/durable-objects/ @elithrar, @rita3ko, @irvinebroque, @vy-ton, @iglesiasbrandon, @joshthoward, @danlapid, @lambrospetrou, @mikenomitch, @cloudflare/product-owners

@iglesiasbrandon iglesiasbrandon changed the title [Workers] Document Durable Objects preShutdown hook (WIP) WIP [DO] Durable Objects preShutdown hook Aug 20, 2026
@bogdanchodkowski308-lab

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:durable-objects Durable Objects: https://developers.cloudflare.com/workers/learning/using-durable-objects/ size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants