decision control
Self-host

Configuration

Every environment variable, with default and meaning.

The whole platform reads its configuration from environment variables. This is the canonical reference; the docker-compose file ships sensible defaults for development.

API and worker

VariableDefaultWhat it does
DATABASE_URLrequiredPostgres connection (Prisma). Alternatively set DB_HOST, DB_USER, DB_PASSWORD and DB_NAME.
WEB_ORIGINhttp://localhost:5173The public URL of the console. Used as the OAuth redirect origin and for verification. Set it in production.
PUBLIC_URLWEB_ORIGINOrigin for redirect and ACS URLs in SSO when separate.
RESPONSE_COMPRESSIONtruegzip for the console's larger JSON responses (not executions or MCP). Set false if a proxy in front already compresses.
CORS_EXTRA_ORIGINS—More browser origins allowed to call the API with the session cookie, comma separated. WEB_ORIGIN and PUBLIC_URL are always allowed; state-changing cookie requests from any other origin get 403.
HTTP_IDLE_TIMEOUT_S60Seconds a connection may sit with no bytes moving before the server closes it (0 disables, max 255). The proxy in front should enforce the real deadline; this only reaps idle connections.
API_KEY_PEPPERrequiredSalt for hashing API keys. At least 32 characters in production.
SESSION_TTL_DAYS30How long a console session lasts at most.
SESSION_IDLE_TIMEOUT_DAYS7A session unused for this long ends, whatever its TTL. 0 turns the idle limit off.
DB_POOL_MAX10Postgres connections this process holds. Keep replicas x DB_POOL_MAX + worker under max_connections.
DB_POOL_IDLE_MS30000How long an idle connection is kept.
DB_CONNECT_TIMEOUT_MS5000How long a request waits for a free connection before failing.
DB_STATEMENT_TIMEOUT_MS60000Ends any API statement running longer than this (60 s). The background loops are exempt: they run on their own client with no limit (DB_JOB_POOL_MAX). 0 turns the limit off.
DB_JOB_POOL_MAX5Pool for the background loops (retention, rollups), used only while DB_STATEMENT_TIMEOUT_MS is on.
DB_UNAVAILABLE_COOLDOWN_MS3000After a request fails to reach Postgres, new requests are refused at once with 503 UNAVAILABLE (and Retry-After) for this long, then one probes the database. 0 turns the gate off.
DATABASE_READ_REPLICA_URL—Optional read replica. Dashboards, audit exports, backtests and monitoring read from it and fall back to the primary when unset.
CREDENTIALS_ENCRYPTION_KEYrequired (32 bytes, b64)AES-256-GCM key for credentials, connections, webhook secrets and 2FA secrets.
CREDENTIALS_ENCRYPTION_KEYS_PREVIOUS—Previous key(s), comma-separated; decryption accepts either.
WEBHOOK_SIGNING_SECRETdev-webhook-signing-secretShared secret the worker uses to compute webhook signatures. The built-in default is refused in production.
EMAIL_PROVIDER—Transport for transactional email: resend or sendgrid. Left unset, the provider whose key is set is used (Resend first); with neither, it logs to stdout.
RESEND_API_KEY—Resend API key (resend.com). Set it, or EMAIL_PROVIDER=resend, to send through Resend.
SENDGRID_API_KEY—SendGrid API key (sendgrid.com). Set it, or EMAIL_PROVIDER=sendgrid, to send through SendGrid.
EMAIL_FROMDecision Control <onboarding@resend.dev>From header for outbound email. For SendGrid it must be a verified sender in the account.
OUTBOUND_ALLOWED_HOSTS—Comma-separated allowlist for outbound calls (hostnames; *.corp.example works).
EXECUTION_RETENTION_DAYS90Delete executions older than N days; 0 keeps them forever. A project can set its own period (Settings → Data protection), which overrides this.
EXECUTION_PAYLOAD_LIMIT_BYTES262144Anything larger is trimmed before being written to the audit record.
EXECUTION_WRITE_MODEsyncbatched writes successful runs with no actions behind the response (write-behind); failed runs and runs with actions stay synchronous.
EXECUTION_WRITE_FLUSH_MS50How often the write-behind buffer is flushed in batched mode.
EXECUTION_WRITE_BATCH_SIZE200Rows per createMany in batched mode.
EXECUTION_WRITE_BUFFER_MAX5000Buffer ceiling; once it is full, the caller writes synchronously instead.
EXECUTION_TIMEOUT_MS30000Wall-clock limit for one execution, nested decisions and outbound calls included. Keep it below the timeout of anything in front of the API.
EXECUTION_MAX_TOTAL_STEPS5000Steps across a whole execution, nested decisions included (each flow is also limited to 500 on its own).
EXECUTION_MAX_COMPOSITE_BYTES4194304What forEach and parallel may hold in memory (outputs and sub-traces) in one execution.
NOTIFICATION_RETENTION_DAYS90Delete notifications older than N days; 0 keeps them forever.
SCHEDULER_ENABLEDtrueRun the scheduler and the scheduled-record workers in this process. Set false on replicas that should not.
SCHEDULER_POLL_INTERVAL_MS2000How often due jobs are started and queued records are claimed.
SCHEDULED_MAX_RECORDS10000The most records one run may queue, whatever the job asks for.
SCHEDULED_WORKER_BATCH20Records a worker claims per batch, across jobs.
SCHEDULED_ITEM_LEASE_MS300000How long a claimed record is reserved before another worker may take it over.
SCHEDULED_RETENTION_DAYS30Delete finished runs and their records older than N days; 0 keeps them forever.
PORT3000HTTP port.
NODE_ENVdevelopmentStandard Node.js semantics.
LOG_LEVELinfoPino log level.
TRUST_PROXYfalseWhen true, X-Forwarded-For from nginx is trusted as the client address.
TRUST_PROXY_HOPS1With TRUST_PROXY, how many proxies are in front of the API. The address used is that many entries from the right of X-Forwarded-For.
WORKER_ENABLEDtrueSet false on the API process when a dedicated worker runs.
SHUTDOWN_DRAIN_MS0On SIGTERM, /readyz says draining for this long.
SHUTDOWN_TIMEOUT_MS25000Hard cap on graceful shutdown.
MAINTENANCE_INTERVAL_MS900000Housekeeping cadence: expired sessions, rate-limit windows, invitations and retention.
OTEL_EXPORTER_OTLP_ENDPOINT—OTLP/HTTP endpoint for traces.
OTEL_SERVICE_NAMEdecision-control-apiOTLP service name.
OTEL_EXPORTER_OTLP_HEADERS—Extra OTLP headers.
METRICS_TOKEN—Bearer token required on GET /metrics; empty disables the check.
METRICS_PORT—Worker's Prometheus port (separate from the API).
SEED_ADMIN_EMAILadmin@decision-control.localEmail of the admin created by bun run db:seed.
SEED_ADMIN_PASSWORDdecision-controlPassword of the seeded admin (development only).
PLATFORM_ADMIN_DOMAINdecisioncontrol.ioAn email at this domain always holds the platform ADMIN role — how a fresh install gets its first operator without a seed. Empty disables the rule.
PLATFORM_ADMIN_EMAILS—Extra addresses that always hold the platform ADMIN role, comma separated.
BACKTEST_MAX_RECORDS1000Maximum records one backtest can replay.
ALERT_MIN_EXECUTIONS20Drift / error-rate windows are evaluated only above this floor.
ALERT_WINDOW_MINUTES5Window for execution.error_rate_high.
ALERT_ERROR_RATE0.2Error-rate above which execution.error_rate_high fires.
DRIFT_WINDOW_HOURS24Recent window for drift detection.
DRIFT_BASELINE_DAYS7Baseline window for drift detection.
DRIFT_THRESHOLD0.4Relative share change that counts as drift.
DRIFT_MIN_POINTS0.02Absolute share change that counts as drift.
DRIFT_MIN_EXECUTIONS50Minimum executions in each window for drift to be evaluated.
EXECUTION_BATCH_MAX_ITEMS100Maximum items in one batch execute call.
EXECUTION_BATCH_CONCURRENCY8Concurrency recorded per batch execute call.
OUTBOX_MAX_ATTEMPTS5Maximum outbox delivery attempts before a dead letter.
CACHE_TTL_MS60000TTL for entries that should expire even when invalidation was lost.
VERSION_CACHE_SIZE1000In-memory cap for published versions.
AUTH_RATE_LIMIT_MAX_PER_IP30Sign-in, sign-up and reset budget per client address, over AUTH_RATE_LIMIT_WINDOW_MS.
AUDIT_EXPORT_MAX_ROWS100000Cap on audit-log export rows (max 1,000,000).
AUDIT_SIGNING_KEY—Ed25519 PKCS#8 PEM used to sign export manifests.
RATE_LIMIT_STOREredis if REDIS_URL is set, else postgresredis, postgres or memory (per process, only honest with one instance); if Redis cannot answer, falls back automatically.
MANAGEMENT_RATE_LIMIT_MAX_REQUESTS1200Console and authoring API budget per person or key, over RATE_LIMIT_WINDOW_MS. Imports, exports and backtests spend 10-20 units per call.
REDIS_URL—Redis URL for rate limits and caches.
DB_REPLICA_POOL_MAX10Connections held to the read replica.
SESSION_COOKIE_SECUREfollows NODE_ENVWhether the session cookie carries Secure (on in production). Set false only to run the console over plain http.
REQUIRE_EMAIL_VERIFICATIONfollows NODE_ENVConfirm an email before the account can sign in: on in production, off in development.
REGISTRATION_MODEopenWho may create an account: open, invite (only emails with a pending invitation) or closed. SSO sign-in is unaffected.
REGISTRATION_ALLOWED_DOMAINS—Comma-separated email domains allowed to register in open mode; empty allows any.
CAPTCHA_PROVIDERnoneCAPTCHA on registration: none, turnstile or hcaptcha. Needs CAPTCHA_SECRET and CAPTCHA_SITE_KEY.
CAPTCHA_SECRET—Server-side secret that verifies the CAPTCHA token.
CAPTCHA_SITE_KEY—Public site key the console uses to render the CAPTCHA widget.
SEED_ADMIN_NAMEAdminName of the seeded admin.
RATE_LIMIT_WINDOW_MS60000Window for the execution and management rate limits.
RATE_LIMIT_MAX_REQUESTS600Execution API budget per key over RATE_LIMIT_WINDOW_MS.
API_KEY_RATE_LIMIT_OVERRIDE_MAX100000Highest per-key allowance (rate_limit_override) an API key may be given.
AUTH_RATE_LIMIT_WINDOW_MS900000Window for the sign-in budgets and failed-login counters.
AUTH_RATE_LIMIT_MAX_PER_EMAIL10Sign-in, sign-up and reset budget per email address.
AUTH_LOGIN_MAX_FAILURES_PER_PAIR8Failed sign-ins from one address against one account before that pair is locked out.
AUTH_LOGIN_MAX_FAILURES_PER_ACCOUNT40Failed sign-ins against one account, from any address, before it is locked out.
AUTH_LOGIN_ALERT_AFTER5Failures after which the account owner is emailed once.
REDIS_COMMAND_TIMEOUT_MS250A Redis command slower than this counts as a failure and the database is used.
PUBLIC_FORM_READS_PER_MINUTE60Public form page reads per address per minute.
PUBLIC_FORM_UNLOCKS_PER_MINUTE5Public form password attempts per address per minute.
PUBLIC_FORM_SUBMISSIONS_PER_IP_MINUTE10Public form submissions per address per minute.
PUBLIC_FORM_SUBMISSIONS_PER_MINUTE100Public form submissions per minute, per form.
INBOUND_WEBHOOK_REQUESTS_PER_MINUTE1200Inbound webhook requests per client address per minute.
INBOUND_WEBHOOK_MAX_BODY_BYTES1048576Largest inbound webhook body accepted.
OUTBOX_POLL_INTERVAL_MS1000How often the worker polls the outbox.
OUTBOX_BACKOFF_BASE_MS1000Base of the retry backoff for outbox deliveries.
HEARTBEAT_INTERVAL_MS15000How often each API replica or worker refreshes its heartbeat row; one older than three intervals reads as stale in the admin board.
SCHEDULED_FETCH_SLICE_MS30000How long one pass reads pages for a scheduled run before handing the rest to the next pass.
SCHEDULED_MAX_QUEUE_DEPTH5000Reading pauses while a run has this many records waiting.
HTTP_LOG_MAX_HOT_DAYS14Ceiling (1-90) on how long HTTP request logs stay in Postgres; older ones go to the archive.
HTTP_LOG_MAX_BODY_BYTES65536Per-body cap for captured HTTP logs; larger bodies are cut and flagged.
HTTP_LOG_BUFFER_MAX5000Log entries held in memory before new ones are dropped (and counted).
HTTP_LOG_FLUSH_MS1000How often the HTTP log buffer is flushed.
HTTP_LOG_BATCH_SIZE500HTTP log rows per insert.
HTTP_LOG_ARCHIVE_INTERVAL_MS600000How often the HTTP log archive job runs.
HTTP_LOG_S3_BUCKET—Platform S3 bucket for PLATFORM log archives; unset disables that target. Also HTTP_LOG_S3_REGION (us-east-1), _ENDPOINT, _PREFIX (http-logs), _ACCESS_KEY_ID, _SECRET_ACCESS_KEY, _FORCE_PATH_STYLE.
STATS_ROLLUP_RETENTION_DAYS400How long hourly dashboard rollups are kept; 0 keeps them forever.
STATS_CACHE_MS30000How long dashboard aggregates are reused; 0 disables.
OUTCOME_ROLLUP_BACKFILL_DAYS35How far back the first run of the outcome rollups (monitoring, drift) goes.
OUTBOUND_BREAKER_FAILURES5Consecutive failures to one host before it is not called for the cooldown; 0 turns it off.
OUTBOUND_BREAKER_COOLDOWN_MS30000How long a tripped host is not called before a trial call.
OUTBOUND_MAX_CONCURRENT_PER_HOST50Calls in flight to one host per process; 0 turns it off.
MAX_CONCURRENT_EXECUTIONS512Executions in flight per process; above it new ones get 503 OVERLOADED with Retry-After. 0 turns it off.
TYPESAFE_API_KEY—Key for the TypeSafe provider of ai nodes (TYPESAFE_URL, AI_MODEL jev-latest, AI_MAX_QUESTIONS 20, AI_TIMEOUT_MS 30000). Empty disables it: ai nodes fail with AI_DISABLED.
OPENAI_API_KEY—Key for the OpenAI provider of ai nodes (OPENAI_URL); ANTHROPIC_API_KEY and ANTHROPIC_URL likewise. Empty turns that provider off.
ASSISTANT_MODEL—Model of the authoring assistant as provider/model; empty disables it (AI_DISABLED). Also ASSISTANT_API_KEY, ASSISTANT_MAX_DESCRIPTION (4000) and ASSISTANT_RATE_LIMIT_PER_MINUTE (10).

Database

The bundled compose file provisions a single Postgres instance; the API image runs migrations on boot via the migrate one-shot service.

On this page