Self-hosting
Orchestate targets open-source workerd (Apache-2.0), including Cloudflare Workers in your own account. Machine definitions and the SDK remain the application interface; the SDK-facing HTTP API is served by the console, not directly by the runtime Worker.
Self-hosting requires the console, runtime and their supporting services to be configured together. A workerd-compatible artifact alone does not establish a fully offline deployment: storage, queues, service bindings and external integrations need environment equivalents and separate validation.
Why workerd (Apache-2.0)
Orchestate's engine is its own pure-TypeScript finite-state-machine implementation (workers/runtime/src/fsm.ts). It does not depend on any external state-machine vendor. The runtime Worker targets the open workerd engine — the same Apache-2.0 runtime Cloudflare Workers use — which means:
- No source-available trap — workerd is Apache-2.0; you can run it under terms that stay open.
- Same artifact everywhere — the Worker targets workerd; each deployment still needs its own bindings and supporting services.
- Customer-owned infrastructure — the self-host and air-gap paths sit behind your account, your bindings, and your access policy once configured.
Who it is for
Self-hosting is the customer-owned deployment option. It is designed for teams whose requirements rule out the multi-tenant hosted service:
- Air-gapped or isolated environments — evaluate a customer-owned Cloudflare account or a workerd environment. Fully offline operation requires validated replacements for connected services; this guide does not demonstrate an air-gapped deployment.
- Data-residency requirements — instance state stays in Durable Object storage within your own account; residency and any local workerd storage arrangement require separate validation.
- Enterprise governance — you own the deploy, the bindings, and the access policy around the runtime Worker.
Self-hosting is not a published public SKU. See the pricing page (private beta — request access) and contact us to talk about running the runtime in your own account or air-gapped.
Architecture
The runtime portion of a self-hosted deployment is a Worker named orchestate-runtime, designed to run on Cloudflare Workers or on open-source workerd. It registers three Durable Object classes, including MachineInstance, bound to the namespace MACHINE_INSTANCE. Each running machine instance is one Durable Object: the FSM's current state and context are persisted in that object's storage, so an instance keeps its place across requests and Worker restarts.
Your Orchestate console reaches the runtime through a Cloudflare service binding named RUNTIME (or the local workerd equivalent). When the console creates an instance, sends an event, reads state, or opens the live inspector WebSocket, it calls the runtime Worker over that binding, which routes the request to the correct MachineInstance Durable Object. The console serves the public API and enforces caller authentication and organization scope before forwarding requests. Runtime internal routes are a private control plane, not a public SDK endpoint.
- orchestate-runtime — the entry Worker; routes requests to instances.
- MachineInstance (bound as MACHINE_INSTANCE) — one Durable Object per instance; holds the authoritative state in DO storage.
- LeaseRegistry (LEASE_REGISTRY) and FleetHub (FLEET_HUB) — additional Durable Objects required by the current runtime configuration.
- RUNTIME — the console's service binding pointing at the deployed runtime Worker.
Note — the runtime matches the hosted service: it evaluates guard expressions; folds assign into context; runs entry / exit / transition action lists; executes log, http (SSRF-screened), and emit (signed webhooks); and supports after timers plus saga compensation. See Machine definitions for the full schema.
Prerequisites
- Runtime source access and a compatible console. Self-host access is private beta; start via contact.
- For Cloudflare, an account with Durable Objects, D1, R2, queues and the supporting dispatch Worker configured. Node.js and Wrangler are needed for the build tooling.
- Review the complete
workers/runtime/wrangler.jsoncfor your source revision and target environment. Supply your own resource identifiers; do not reuse hosted resource IDs. Preserve migration history for existing namespaces. - For local workerd, provide equivalent storage and service capabilities and validate integration dependencies separately.
wrangler devis a development tool, not proof of an offline deployment.
Configuration boundaries
Illustrative configuration only — this excerpt is not a complete deploy recipe. The current runtime uses compatibility_date 2026-07-15 with nodejs_compat. Start from the full configuration for your revision rather than deploying this excerpt:
{
"compatibility_date": "2026-07-15",
"compatibility_flags": ["nodejs_compat"],
"workers_dev": false,
"durable_objects": {
"bindings": [
{ "name": "MACHINE_INSTANCE", "class_name": "MachineInstance" },
{ "name": "LEASE_REGISTRY", "class_name": "LeaseRegistry" },
{ "name": "FLEET_HUB", "class_name": "FleetHub" }
]
}
}- Migrations register MachineInstance at
v1, LeaseRegistry atv2-lease-registryand FleetHub atv3-fleet-hub; the latter two use SQLite classes. Keep the full migration declarations from your revision. - Configure
D1consistently with the console and prepare its schema; configureEVENTS_BUCKETfor event storage. - Supply the
DISPATCHservice binding and theJIRA_WRITES_QUEUEandMODEL_DISPATCH_QUEUEproducers. Supporting consumers and dead-letter queues are separate dependencies; declaring a producer does not provision them. - Review cron triggers, environment overrides, observability and variables including
ENVIRONMENT,REMOTE_KMS_URL,APP_URLandDEPLOY_ROLLBACK_URL. Configure integration credentials separately. Agent-step dispatch also requires its matchingDISPATCH_INTERNAL_TOKEN.
Connect the console privately
Keep the runtime private with workers_dev: false and no public runtime route. Point the console's RUNTIME service binding at your runtime Worker. Configure matching secrets out of band through your deployment secret management, never in committed Wrangler variables or browser code:
Console service binding: RUNTIME -> <your-runtime-worker>
Console secret: RUNTIME_INTERNAL_TOKEN = <shared-internal-token>
Runtime secret: INTERNAL_TOKEN = <shared-internal-token>
SDK API base URL: <your-console-api-base-url>The console sends X-Internal-Token on forwarded requests. Protected runtime requests fail closed with 401 Unauthorized when the runtime token is unset, or the supplied token is missing or mismatched. Changing only the RUNTIME binding is insufficient. The internal token is not an SDK API key and must never be given to SDK callers. This guide does not provision resources, create tokens or perform a deployment.
Support
Note — self-host and air-gap access is arranged through the private-beta contact funnel, not a public price card. The runtime Worker source and workerd deploy guidance are part of that conversation — start via contact.
See also
- HTTP API — the public request/response surface served by the console for SDK callers; internal runtime routes are separate.
- Pricing — private beta; no published hosted-plan SKUs.
- Trust & Security — sub-processors, isolation, and SOC 2 status.