Skip to content

Configuration

The Worker project file is open-compute.json. It must have name and one content shape: main, assets, main + assets, or frameworkOutput. The parser accepts only the implemented fields below. Unknown fields are rejected.

json
{
  "name": "hello-typescript",
  "main": "src/index.ts",
  "vars": { "GREETING": "Hello from TypeScript" }
}

Fields

FieldRole
nameWorker name, [a-z0-9] with internal hyphens
mainTS entry, relative to the config file directory
frameworkOutputAlready-built framework output; cannot combine with explicit main / assets
tsconfigDefaults to tsconfig.json
varsPublic variables; JSON values enter env
secrets{ "TOKEN": { "env": "MY_TOKEN" } }; environment references only
bindingsObject: key is the env name, value is {type, id, permissions?}. DO / Workflow also need className. Workflow may set schedules
servicesArray [{binding, service, entrypoint?}]
assetsdirectory, binding?, run_worker_first, html_handling, not_found_handling, publish_source_maps
cacheenabled, cross_version_cache
exportsCache overrides for named Worker entrypoints; only {"type":"worker","cache":{...}}
images{ "binding": "IMAGES" }
version_metadata{ "binding": "VERSION", "tag"? }
accountIdOverride the default account
endpointPlatform origin; default http://127.0.0.1:8787

main, frameworkOutput, the assets directory, and tsconfig resolve relative to the config file directory and cannot escape the project boundary. Assets-only projects cannot declare vars, secrets, product/service bindings, or Worker-first. All binding names share one env namespace. The file is at most 64 KiB and must be strict JSON (not jsonc).

bindings.type: kv_namespace, r2_bucket, d1_database, do_namespace, queue_producer, workflow.

Compatibility

TopicCloudflareopen-compute
vars, secrets, assets routing, cache enabled, service-binding semanticsYes — Wrangler configurationField names borrow common Wrangler configuration; not a full wrangler.jsonc compatibility layer
Module Worker main points at a TS/JS entryYesYes
compatibility_date / compatibility_flags / compatibilityDate / compatibilityFlagsYesNot allowed
workers_dev, Custom Domains, routes, placement, observability, AI, vectorizeYesNot provided; unknown keys fail rather than being ignored
Control planeCloudflare RESTLocal ocd HTTP API

In this section