Environment variables

Deployment variables and capability bindings, what breaks without them, and which host needs them. Operator configuration may additionally name environment variables explicitly; those names are not source authority.

The minimum that runs

Configure Auth0 and the app URLs, with local file storage unless Mongo is selected. Copy applications/main/.env.example and provision secret values outside source control. Presence-only startup logging is diagnostic, not proof that credentials, endpoints or keyrings are valid.

APP_BASE_URL=http://localhost:3000
NEXT_PUBLIC_APP_BASE_URL=http://localhost:3000
# Supply required AUTH0_* through your local secret configuration.

See Auth0 setup, installation and deployment bindings.

Core and storage

VariablePurpose
APP_BASE_URLServer-generated public process links and application redirects
NEXT_PUBLIC_APP_BASE_URLPublic browser origin used by compiled presentation links
STORAGE_DRIVERExplicit memory, file, mongo or postgres; memory is ephemeral, not durable production storage. Any other value ends the process at startup with exit code 1 (and is a preflight issue), never a fallback to another store
MONGO_URLMongo connection when selected; without an explicit driver, its presence selects Mongo. Publishing a template version needs a replica set (replicaSet=rs0; see operations/mongo-replica-set.md)
DATABASE_URLPostgres connection (postgres://…) for STORAGE_DRIVER=postgres, which is required with it and never selects Postgres on its own. The database must already carry this build's engine migrations (npm run db:migrate, a separate release step); a service on a database behind, ahead of or differing from this build exits at startup with code 1 and says what to run
TEMPLATE_PUBLISH_SETTLE_MSRelease step (npm run release): how long to wait for in-flight work on a template's processes to settle, default 60000, at most 150000 (one budget for every wait in the step)
NODE_ENVFramework runtime mode

Auth0

VariablePurpose
AUTH0_DOMAINTenant domain
AUTH0_AUDIENCEAPI identifier the access token is issued for
AUTH0_CLIENT_ID / AUTH0_CLIENT_SECRETApplication credentials
AUTH0_SECRETSession configuration
AUTH0_MGMT_CLIENT_ID / AUTH0_MGMT_CLIENT_SECRETOrganization picker and directory/impersonation resolution
AUTH0_JWKS_URLBackend: override of the token signing-key source, for synthetic test key servers. Honoured only when it is a loopback URL; any other value is ignored and the tenant's https://<AUTH0_DOMAIN>/.well-known/jwks.json is used
PROCESS_LOCAL_IDENTITY_URLBackend: loopback origin of the offline local identity provider (e.g. http://127.0.0.1:4319). Sends authorize, token, key and directory calls there instead of Auth0, and drops the Management API requirement. Refused (startup fails) unless the whole environment is loopback-only with a .invalid AUTH0_DOMAIN; set by npm run qa:local, never by hand. See offline local development
PROCESS_IDENTITY_CACHE_TTL_MSBackend: per-user verified-identity cache lifetime, default 30000; 0 disables. This is the revocation lag for blocked/changed identities
PROCESS_IDENTITY_CACHE_MAX_ENTRIESBackend: identity cache bound, default 1000 (least recently used evicted)
AUTH0_EMAIL_CLAIM / NEXT_PUBLIC_AUTH0_EMAIL_CLAIMOptional custom email claim
HIDDEN_ACTOR_ROLE_NAMESComma-separated role names omitted from actor display; does not remove permission to act

Integrations

The main application maps these names to stable capability aliases. Missing optional credentials leave a capability unavailable at dispatch; they do not change the compiled program. Malformed supplied key/JSON configuration, or absent required persistent keyring material when signing is configured, can fail host initialization.

VariableDefault app binding
SLACK_BOT_TOKENSlack
DUNE_API_KEYDune
NOTION_API_KEYNotion
GOOGLE_SERVICE_ACCOUNT_JSONSheets service-account JSON; takes precedence over split variables
GOOGLE_SERVICE_ACCOUNT_EMAIL / GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEYAlternative Sheets credentials when JSON is absent; split private key expands literal escaped newlines
SAFE_API_KEYSafe Transaction Service
SAFE_EXECUTOR_PRIVATE_KEYSafe broadcaster/payer signing key
ETH_RPC_URLDefault Safe RPC endpoint

The old requireSafeExecuteEnvOrExit helper no longer exists. Source privateKeyEnv / rpcUrlEnv overrides are compatibility identifiers, not permission to read arbitrary environment variables. Nondefault pairs require a bindings.safeAliases entry in PROCESS_APP_CONFIG, selected with the app's safeBindingKey; that alias must resolve to configured signing and endpoint capabilities.

Default RPC provisioning strips supported Alchemy/Infura path credentials into protected insertion. Other authenticated endpoint shapes require explicit public URL and secret-placement configuration. Public endpoint definitions must not contain raw credentials.

Ontology change process

VariablePurpose
PROCESS_ONTOLOGY_CHANGEon ships the ontology change template (registered, published at startup, github credential bound); unset, empty or off ships nothing of it. Any other value throws when the registry loads, failing the release step and every service. Set the same value on every web service and the worker. See the Phase 2 design note §17.10
PROCESS_PRIMES_FROM_ONTOLOGYon takes the Primes from the ontology (Phase 4): the Prime dropdowns read the ontology's Prime agents live through PROCESS_ONTOLOGY_ORIGIN/PROCESS_ONTOLOGY_TOKEN, and spell-request v21 and spell-prime-batch v6 are current (their release maps every stored Prime name to its ontology id, and refuses when it cannot). Unset, empty or off (production today) ships the builds from before Phase 4 (spell-request v20, spell-prime-batch v5, allocation-risk with its Prime table): nothing reads the ontology. Any other value throws when the registry loads. Set the same value on every web service, the worker and the release step; turn it on only once the ontology holds every Prime the runs name, with its profile. See the Phase 4 note
PROCESS_ONTOLOGY_ORIGINThe ontology API's origin for templates' ontology endpoint (ontologyRequest / ontologyPages): https://…, or http://127.0.0.1:<port> / http://[::1]:<port> in a local development environment (set by npm run qa:local -- --ontology). Anything else fails startup. Unset, the endpoint is unbound and a read fails with endpoint-unavailable
PROCESS_ONTOLOGY_TOKENWith PROCESS_ONTOLOGY_ORIGIN: a platform access token whose owner holds ontology:read in the ontology application, sent as Authorization: Bearer on GET under /api/ of that origin only. Templates read with its owner's grants. Optional when PROCESS_ONTOLOGY_SERVICE_SECRET is set, which takes its place (a startup warning names both when both are set)
PROCESS_ONTOLOGY_SERVICE_SECRETThe ProcessOS service credential (design note): one secret of at least 32 letters, digits, _ or - (openssl rand -hex 32), or current,previous while rotating. Set the same value on web, the Step Runner and the ontology service. On web and the Step Runner, with PROCESS_ONTOLOGY_ORIGIN, it replaces PROCESS_ONTOLOGY_TOKEN: the first value is sent as Authorization: Bearer ppsvc_<secret>, under the same policy (GET under /api/ of that origin only), and templates read as the ProcessOS account with the grants the access policy names for it in the ontology application ("platformAccountRoles": ["reader"] on that application's entry), never more than ontology:read. On web it also lets GET /api/service-identity answer the ontology API, accepting every listed value. Unset (the default): the credential is off everywhere and nothing changes. A malformed value fails startup; the value is never logged
PROCESS_GOOGLE_DRIVE_COMMENT_FILESSpreadsheet (Drive file) ids whose Drive comments (driveComments) and sharing (the permissions list, decision 16 of the CC Buffer payments) templates may read, comma-separated. Each adds two GETs, each an exact path, to the Google service-account token's policy: https://www.googleapis.com/drive/v3/files/<id>/comments and .../<id>/permissions. Comments tied to their cells (sheetsComments, the Sheets API's commentsViewMode) need no entry: they are a read under the token's existing GET /v4/spreadsheets/ grant. Unset: nothing about Drive is granted. A malformed id fails startup. The grant is per file, open to every registered template, like the other policies. Ignored when PROCESS_APP_CONFIG supplies the configuration
PROCESS_GITHUB_TOKENWorker, only with PROCESS_ONTOLOGY_CHANGE=on: the pull-request watcher's read-only token for soterlabs/process-platform (Authorization: Bearer, GET requests under that repository's API path only); ignored when the switch is off

Closed-runtime provisioning

VariablePurpose
PROCESS_APP_CONFIGMain-app trusted JSON path containing authoring bindings and optional generic effects; replaces default provisioning
PROCESS_DOCS_ROOTOptional trusted served-Markdown asset directory; root wrappers default it to applications/main/docs, while a direct main-app command defaults to cwd docs
PROCESS_BACKEND_CONFIGStandalone backend trusted JSON path containing compiled registrations, relative document assets and optional effect provisioning; no config means no shipped app registry
PROCESS_EXTRA_TEMPLATESOptional trusted absolute path to a JSON array of compiled registrations, published at startup alongside the app's or backend's templates (same key replaces). Validated (closed registration + execution digest); receives no extra effect approvals. Used by isolated verification; never an HTTP path
PROCESS_EFFECT_ENCRYPTION_KEYDefault main-app protected-store encryption key: 32 bytes encoded as base64, required when Safe or Sheets signing is configured
PROCESS_EFFECT_DERIVATION_KEYSeparate persistent 32-byte base64 handle-derivation key, required with signing; do not reuse the encryption key
PROCESS_EFFECT_ENCRYPTION_KEY_IDRecord key id that PROCESS_EFFECT_ENCRYPTION_KEY seals under; default active (the original id). Set a new id whenever the key is rotated. See effect key rotation
PROCESS_EFFECT_ENCRYPTION_KEY_PREVIOUSOptional decrypt-only retired encryption key (32-byte base64), kept only until effects:rotate-key has resealed every record
PROCESS_EFFECT_ENCRYPTION_KEY_PREVIOUS_IDRecord key id of the previous key; default active
PROCESS_EFFECT_DERIVATION_KEY_PREVIOUSOptional retired handle-derivation key: replays of occurrences minted before a derivation rotation keep their original handle

Never accept provisioning paths from an untrusted request. For explicit effects, encryption.keys, derivationKeyEnvironment, credential environment and signing-key environment select operator-owned names; they need not be the defaults above. Provision their values out-of-band and keep keyrings durable and consistent across workers sharing protected storage. Regenerating random keys does not recover existing protected handles. Never place secrets in authoring metadata, logs, committed config or NEXT_PUBLIC_* variables.

Main-app policy: repository templates compiled into the app may use the current deployment's configured capabilities. There is no runtime authoring path (templates:write is retired). That does not create arbitrary destinations or let source metadata manufacture grants. Generic standalone deployments remain operator-explicit and deny capabilities by default. Follow deployment bindings.

Frontend

VariablePurpose
NEXT_PUBLIC_FRONTEND_IDMain-app skin: default, allocation-risk or spell-request; unknown ids fail configuration
PROCESS_BACKEND_ORIGINIndependent Spell frontend's one configured HTTP(S) backend origin; not a user-supplied proxy target
PROCESS_APPLICATION_IDApp frontends (Spell, allocation-risk, generic): the declared applicationId their proxy stamps as the trusted list scope, e.g. workflow:spell-request. Optional; unset lists every member app. Must match the backend access policy or lists return 404

Next.js public variables require static property access to be inlined in browser output. Set them for the intended build; private capability configuration belongs only on authorized server hosts.

Files and CORS

VariablePurpose
PROCESS_FILES_ROOTFile repository root; make durable/shared where the deployment requires it
PROCESS_FILES_DRIVERfs for filesystem or memory for ephemeral fixtures; normal production default is filesystem
MAX_PROCESS_FILE_BYTESUpload size cap
CORS_ALLOWED_ORIGINSExplicit permitted browser origins for direct cross-origin API calls; standalone defaults deny

Storage

STORAGE_DRIVER=memory|file|mongo|postgres → explicit (postgres needs DATABASE_URL)
STORAGE_DRIVER=anything else              → exit code 1 at startup (no fallback)
otherwise MONGO_URL set                   → MongoDB
otherwise                                 → files in .process-platform/

VITEST selects synthetic defaults in tests, not production. Configuration changes require a restart. Postgres is never inferred from DATABASE_URL; nothing migrates at startup (db:migrate is run by a person in the release step, and startup only verifies the schema is this build's). Old formats require offline conversion; startup does not reinterpret or migrate records automatically. See storage.

The data migration commands (npm run storage:copy, npm run storage:verify) read their connection strings from dedicated variables only, never from MONGO_URL or DATABASE_URL: SOURCE_MONGO_URL and TARGET_DATABASE_URL for the cutover, SOURCE_DATABASE_URL and TARGET_MONGO_URL for a rollback. They are set in the operator's shell for those commands, never on a service. See the cutover runbook.

Which deploy needs what

  • Web/API and worker must agree on registration, storage and public capability aliases. Configuring signing also requires the protected keyring during host construction.
  • Workers need the secrets/endpoints for process integration effects and a durable protected store.
  • A separate frontend normally needs its backend origin, browser/session settings and public URLs; standalone backend/worker effects are explicitly provisioned.

Build secrets are not needed to determine the stable compiled program. Do not copy production secrets into fixtures to prove a build. See deployment before activation.

Required deployment access policy

Set exactly one of PROCESS_ACCESS_CONFIG (private JSON file path) or PROCESS_ACCESS_CONFIG_JSON. All web services and workers require the same reviewed owner/application policy. A file is preferable for large membership policies. An application entry may name roles for the ProcessOS account with "platformAccountRoles": ["<role key>", …] (roles of that application): only the ontology application's entry means anything today, read by GET /api/service-identity for the ProcessOS service credential (PROCESS_ONTOLOGY_SERVICE_SECRET); it is not membership and grants nothing in ProcessOS itself. Missing/invalid policy fails closed; applicationAccess inside backend provisioning is no longer supported. See application access. AUTH0_ONBOARDING_ORGANIZATION_ID is an explicit invitation destination, not a data tenant assignment.