本文へ移動
runlot
リファレンスrunlot.json

runlot.json

A configuration file placed in the project directory. It records the name, entry point, assets directory, and connected services.

The source of truth for this page is web/apps/cli/src/config.ts and internal/bundle/bundle.go. The docs build generates this content from that source.
runlot.json
{
  "name": "my-app",
  "org": "me",
  "main": "src/index.ts",
  "assets": "public"
}

Fields

FieldTypeRequiredDescription
namestringYesThe project name. Used as the first label of the deployment URL.
orgstringNoThe organization slug. The --org option, if specified, takes precedence over this setting.
mainstringNoThe worker's entry point. If not specified, only static assets are deployed.
assetsstringNoStatic assets directory.
notFound"404" | "spa"NoThe response for paths not in the assets. With spa, paths without an extension get /index.html (client-side routing). Default is 404.
runWorkerFirstbooleanNoWho answers first when the project has both main and assets. The default is true: the worker is the entry point, and static files are not served ahead of it. Set it to false for a framework that builds its own worker and expects its client directory to be served first — React Router, Astro, SvelteKit and Nuxt all do.
compatibilityDatestringNoThe workerd compatibility date. The format is YYYY-MM-DD.
routesstring[]NoThe paths this app answers. A publish walks the list to check the app came up, so a page that has to work belongs in it. Absent, it is / alone. A route is a path on this app and starts with /. Nothing here reaches a deploy.
databaseResourceBlock | booleanNoSettings for the project's database (env.db), which every project has. None is defined yet.
storageResourceBlock | booleanNoSettings for file storage (env.storage), which every project has. None is defined yet.
emailResourceBlock | booleanNoSettings for email (env.email), which every project has. None is defined yet.
aiResourceBlock | booleanNoSettings for AI (env.ai), which every project has. None is defined yet.
authAuthBlock | booleanNoSettings for login (env.auth), which every project has. None is defined yet.
framework"next"NoThe framework adapter. Currently the only supported value is next.
trustedCertificatesstring[]NoExtra PEM certificate files to trust when this worker makes outbound HTTPS calls. Use it when an origin serves its certificate without the intermediate, which browsers repair on their own but a worker cannot. The system certificate authorities are always kept, so this only adds trust. Requires main.
triggers{ crons: string[]; names?: Record<string, string> }NoScheduled execution. Write a 5-field cron expression in crons, in UTC. See Scheduled execution for details.
queues{ producers?: QueueProducerConfig[]; consumers?: QueueConsumerConfig[] }NoQueues. producers binds env.&lt;BINDING&gt;.send to a queue; consumers names the queues this worker's queue() handler drains, with the batch and retry settings. See Queues for details.
durable_objects{ bindings?: DurableObjectBindingConfig[] }NoDurable Objects. bindings is a list of &#123;name, class_name&#125;, where name is the env.&lt;NAME&gt; handle and class_name is the class in your worker. The keys are snake_case in this block. See Durable Objects for details.
migrationsDurableObjectMigrationConfig[]NoThe migration history the Durable Object classes come from. It sits at the top level of the file and is append-only — a class stays created after the binding that reached it is removed. See Durable Objects for details.
observabilityObservabilityConfigNoWhat the platform collects from this worker. errors is Runlot Errors — uncaught exceptions, rejected waitUntil promises, console.error(err) and reports through runlot:errors become error events; it is on by default and &#123;"errors": false&#125; turns it off. logs (enabled, head_sampling_rate, invocation_logs) and traces (enabled, head_sampling_rate) collect each sampled invocation's console lines, exceptions and spans; both are off by default, and the dashboard's settings take precedence. tags (up to 16) are added to every env.metrics point. routes (up to 500, such as /users/:id/orders) name your route templates. browser: false turns the browser agent off.
tail_consumers{ entrypoint: string }[]NoExports of your worker that receive its traces through workerd's tail mechanism, as [&#123;"entrypoint": "MyTail"&#125;]. Each entrypoint must be a named export of the main module. A tail consumer adds CPU to every invocation, and the number allowed depends on the plan. Requires main.
accessAccessRuleConfig[]NoSettings that only runlot dev reads
dev{ database?: string; publicPrefixes?: string[] }NoSettings only runlot dev reads; nothing here reaches a deploy. database is a PostgreSQL URL for the local env.db, so a team can share one address through the repository, and RUNLOT_DEV_DATABASE_URL takes precedence over it. publicPrefixes are the storage key prefixes env.storage.publicUrl answers for locally — production keeps that list on the server, and a local run has nothing to ask.

name is required. You must specify at least one of main or assets. Without either, there is no worker or static asset to serve. Projects that specify framework are an exception, since the build process generates the entry point and assets.

Services

Every project has a database, file storage, email, AI and login from the start. In the worker they are env.db, env.storage, env.email, env.ai and env.auth, and none of them needs a line in this file.

database, storage, email, ai and auth are reserved for each service's settings. None is defined yet, so a key inside one of them is refused.

Turning a service off is a command — runlot pg delete, runlot storage delete, runlot email delete, runlot ai delete, runlot auth delete — and it stays off across deploys until the matching on command (runlot storage on, and so on; runlot pg on creates a new, empty database).

Older files may say "database": true. The CLI still reads it and prints a warning: true is no longer needed, and false does not turn anything off.

Bundle manifest

runlot deploy does not upload this configuration file as is. The CLI generates a separate runlot.json manifest in the bundle that references the build output. You do not need to write it yourself, but the validation rules below apply.

FieldDescription
mainThe worker entry module included in the bundle. If omitted, an entry point that serves only static assets is added automatically.
assetsThe asset directory included in the bundle. / and extensionless paths return index.html, and Content-Type is determined by the file extension.
notFound404 (default) or spa. With spa, extensionless paths return /index.html.
compatibilityDateThe format is YYYY-MM-DD. If not specified, 2024-09-23 is used.
compatibilityFlagsAn allowlist-based compatibility flag. Currently the only available value is nodejs_compat.
modulesA list of additional modules. Only the wasm type is supported.
frameworkThe framework adapter. Currently the only supported value is next.
triggersA scheduled run. crons is a 5-field cron expression (UTC), parsed at deploy time, and invalid ones are rejected. main is required.
queuesQueues. producers is a list of {binding, queue}; consumers is a list of {queue, maxBatchSize, maxBatchTimeout, maxRetries, deadLetterQueue}. Up to 5 distinct names per project; validated at deploy time. main is required, and the project's database must not have been deleted.
trustedCertificatesCertificate files carried in the bundle under certs/. The CLI copies the files you named in your configuration to that directory. Each one is parsed at deploy time, and an expired certificate is rejected. main is required.
observabilityerrors, browser, logs, traces, tags and routes, copied from your configuration; an empty block is left out. Sampling rates must be greater than 0 and at most 1; tag keys are lower case and cannot be a platform tag such as env or route; a route starts with / and its segments are literals, :name or a final *. Runlot Errors is on unless errors is false.
tail_consumersUp to 8 {entrypoint} entries, each an export name of the main module that is not a Durable Object class; the plan's limit is checked at deploy. main is required.

The worker's source map is carried as worker/index.js.map beside the worker. It is never served and is not a module; it is how error stacks are mapped back to your source.

compatibilityFlags uses an allow list. No manifest should be able to enable a flag that grants user code process-wide control. If the bundle imports Node built-in modules, it needs nodejs_compat, so the CLI sets it automatically.

You can include WASM only through the modules field. workerd does not allow compiling by calling new WebAssembly.Module(bytes) inside the bundle. The Prisma query compiler is affected by this restriction.

Bundle limits

ItemLimit
Compressed upload size64 << 20
Total size after decompression512 << 20
Size of a single file64 << 20
Number of files20_000

The bundle can contain only regular files. Symbolic links, paths that point outside the project root, and duplicate entries are all rejected.

このページの目次