Declare Durable Object class lifecycle with exports
Cloudflare introduced a new declarative exports field in Wrangler configuration that replaces the imperative migrations array for managing Durable Object class lifecycle. The exports approach eliminates the need to maintain historical migration chains, provides structured deployment output for create/update/delete/rename/transfer operations, and supports zero-downtime patterns while preventing breaking changes across dependent Workers.
A new declarative exports field in your Wrangler configuration file replaces the imperative migrations array for managing Durable Object class lifecycle. Instead of writing an ordered list of migration steps with unique tags, you declare each Durable Object class your Worker exports and Cloudflare compares that against what's already deployed to determine what Durable Object state needs to be created, renamed, or deleted.
With legacy migrations, renaming ChatRoom to Room requires retaining both tagged steps:
{
"migrations": [
{ "tag": "v1", "new_sqlite_classes": ["ChatRoom"] },
{
"tag": "v2",
"renamed_classes": [{ "from": "ChatRoom", "to": "Room" }],
},
],
}
With exports, you instead declare Room as the current class and mark ChatRoom as renamed:
{
"exports": {
"ChatRoom": {
"type": "durable-object",
"state": "renamed",
"renamed_to": "Room",
},
"Room": { "type": "durable-object", "storage": "sqlite" },
},
}
Each entry is keyed by class name. The state field carries the lifecycle (created by default — a live class — plus tombstone states deleted, renamed, and transferred, and the expecting-transfer receiving state for cross-Worker transfers).
Key improvements over the legacy migrations array:
- No migration tags. The current
exportsmap is the source of truth — there is no historical chain ofv1,v2,v3entries to maintain. - Structured deployment output. Wrangler reports when it creates, updates, deletes, renames, or transfers Durable Object classes. It also identifies stale configuration entries that are safe to remove. Deployments with no changes or notices do not print this output.
- Zero-downtime rename and transfer patterns are first-class. Tombstones may coexist with the source class still in code, enabling a three-deploy rename and a four-deploy cross-Worker transfer without runtime errors during the rollout window.
- Cross-Worker safety. When you delete or rename a class, Cloudflare lists every other Worker in your account whose bindings still reference the namespace, so you can redeploy them before the change goes live.
Existing Workers using the legacy migrations array continue to work unchanged. To move to exports, refer to the migration guide. exports and migrations are mutually exclusive within a single Worker.
For the full reference, refer to Durable Object class exports.
Source: original entry ↗
More from Cloudflare
Follow Cloudflare to get its new changes in your feed and email digest.
Cloudflare One Client for Windows hotfix - trusted certificate chains
A new GA release for Windows Cloudflare One Client is available, addressing an issue with building trusted certificate chains.
Cloudflare One Client for macOS - Trusted Certificate Chain Fix
A new GA release of the macOS Cloudflare One Client is available. This hotfix addresses an issue with building trusted certificate chains.
Cloudflare One Client for Linux
A new GA release of Cloudflare One Client for Linux is now available. This hotfix addresses an issue with building trusted certificate chains.