Skip to Content
WorkersConfiguration & Messaging

Configuration & Messaging

A worker reads all of its configuration from environment variables. Those variables live in an environment file on the worker host, and the platform edits it for you from the Environment sub-page — the file is never part of your repository.

The Environment Page

Open a worker, then click Environment. The page loads the live .env from the running worker and shows it as editable text.

ControlWhat it does
Load .env / ReloadFetches the current file from the worker host
Prefill recommended valuesFills in the connection settings the platform already knows
Save .envValidates, then writes the whole file back
Save & restartSaves the file, then restarts the worker so it uses the new values

The page auto-loads once the worker is active. Before that there’s no process to read from, and the controls stay disabled.

Values are shown in full, not masked, so that saving an unchanged entry can’t overwrite a real secret with a mask. Treat this page as sensitive and be careful sharing your screen. Editing requires the Developer role or above on the project; without it the editor is read-only.

Fill In a New Worker’s File

When it creates a worker, or runs Retry on a failed one, the platform also tries to write the recommended values into the worker’s environment file. It never replaces a file the worker already has. If the worker’s server could not be reached, the file stays empty: once the worker is active, open its Environment page, click Prefill recommended values to fill in the connection to RabbitMQ and the data backend, and click Save & restart.

On a Buildpad Engine project, the platform refuses to create the worker if it cannot read the worker token, or if the project has no Engine address yet.

On a Supabase project, the recommended values are best effort. If the platform cannot read the project’s details or its DaaS token, DAAS_TOKEN and other values can stay empty.

Prefill recommended values fills in keys that are missing or empty, so you can also use it later, for example after you delete a line by mistake.

The platform fills in the RabbitMQ URL, DaaS URL and token, the project MCP token, and this worker’s identity.

On a Buildpad Engine project, Prefill can return the same refusals as worker creation: “The worker’s token is unavailable” (503) or “The project has no Engine address yet” (409).

Review what changed

Prefill only writes keys that are missing or empty. Anything you already set is left alone, and the page tells you exactly which keys it added.

Click Save & restart

Nothing reaches the worker until you save. Save & restart saves the file and restarts the worker in one step.

If you click Save .env instead, the worker picks up the changes on the next restart or deploy, not immediately. See Operating Workers.

VariableSourcePurpose
RABBITMQ_URLProject brokerFull AMQP URL, credentials included
RABBITMQ_MANAGEMENT_URLProject brokerWeb console, for inspecting queues by hand
WORKER_JOB_TYPESDefaults to worker.jobComma-separated job types this worker consumes
DAAS_URLProject DaaS backend, or the Engine URLData backend base URL
DAAS_TOKENSee belowBearer token for data calls
BUILDPAD_MCP_TOKENShared project MCP tokenPlatform access for AI tooling
PROJECT_IDThis projectWorker identity, used as the message source
WORKER_IDThis workerWorker identity, used as the message source

Where DAAS_URL and DAAS_TOKEN come from depends on the project’s backend:

On a Buildpad Engine project:

  • DAAS_URL is the Engine URL (on the project’s API card), with no trailing slash.
  • DAAS_TOKEN is the project’s worker token. It is generated when the project is created and kept by a restore.

On a Supabase project:

  • DAAS_URL is the project’s DaaS URL.
  • DAAS_TOKEN is the DaaS token of the project’s built-in admin user (admin@example.com).

When the project moves to the Buildpad Engine, the cutover changes the file of each active worker. DAAS_URL becomes the Engine URL and DAAS_TOKEN becomes the project’s worker token. Other keys and their values do not change, but comment lines and blank lines are removed. Then the platform restarts the worker. Move back writes the previous DAAS_URL and DAAS_TOKEN back, or removes a key that was not in the file before the move. Then it restarts the worker again. See Moving to the Buildpad Engine.

BUILDPAD_MCP_TOKEN is the shared project MCP token on both backends. Project starter kits use a personal token for the platform server instead; a worker uses the shared one.

Add your own variables freely — third-party API keys, tuning values, feature switches. Prefill never removes them.

PROJECT_ID and WORKER_ID are also exported into the environment by the platform at start time, so they’re available even if the file doesn’t list them. Prefill includes them anyway so local runs behave the same as deployed ones.

Validation Rules

Every meaningful line must be a KEY=VALUE assignment:

  • Keys match [A-Za-z_][A-Za-z0-9_]* — letters, digits, underscores, not starting with a digit
  • Blank lines and # comments are ignored
  • Everything after the first = is the value, verbatim
  • A repeated key means the last assignment wins

If any line is malformed, the whole save is rejected with the offending line number and nothing is written — the worker keeps running on its previous configuration. An entirely empty file is also rejected, since a worker with no configuration can’t connect to anything.

Deploys Preserve Configuration

Pushing code never overwrites the environment file. Config and code have separate lifecycles: deploy as often as you like without re-entering secrets.

Messaging

Workers consume jobs from the project’s RabbitMQ broker. The convention the starter implements:

  • One topic exchange named jobs, shared by the project
  • One durable queue per job type, named q.<type>
  • The routing key is the job type itself

WORKER_JOB_TYPES is a comma-separated list of the types one worker handles:

WORKER_JOB_TYPES=report.generate,image.thumbnail

That worker declares and consumes q.report.generate and q.image.thumbnail.

The platform provisions the broker, not your topology. Exchanges and queues are declared by your worker code at startup — that’s why the starter declares them idempotently on connect. If you expect a queue to exist and it doesn’t, check that the worker actually started and that WORKER_JOB_TYPES lists the type.

Splitting Work Across Workers

Because job types drive queue names, you decide the split by configuration rather than code layout:

  • One worker, many types — simplest. Set several types in WORKER_JOB_TYPES.
  • One worker per type — isolates failures and lets you deploy and restart each independently. Preferred when one job type is far heavier or far riskier than the rest.

Publishing side: your app or microapp publishes to the jobs exchange with the job type as the routing key. Nothing special is needed on the platform for a new job type beyond a worker configured to consume it.

Talking to DaaS or the Engine

DAAS_URL and DAAS_TOKEN give the worker the same data backend your apps use, so a worker reads and writes collections through the normal REST API. Full reference: DaaS documentation .

On a Buildpad Engine project, the paths take the /api prefix, for example /api/items/<collection>. Send only Authorization: Bearer <DAAS_TOKEN>. The worker token needs no tenant header.

The worker token can:

  • Create, read, update, and delete items in every collection that project members create, including collections created later
  • Read its own user (/api/users/me) and its own role

The worker token cannot:

  • Change structure. Adding a field or deleting a collection returns 401. This is expected.
  • Read other system tables. Those requests return 403.

The worker token does not expire and does not rotate. All workers in the project share it. See Projects: Workers.

On a Supabase project, DAAS_TOKEN is read from the project when the platform builds the recommended values. If DaaS calls start returning authentication errors long after setup, reload the Environment page, prefill again into an emptied DAAS_TOKEN, save, and restart.

Last updated on