Run it
Build, deploy and operate
The repository root is an example application. The reusable World lives in packages/world-cloudflare. Deploy the minimal mode first, then add retained executors if you need them.
Start with the example
pnpm install
pnpm run build:workflow
pnpm exec wrangler devBuilding first generates the SDK workflow bundle and the package’s compiled output. Local execution can run flows in the main Worker without a dispatch namespace. The root README documents bindings, resource creation and the example HTTP routes.
The package remains private and unpublished. An npm name and licensing/release decisions are still open. Do not treat the docs as an announcement of a published package.
Know which config changes affect old runs
| Setting | What it controls | Operational rule |
|---|---|---|
| DEPLOYMENT_ID | The build identity stamped on new runs. | Match the actual retained route when using WFP. |
| EXECUTOR_ROUTES | Recorded deployment ID to executor script. | Keep old routes and scripts while runs still use them. |
| SHARD_EPOCHS | Time-based store, queue and index routing. | Append only. Coordinate activation across deployments. |
| LOCATION_HINT | Requested placement for new objects. | Not residency; does not relocate existing objects. |
| WORKFLOW_VM | Engine policy for new runs. | QuickJS is the default here; run context retains the choice. |
| WORKFLOW_ENCRYPTION_SECRET | Per-run payload key derivation. | Keep the secret for old runs; rotation is not supported. |
| WORLD_RPC_TOKEN | Optional remote World HTTP endpoint. | Endpoint is disabled without it. Keep it secret. |
Deploy state first, then the retained executor
Use the repository’s explicit configs. The main deployment supplies the Durable Object classes and namespaces. The executor config references those resources and contains the workflow bundle. Create the dispatch namespace and populate the release map before admitting runs that depend on it.
pnpm run build:workflow
pnpm exec wrangler deploy --config wrangler.jsonc
pnpm exec wrangler deploy --config wrangler.executor.jsonc \
--dispatch-namespace YOUR_NAMESPACEKeep history in shard epochs unchanged. Preserve retained RPC names. Never delete an old executor simply because a newer deployment is live; check whether any runs still require it.
Test the adapter, the SDK and the deployment
pnpm run typecheck
pnpm exec tsc --noEmit --noUnusedLocals --noUnusedParameters -p tsconfig.json
pnpm test
pnpm run test:e2e
# Documentation application
pnpm --filter world-cloudflare-docs typecheck
pnpm --filter world-cloudflare-docs build
pnpm --filter world-cloudflare-docs testUnit tests exercise state transitions and recovery. SDK contract/conformance coverage checks the adapter boundary. End-to-end lanes cover default, native, encrypted and spec-9 execution. Remote probes then test real Workers behavior that local workerd cannot establish.
Operational work still left
- Decide retention and cleanup for completed runs, permanent deduplication keys and orphaned R2 values.
- Implement a key-rotation strategy before needing one.
- Test behavior-changing retained-release rollouts and keep an explicit draining policy.
- Measure sustained completion throughput under your real step I/O and payload distribution.
- Review SDK upgrades. This adapter uses private build/runtime integration points and a native VM shim.
The design avoids running your own database server. It does not remove the need to operate the World.
Sources and implementation
Repository links may require access. Vercel links point to public source or published documentation. Logical API names do not establish backend internals.