durable-objects

Build and review Cloudflare Durable Objects for stateful edge logic.

2.6k|242|Updated Dec 10, 2025
One-click install
npx skills add https://github.com/cloudflare/skills --skill durable-objects-cloudflare
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: durable-objects
Source: https://github.com/cloudflare/skills/tree/main/skills/durable-objects
Command: npx skills add https://github.com/cloudflare/skills --skill durable-objects-cloudflare

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps developers design, implement, and review Durable Objects to coordinate stateful logic at the Cloudflare edge.

Core Features & Use Cases

  • Deterministic per-entity routing: guidance on using getByName to map input to a specific DO instance (e.g., per chat room, per game session, or per user).
  • Persistent state and scheduling: guidance on SQLite storage, migrations, and alarms for durable workflows.
  • Typed RPC-style APIs: guidance on using RPC methods over fetch handlers for robust, predictable endpoints.
  • Use case: real-time chat rooms and multiplayer game state synchronized at the edge.

Quick Start

Start by reviewing the Durable Objects references and examples, then initialize a DO in your environment and call a simple RPC-style method via getByName to store and retrieve state.

Frequently Asked Questions about durable-objects

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build stateful WebSocket connections with Cloudflare Workers?

Durable Objects enable stateful WebSocket connections in Cloudflare Workers by providing deterministic routing and persistent storage for real-time applications like chat rooms. This Skill guides you through connection handling, state synchronization, and edge deployment.

What is the best way to store per-user state at the edge?

Durable Objects provide the best way to store per-user state at the edge by mapping input to specific instances via getByName and using SQLite-backed storage. This Skill guides you through deterministic routing, migrations, and alarm scheduling.

How do I configure Wrangler for SQLite-backed Durable Objects?

Configuring Wrangler for SQLite-backed Durable Objects requires defining storage migrations and class bindings in your wrangler configuration file. This Skill provides references for setting up SQLite storage, managing migrations, and deploying stateful Workers.

Can I use RPC-style methods instead of fetch handlers in Workers?

Yes, you can use typed RPC-style methods instead of fetch handlers in Durable Objects to create robust and predictable endpoints. This Skill provides guidance on implementing RPC methods for stateful edge coordination.

Does Cloudflare Durable Objects support alarms for scheduled workflows?

Yes, Cloudflare Durable Objects supports alarms for scheduling durable workflows and managing persistent state over time. This Skill provides guidance on using alarms alongside SQLite storage to coordinate per-entity workflows.

When should I not use Durable Objects for stateful logic?

Avoid using Durable Objects when your application does not require deterministic per-entity routing, persistent state, or real-time WebSocket synchronization. This Skill helps review concurrency limits and best practices to determine if the approach fits your scale.