AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

durable-objects

Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.

Original source
cloudflare
License
Apache-2.0
Pinned revision
e44f580f9c4fa3bf268e284ae7706c7954ba31fd

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

Ask your assistant

Use Agentic Memory skills to read cloudflare--durable-objects at revision e44f580f9c4fa3bf268e284ae7706c7954ba31fd, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 5

references/rules.md

Durable Objects Rules & Best Practices

Choose one object per entity that needs coordinated state. Keep essential data in durable storage; in-memory state must be reconstructible. Prefer SQLite for new classes, and inspect the backend of existing classes before selecting APIs. For idle WebSocket servers, prefer hibernation and plan for state restoration.

Fetch the relevant current documentation before implementing or reviewing changes.

| Task | Documentation | |------|---------------| | Choose object boundaries, deterministic routing, parent-child relationships, or initialization | Rules of Durable Objects | | Choose SQLite or maintain an existing KV-backed class | SQLite storage API; Legacy KV storage API | | Review storage gates, external I/O races, transactions, or schema initialization | Rules of Durable Objects; SQLite storage API; Durable Object State | | Configure class lifecycle changes | Class exports; Legacy class migrations | | Set placement hints or jurisdiction constraints | Data location | | Create stubs, invoke RPC, or use HTTP handlers | Invoke methods; Namespace API | | Schedule per-object work and handle retries | Alarms | | Restore WebSocket connection state after hibernation | Use WebSockets | | Handle exceptions, restarts, and shutdowns | Error handling; Object lifecycle |

For verification, use Testing Durable Objects. Keep API signatures, configuration, limits, and implementation examples in the linked docs.