Skip to Content
Environment variables

Webapp

Environment variables for the webapp container.

NameRequiredDefaultDescription
Secrets
SESSION_SECRETYes—Session encryption secret. Run: openssl rand -hex 16
MAGIC_LINK_SECRETYes—Magic link encryption secret. Run: openssl rand -hex 16
ENCRYPTION_KEYYes—Secret store encryption key. Run: openssl rand -hex 16
ENVIRONMENT_ENCRYPTION_ENABLEDNofalseMaster gate for automatic per-environment encryption enrollment. Also requires environmentEncryptionEnabled in organization feature flags or the global feature flag (organization overrides global; unset is false). Enable only after all instances have been upgraded. Existing encrypted environments continue using their keys if any rollout gate is later disabled.
ENVIRONMENT_ENCRYPTION_KMS_KEY_ARNNounsetResolved symmetric AWS KMS key ARN for wrapping new environments' keys. Unset uses ENCRYPTION_KEYRING (or the legacy ENCRYPTION_KEY) locally, without AWS access. Changing this does not alter existing environment-key versions.
MANAGED_WORKER_SECRETYes—Managed worker secret. Must be set and match supervisor. Run: openssl rand -hex 32
PUBLIC_TOKEN_SUBJECT_SECRETNoENCRYPTION_KEYKey that encrypts the environment id inside public access tokens. Set it to keep this separate from the secret store key. Run: openssl rand -hex 32
PUBLIC_TOKEN_SEALED_SUBJECT_ENABLEDNofalseEncrypt the environment id inside newly minted public access tokens. Turn on only once every webapp instance runs a version that can read them.
ALLOW_INSECURE_DEFAULT_SECRETSNofalseBoot even if a secret is still a known-insecure published default. Temporary escape hatch for values you can't safely rotate yet (see Secrets).
Domains & ports
REMIX_APP_PORTNo3030Remix app port.
APP_ORIGINYeshttp://localhost:3030App origin URL.
LOGIN_ORIGINYeshttp://localhost:3030Login origin URL. Most likely the same as APP_ORIGIN.
API_ORIGINNoAPP_ORIGINAPI origin URL.
STREAM_ORIGINNoAPP_ORIGINRealtime stream origin URL.
ELECTRIC_ORIGINNohttp://localhost:3060Electric origin URL.
DOCS_ORIGINSNohttps://trigger.devComma-separated docs site origins that may read the signed-in user with credentials, for personalized docs. Set it empty to allow none.
Postgres
DATABASE_URLYes—PostgreSQL connection string.
DIRECT_URLYes—Direct DB connection string used for migrations etc.
WEBHOOK_DELIVERIES_REPLICATION_DATABASE_URLNoWEBHOOK_DATABASE_URL, then DATABASE_URLDirect PostgreSQL connection for webhook delivery replication to ClickHouse. Must target the database containing WebhookDelivery and use credentials with replication privileges. Set this when the webhook runtime connection uses a pooler.
DATABASE_CONNECTION_LIMITNo10Max DB connections.
DATABASE_POOL_TIMEOUTNo60DB pool timeout (s).
DATABASE_CONNECTION_TIMEOUTNo20DB connect timeout (s).
DATABASE_WRITER_POOL_TIMEOUTNoDATABASE_POOL_TIMEOUTWriter pool timeout (s); overrides the shared default for the writer only.
DATABASE_WRITER_CONNECTION_TIMEOUTNoDATABASE_CONNECTION_TIMEOUTWriter connect timeout (s); overrides the shared default for the writer only.
DATABASE_READ_REPLICA_URLNoDATABASE_URLRead-replica DB string.
DATABASE_READ_REPLICA_POOL_TIMEOUTNoDATABASE_POOL_TIMEOUTRead-replica pool timeout (s); overrides the shared default for the replica only.
DATABASE_READ_REPLICA_CONNECTION_TIMEOUTNoDATABASE_CONNECTION_TIMEOUTRead-replica connect timeout (s); overrides the shared default for the replica only.
Redis
REDIS_HOSTYes—Redis host.
REDIS_PORTYes—Redis port.
REDIS_READER_HOSTNoREDIS_HOSTRedis reader host.
REDIS_READER_PORTNoREDIS_PORTRedis reader port.
REDIS_USERNAMENo—Redis username.
REDIS_PASSWORDNo—Redis password.
REDIS_TLS_DISABLEDNo—Disable Redis TLS.
Auth
WHITELISTED_EMAILSNo—Whitelisted emails regex.
BLOCKED_EMAIL_DOMAINSNo—Comma-separated email domains that can't sign in or sign up, including their subdomains.
LOGIN_RATE_LIMITS_ENABLEDNotrueEnable rate limiting on magic-link login.
MAGIC_LINK_SAME_BROWSER_REQUIREDNotrueOnly accept a magic link opened in the browser that requested it. Set to false to allow opening it on another device.
PERSONAL_ACCESS_TOKEN_EXPIRY_DAYSNo30,90,365Lifetimes, in days (1 to 3650), offered when creating a personal access token on the dashboard. Comma-separated. The longest is also the furthest a custom expiry date can be.
PERSONAL_ACCESS_TOKEN_DEFAULT_EXPIRY_DAYSNo90The lifetime preselected when creating a personal access token. If it isn't one of the offered lifetimes, the shortest is preselected.
CLI_LOGIN_IDLE_TIMEOUT_DAYSNo7A token minted by a CLI or MCP login stops working after this many days without use. Set to 0 to turn this off. Each token keeps the value it was minted with.
PERSONAL_ACCESS_TOKEN_EXPIRY_EMAILS_ENABLEDNotrueEmail the owner 7 days before a dashboard-created personal access token expires, and again when it has. Only runs when EMAIL_TRANSPORT is set.
TURNSTILE_SITE_KEYNo—Cloudflare Turnstile site key. With TURNSTILE_SECRET_KEY, adds a bot check to the magic-link sign-in form.
TURNSTILE_SECRET_KEYNo—Cloudflare Turnstile secret key, used to verify the check on the server. Turnstile is off unless both keys are set.
AUTH_GITHUB_CLIENT_IDNo—GitHub client ID.
AUTH_GITHUB_CLIENT_SECRETNo—GitHub client secret.
CSP_IMG_SRC_ALLOWLISTNo—Extra hosts the dashboard may load images from, e.g. an SSO or avatar host serving profile images. A comma-separated list of exact origins (https://sso.example.com); a wildcard host such as https://*.example.com is refused.
Email
EMAIL_TRANSPORTNo—Email transport type. One of resend, smtp, aws-ses.
FROM_EMAILNo—From email address.
REPLY_TO_EMAILNo—Reply-to email address.
RESEND_API_KEYNo—Resend API key.
SMTP_HOSTNo—SMTP host.
SMTP_PORTNo—SMTP port.
SMTP_SECURENo—SMTP secure flag.
SMTP_USERNo—SMTP user.
SMTP_PASSWORDNo—SMTP password.
AWS_REGIONNo—AWS region for SES.
AWS_ACCESS_KEY_IDNo—AWS access key ID for SES.
AWS_SECRET_ACCESS_KEYNo—AWS secret access key for SES.
Worker
GRACEFUL_SHUTDOWN_TIMEOUTNo60000 (1m)Graceful shutdown timeout (ms). Affects shutdown time.
Concurrency limits
DEFAULT_ENV_EXECUTION_CONCURRENCY_LIMITNo100Default env execution concurrency.
DEFAULT_ORG_EXECUTION_CONCURRENCY_LIMITNo300Default org execution concurrency, needs to be 3x env concurrency.
DEFAULT_ENV_EXECUTION_CONCURRENCY_BURST_FACTORNo1.0Burst factor for env concurrency.
DEFAULT_DEV_ENV_EXECUTION_ATTEMPTSNo1Default max attempts for dev environment runs.
Dev
DEV_MAX_CONCURRENT_RUNSNo25Sets the max concurrency for dev runs via the CLI.
DEV_OTEL_EXPORTER_OTLP_ENDPOINTNoAPP_ORIGIN/otelOTel endpoint for dev runs.
Rate limiting
API_RATE_LIMIT_REFILL_INTERVALNo10sAPI rate limit refill interval.
API_RATE_LIMIT_MAXNo750API rate limit max.
API_RATE_LIMIT_REFILL_RATENo250API rate limit refill rate.
API_RATE_LIMIT_REQUEST_LOGS_ENABLEDNo0API rate limit request logs.
API_RATE_LIMIT_REJECTION_LOGS_ENABLEDNo1API rate limit rejection logs.
API_RATE_LIMIT_LIMITER_LOGS_ENABLEDNo0API rate limit limiter logs.
API_RATE_LIMIT_JWT_WINDOWNo1mAPI rate limit JWT window.
API_RATE_LIMIT_JWT_TOKENSNo60API rate limit JWT tokens.
API_RATE_LIMIT_METRICS_ENABLEDNo0Record API rate limit usage into the metrics table: 1 for everyone, allowlist for flagged organizations.
API_RATE_LIMIT_METRICS_BUCKET_SECONDSNo10Aggregation bucket width for API rate limit metrics: 10, 20, 30 or a multiple of 60.
API_RATE_LIMIT_METRICS_FLUSH_INTERVAL_MSNo10000How often aggregated API rate limit metrics are flushed to ClickHouse.
API_RATE_LIMIT_METRICS_MAX_ENTRIESNo10000Cap on distinct (environment, bucket) entries held between flushes.
API_RATE_LIMIT_METRICS_WAIT_FOR_ASYNC_INSERTNo0Wait for ClickHouse to write each async insert of API rate limit metrics, surfacing write failures.
API_RATE_LIMIT_METRICS_INSERT_BUSY_TIMEOUT_MSNo10000How long ClickHouse buffers API rate limit metric inserts before writing a part.
API_KEY_ALLOW_PRIVATE_IP_RANGESNo0Allow private and reserved ranges in API key IP allowlists.
WEBHOOK_METRICS_FLUSH_INTERVAL_MSNo10000How often aggregated webhook limit metrics are flushed to ClickHouse.
WEBHOOK_METRICS_MAX_ENTRIESNo10000Cap on distinct (environment, bucket) entries held between flushes.
WEBHOOK_METRICS_MAX_ENDPOINTSNo500Cap on endpoints with their own webhook metric rows per environment and bucket; environment totals still count all.
QUEUE_SIZE_METRICS_INTERVAL_SECNo30Queue size sampling interval in seconds; must divide 60.
QUEUE_SIZE_METRICS_MAX_ENVSNo2000Most environments sampled per interval.
DEPLOYMENT_RATE_LIMIT_REFILL_INTERVALNo10sDeployment endpoints rate limit refill interval.
DEPLOYMENT_RATE_LIMIT_MAXNo1500Deployment endpoints rate limit max.
DEPLOYMENT_RATE_LIMIT_REFILL_RATENo500Deployment endpoints rate limit refill rate.
DEPLOYMENT_RATE_LIMIT_REQUEST_LOGS_ENABLEDNo0Deployment endpoints rate limit request logs.
DEPLOYMENT_RATE_LIMIT_REJECTION_LOGS_ENABLEDNo1Deployment endpoints rate limit rejection logs.
DEPLOYMENT_RATE_LIMIT_LIMITER_LOGS_ENABLEDNo0Deployment endpoints rate limit limiter logs.
Deploy & Registry
DEPLOY_REGISTRY_HOSTYes—Deploy registry host.
DEPLOY_REGISTRY_USERNAMENo—Deploy registry username.
DEPLOY_REGISTRY_PASSWORDNo—Deploy registry password.
DEPLOY_REGISTRY_NAMESPACENotriggerDeploy registry namespace.
DEPLOY_REGISTRY_ECR_DEFAULT_REPOSITORY_POLICYNo—Raw IAM policy JSON applied via SetRepositoryPolicy to every ECR repo created by the webapp. Use to grant cross-account pull access to EKS workers when the ECR account is separate from the cluster account.
DEPLOY_IMAGE_PLATFORMNolinux/amd64Deploy image platform, same values as docker --platform flag.
DEPLOY_BASE_IMAGESNo—Base images every deploy must build on, as comma-separated runtime=image@sha256:<digest>. See custom base images.
DEPLOY_BUILD_BASE_IMAGESNo—Build-stage images, in the same format as DEPLOY_BASE_IMAGES. See custom base images.
DEPLOY_TIMEOUT_MSNo480000 (8m)Deploy timeout (ms).
DEPLOY_QUEUE_TIMEOUT_MSNo900000 (15m)Deploy queue timeout (ms).
Object store (S3)
OBJECT_STORE_BASE_URLNo—Object store base URL (default provider).
OBJECT_STORE_BUCKETNo—Object store bucket name (default provider).
OBJECT_STORE_ACCESS_KEY_IDNo—Object store access key (default provider).
OBJECT_STORE_SECRET_ACCESS_KEYNo—Object store secret key (default provider).
OBJECT_STORE_REGIONNo—Object store region (default provider).
OBJECT_STORE_SERVICENos3Object store service (default provider).
OBJECT_STORE_DEFAULT_PROTOCOLNo—Protocol for new uploads (e.g. s3, r2). Enables protocol-prefixed storage. See migration guide below.
OBJECT_STORE_{PROTOCOL}_BASE_URLNo—Named provider base URL (replace {PROTOCOL}, e.g. OBJECT_STORE_S3_BASE_URL).
OBJECT_STORE_{PROTOCOL}_ACCESS_KEY_IDNo—Named provider access key.
OBJECT_STORE_{PROTOCOL}_SECRET_ACCESS_KEYNo—Named provider secret key.
OBJECT_STORE_{PROTOCOL}_REGIONNo—Named provider region.
OBJECT_STORE_{PROTOCOL}_SERVICENo—Named provider service.
ARTIFACTS_OBJECT_STORE_BUCKETNo—Optional separate bucket for artifacts. If not set, uses main object store.
ARTIFACTS_OBJECT_STORE_BASE_URLNo—Optional artifacts store base URL.
ARTIFACTS_OBJECT_STORE_ACCESS_KEY_IDNo—Optional artifacts store access key.
ARTIFACTS_OBJECT_STORE_SECRET_ACCESS_KEYNo—Optional artifacts store secret key.
ARTIFACTS_OBJECT_STORE_REGIONNo—Optional artifacts store region.
DEPLOYMENT_INDEX_OBJECT_STORE_BASE_URLNo—Optional separate store for deployment index snapshots. If not set, uses main object store.
DEPLOYMENT_INDEX_OBJECT_STORE_BUCKETNo—Deployment index store bucket. Required together with the base URL.
DEPLOYMENT_INDEX_OBJECT_STORE_ACCESS_KEY_IDNo—Deployment index store access key.
DEPLOYMENT_INDEX_OBJECT_STORE_SECRET_ACCESS_KEYNo—Deployment index store secret key.
DEPLOYMENT_INDEX_OBJECT_STORE_REGIONNo—Deployment index store region.
DEPLOYMENT_INDEX_OBJECT_STORE_SERVICENos3Deployment index store service.
DEPLOYMENT_INDEX_UPLOAD_MAX_ATTEMPTSNo4Attempts to store a deployment's index before the deploy fails.
DEPLOYMENT_INDEX_CAPTURE_ENABLEDNofalseSet to true to store each deployment's full index in object storage when it deploys.
Alerts
ORG_SLACK_INTEGRATION_CLIENT_IDNo—Slack client ID. Required for Slack alerts.
ORG_SLACK_INTEGRATION_CLIENT_SECRETNo—Slack client secret. Required for Slack alerts.
ALERT_EMAIL_TRANSPORTNo—Alert email transport.
ALERT_FROM_EMAILNo—Alert from email.
ALERT_REPLY_TO_EMAILNo—Alert reply-to email.
ALERT_RESEND_API_KEYNo—Alert Resend API key.
ALERT_SMTP_HOSTNo—Alert SMTP host.
ALERT_SMTP_PORTNo—Alert SMTP port.
ALERT_SMTP_SECURENo—Alert SMTP secure.
ALERT_SMTP_USERNo—Alert SMTP user.
ALERT_SMTP_PASSWORDNo—Alert SMTP password.
Limits
TASK_PAYLOAD_OFFLOAD_THRESHOLDNo524288 (512KB)Max task payload size before offloading to S3.
TASK_PAYLOAD_MAXIMUM_SIZENo3145728 (3MB)Max task payload size.
BATCH_TASK_PAYLOAD_MAXIMUM_SIZENo1000000 (1MB)Max batch payload size.
BATCH_CONCURRENCY_LIMIT_DEFAULTNo5Default concurrency for batch processing.
BATCH_RATE_LIMIT_REFILL_RATENo100Batch rate limit refill rate.
BATCH_RATE_LIMIT_MAXNo1200Batch rate limit max.
BATCH_RATE_LIMIT_REFILL_INTERVALNo10sBatch rate limit refill interval.
TASK_RUN_METADATA_MAXIMUM_SIZENo262144 (256KB)Max metadata size.
MAX_BATCH_V2_TRIGGER_ITEMSNo500Max batch size (legacy v2 API).
STREAMING_BATCH_MAX_ITEMSNo1000Max items in streaming batch (v3 API, requires SDK 4.3.1+).
STREAMING_BATCH_ITEM_MAXIMUM_SIZENo3145728 (3MB)Max size per item in streaming batch.
STREAMING_BATCH_INGEST_CONCURRENCYNo10Items ingested concurrently per streaming batch request. Peak memory ≈ this × item size. Set to 1 for sequential.
ENVIRONMENT_VARIABLES_COMPARE_MAX_KEYSNo1000Most keys one environment variables comparison compares, and most values the Needs attention page checks for empty ones. Above it the dashboard asks to search or pick fewer keys.
OTel limits
TRIGGER_OTEL_SPAN_ATTRIBUTE_COUNT_LIMITNo1024OTel span attribute count limit.
TRIGGER_OTEL_LOG_ATTRIBUTE_COUNT_LIMITNo1024OTel log attribute count limit.
TRIGGER_OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMITNo131072OTel span attribute value length limit.
TRIGGER_OTEL_LOG_ATTRIBUTE_VALUE_LENGTH_LIMITNo131072OTel log attribute value length limit.
TRIGGER_OTEL_SPAN_EVENT_COUNT_LIMITNo10OTel span event count limit.
TRIGGER_OTEL_LINK_COUNT_LIMITNo2OTel link count limit.
TRIGGER_OTEL_ATTRIBUTE_PER_LINK_COUNT_LIMITNo10OTel attribute per link count limit.
TRIGGER_OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMITNo10OTel attribute per event count limit.
SERVER_OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMITNo8192OTel span attribute value length limit.
Task events
EVENT_REPOSITORY_DEFAULT_STORENopostgresWhere to store task events. Set to clickhouse_v2 to store in ClickHouse (recommended for production).
EVENT_REPOSITORY_V1_REROUTE_ENABLEDNo1Routes the retired clickhouse store to clickhouse_v2, for new events and for reads. Set EVENT_REPOSITORY_DEFAULT_STORE=clickhouse_v2 and copy older events to keep them. 0 keeps the legacy store temporarily and will be removed.
EVENT_REPOSITORY_POSTGRES_WRITES_DISABLEDNo0Skip all PostgreSQL task-event writes (set to 1). Only enable when EVENT_REPOSITORY_DEFAULT_STORE is clickhouse_v2, otherwise task events are lost.
EVENTS_CLICKHOUSE_RETENTION_DAYSNo30Days to keep task events stored in ClickHouse (clickhouse_v2). The table deletes them 7 days after that. Only applies to events written after a change: existing events keep the expiry they were stored with. Set 365 to keep the previous one-year retention. With Docker set it in .env, with the Helm chart through webapp.extraEnvVars.
Realtime
REALTIME_BACKEND_NATIVE_ENABLEDNo0Set to 1 to enable native realtime run subscriptions and change notifications. When 0, subscriptions use Electric. The Helm chart sets this to 1.
REALTIME_BACKEND_DEFAULTNoelectricBackend for run subscriptions when native realtime is enabled and no realtimeBackend feature-flag override is set. One of electric, native, shadow. The Helm chart sets this to native. Separate from realtime stream version settings.
REALTIME_STREAM_VERSIONNov1Stream version exposed to tasks via the TRIGGER_REALTIME_STREAM_VERSION variable. Distinct from REALTIME_STREAMS_DEFAULT_VERSION. One of v1, v2.
REALTIME_STREAM_MAX_LENGTHNo1000Realtime stream max length.
REALTIME_STREAM_TTLNo86400 (1d)Realtime stream TTL (s).
REALTIME_STREAMS_DEFAULT_VERSIONNov1Server-side default the webapp uses when a stream request doesn't pin a version (modern SDKs request v2). The Docker and Helm self-hosting defaults set this to v2. One of v1, v2.
REALTIME_STREAMS_S2_BASINNo—S2 basin that holds v2 realtime streams. Required for v2. Must be at least 8 characters.
REALTIME_STREAMS_S2_ENDPOINTNo—Custom S2 API endpoint, including the /v1 suffix (e.g. http://s2/v1 for the bundled s2-lite). Omit to use hosted S2 at s2.dev.
REALTIME_STREAMS_S2_SKIP_ACCESS_TOKENSNofalseSkip minting per-stream access tokens. Set to true for s2-lite, which needs no authentication.
REALTIME_STREAMS_S2_ACCESS_TOKENNo—S2 access token. Required for hosted S2 unless REALTIME_STREAMS_S2_SKIP_ACCESS_TOKENS is true.
Deployment build logs (remote builds)
S2_ENABLEDNo0Set to 1 to store the logs of builds that run on a remote build server in S2. Requires S2_ACCESS_TOKEN and S2_DEPLOYMENT_LOGS_BASIN_NAME. A self-hosted deploy builds in the CLI, which prints the build output in your terminal, so there is no server-side build log and the deployment page has no Build logs tab. You don't need these variables to self-host.
S2_ACCESS_TOKENNo—S2 access token used to write build logs. Any non-empty value works with s2-lite.
S2_DEPLOYMENT_LOGS_BASIN_NAMENo—S2 basin that holds deployment build logs.
S2_DEPLOYMENT_LOGS_ENDPOINTNo—Custom S2 API endpoint for build logs, including the /v1 suffix (e.g. http://s2/v1 for the bundled s2-lite). Omit to use hosted S2 at s2.dev. The dashboard reads build logs from a custom endpoint. The CLI can't follow them from one, so deploy points to the dashboard for the logs.
S2_DEPLOYMENT_LOGS_PUBLIC_ENDPOINTNo—The S2 endpoint browsers read build logs from, when it differs from S2_DEPLOYMENT_LOGS_ENDPOINT (e.g. the public URL of your s2-lite).
S2_DEPLOYMENT_LOGS_SKIP_ACCESS_TOKENSNo0Set to 1 for s2-lite, which has no access tokens: build logs are read without a scoped token, and the CLI doesn't follow them. Anyone who can reach the endpoint can read every project's build logs, so use it only for local development or a single-tenant install.
Bootstrap
TRIGGER_BOOTSTRAP_ENABLEDNo0Trigger bootstrap enabled.
TRIGGER_BOOTSTRAP_WORKER_GROUP_NAMENo—Trigger bootstrap worker group name.
TRIGGER_BOOTSTRAP_WORKER_TOKEN_PATHNo—Trigger bootstrap worker token path.
Run engine
RUN_ENGINE_WORKER_COUNTNo4Run engine worker count.
RUN_ENGINE_TASKS_PER_WORKERNo10Run engine tasks per worker.
RUN_ENGINE_WORKER_CONCURRENCY_LIMITNo10Run engine worker concurrency limit.
RUN_ENGINE_WORKER_POLL_INTERVALNo100Run engine worker poll interval (ms).
RUN_ENGINE_WORKER_IMMEDIATE_POLL_INTERVALNo100Run engine worker immediate poll interval (ms).
RUN_ENGINE_WORKER_SHUTDOWN_TIMEOUT_MSNo60000 (1m)Run engine worker shutdown timeout (ms).
RUN_ENGINE_RATE_LIMIT_REFILL_INTERVALNo10sRun engine rate limit refill interval.
RUN_ENGINE_RATE_LIMIT_MAXNo1200Run engine rate limit max.
RUN_ENGINE_RATE_LIMIT_REFILL_RATENo400Run engine rate limit refill rate.
RUN_ENGINE_RATE_LIMIT_REQUEST_LOGS_ENABLEDNo0Run engine rate limit request logs.
RUN_ENGINE_RATE_LIMIT_REJECTION_LOGS_ENABLEDNo1Run engine rate limit rejection logs.
RUN_ENGINE_RATE_LIMIT_LIMITER_LOGS_ENABLEDNo0Run engine rate limit limiter logs.
RUN_ENGINE_DEFAULT_MAX_TTLNo—Maximum TTL for all runs (e.g. "14d"). Runs without a TTL use this as default; runs with a larger TTL are clamped.
MAXIMUM_DEV_QUEUE_SIZENo—Maximum queued runs per queue in development environments.
MAXIMUM_DEPLOYED_QUEUE_SIZENo—Maximum queued runs per queue in deployed (staging/prod) environments.
Webhooks
WEBHOOK_ENABLEDNo0Set to 1 to run hosted webhooks: ingest, delivery and waiters. See Webhooks.
WEBHOOK_REDIS_HOSTNolocalhostA node of the Redis cluster webhooks use for their queue and waiters. It must run in cluster mode.
WEBHOOK_REDIS_PORTNo6379Port of that node.
WEBHOOK_REDIS_USERNAMENo—Webhooks Redis username.
WEBHOOK_REDIS_PASSWORDNo—Webhooks Redis password.
WEBHOOK_REDIS_TLS_DISABLEDNoREDIS_TLS_DISABLEDSet to true to connect to the webhooks Redis without TLS.
WEBHOOK_INGRESS_ORIGINNoAPI_ORIGINPublic origin of the webhook URLs, for when you serve them from their own host.
WEBHOOK_INGRESS_BODY_SIZE_LIMIT_MBNo1Largest webhook request body accepted, in MB.
WEBHOOK_DATABASE_URLNoDATABASE_URLA separate PostgreSQL database for webhook endpoints and deliveries.
WEBHOOK_DELIVERY_RETENTION_DAYSNo30How many days of deliveries the dashboard and API show. It doesn't delete anything: deliveries are kept for WEBHOOK_DELIVERY_STORAGE_DAYS, or longer when this is higher.
WEBHOOK_DELIVERY_STORAGE_DAYSNo30How long deliveries are stored before they're deleted. Must be one of 3, 7, 30, 90, 180 or 365; any other value stops the webapp from starting.
Misc
TRIGGER_TELEMETRY_DISABLEDNo—Disable telemetry.
NODE_MAX_OLD_SPACE_SIZENo8192Maximum memory allocation for Node.js heap in MiB (e.g. "4096" for 4GB).
OPENAI_API_KEYNo—OpenAI API key.
MACHINE_PRESETS_OVERRIDE_PATHNo—Path to machine presets override file. See machine overrides.
APP_ENVNoNODE_ENVApp environment. Used for things like the title tag.
ADMIN_EMAILSNo—Regex of user emails to automatically promote to admin on signup. Does not apply to existing users.
ADMIN_DASHBOARD_ENABLEDNo1Set to anything other than 1 or true to disable the admin dashboard and user impersonation on this instance.
EVENT_LOOP_MONITOR_ENABLEDNo1Node.js event loop lag monitor.

Webhooks

Hosted webhooks are off on a self-hosted instance until you turn them on:

  1. Run a Redis (or Valkey) cluster for webhooks and point WEBHOOK_REDIS_HOST and WEBHOOK_REDIS_PORT at one of its nodes. The webhook engine connects in cluster mode, so a standalone Redis won't work.
  2. Set WEBHOOK_ENABLED=1 on the webapp.
  3. Give organizations access with the hasWebhooksAccess feature flag: turn it on for everyone on the admin dashboard's Global Feature Flags page, or for one organization from its feature flags on the Organizations page. An organization without it doesn't see Webhooks in the dashboard, and its deploys don't sync endpoints.

Webhook URLs are served from WEBHOOK_INGRESS_ORIGIN, which defaults to API_ORIGIN, so providers need to reach that origin from the internet.

The Docker Compose setup only passes the variables listed under the webapp service's environment in hosting/docker/webapp/docker-compose.yml, so add the webhook variables there. With the Helm chart, set them in webapp.extraEnvVars.

Logs page

The dashboard Logs page needs three things on a self-hosted instance:

  1. Store task events in ClickHouse: set EVENT_REPOSITORY_DEFAULT_STORE=clickhouse_v2 (the default is postgres). See Task events. The Logs page only searches events stored in ClickHouse. Switching the default doesn't move existing runs, and runs that already write to PostgreSQL keep writing there.
  2. Set LOGS_SEARCH_DUAL_WRITE_ACTIVE=on so new logs are also written to the table the Logs page searches. It's off by default, which leaves the page empty. It doesn't backfill: logs written before you turn it on aren't searchable. Setting it back to off stops new writes but keeps the rows already written. To turn it on for some organizations only, set it to by-id and list their IDs, comma-separated, in LOGS_SEARCH_DUAL_WRITE_ORGANIZATION_IDS.
  3. Give organizations access with the hasLogsPageAccess feature flag: turn it on for everyone on the admin dashboard's Global Feature Flags page, or for one organization from its feature flags on the Organizations page. Without it, only admins see Logs in the sidebar.

The Logs page searches at most 30 days back, which isn't configurable. The search table keeps rows for 90 days.

The Docker Compose setup only passes the variables listed under the webapp service's environment in hosting/docker/webapp/docker-compose.yml, so add LOGS_SEARCH_DUAL_WRITE_ACTIVE there, and LOGS_SEARCH_DUAL_WRITE_ORGANIZATION_IDS if you use by-id (EVENT_REPOSITORY_DEFAULT_STORE is already passed). With the Helm chart, set them in webapp.extraEnvVars.

Buffered tasks

Buffered tasks work on a self-hosted instance with no extra services. One webapp process accepts items, stores them in your object store under the buffer/ prefix, and turns closed windows into runs. Self-hosting buffered tasks covers the object store check, bucket permissions, consumer processes, sizing and failure behavior.

They need an object store that supports conditional writes (If-None-Match: *). The webapp checks at startup, and again every minute while the store refuses them. Without them, buffered triggers answer 501 and the webapp logs Buffered tasks are disabled with the reason; everything else works. The MinIO image in the Docker Compose setup supports them; MinIO releases from 2023 don't. When the store can't be reached at all, buffered triggers answer 503 and the check runs again after 10 seconds.

Buffered tasks are on for every organization by default. Turn them off with BUFFERED_TASKS_ENABLED=0, or per organization with the bufferedTasks feature flag on the admin dashboard (an organization's own flag wins over the global one, which wins over the env var).

NameDefaultDescription
BUFFERED_TASKS_ENABLED1Whether organizations without their own bufferedTasks flag (and no global one) can buffer items.
BUFFERED_TASKS_OBJECT_STORE_PROTOCOLOBJECT_STORE_DEFAULT_PROTOCOLThe named object store provider to keep buffered items in (for example s3). Unset uses the default provider.
BUFFERED_TASKS_ROLEallWhat this process does for buffered tasks. all: accept, store and run (one process does everything). api: accept items and forward them to the ingest service. ingest: only store items forwarded by api processes. consumer: only turn closed windows into runs.
BUFFERED_TASKS_INGEST_ORIGINunsetWhere api processes reach the ingest service, for example http://buffer-ingest:3000. Required with BUFFERED_TASKS_ROLE=api.
BUFFERED_TASKS_INGEST_SECRETunsetShared secret between api and ingest processes. Required for both roles; the ingest endpoint answers 404 without it. Run: openssl rand -hex 32
BUFFERED_TASKS_SHARD_COUNT1 with all, else 16How many shards windows are spread over (1 to 256). Each consumer process holds some of them. You can raise it later to a multiple of the current count (at most 4x per change, at least 10 minutes apart); it can't shrink.
BUFFERED_TASKS_INGEST_INTERVAL_MS50How often the ingest process writes a batch of items to the object store. Each write is one request, so a longer interval costs less and adds latency to every buffered trigger.
BUFFERED_TASKS_INGEST_RATE_LIMIT_PER_SECOND1000Buffered items per second per environment, separate from the API rate limit. The default for every organization; an organization's override in the back office replaces it.
BUFFERED_TASKS_INGEST_RATE_LIMIT_BURST2000Burst size for the buffered item rate limit. The default for every organization.
BUFFERED_TASKS_MAX_HELD_WINDOWS_PER_ENV100000Open windows an environment can have before new items get a 429.
BUFFERED_TASKS_MAX_HELD_ITEMS_PER_ENV1000000Items not yet in a run an environment can have before new items get a 429.

To outgrow one process, keep BUFFERED_TASKS_ROLE=all on the webapp and add processes from the same image with BUFFERED_TASKS_ROLE=consumer, and set BUFFERED_TASKS_SHARD_COUNT on all of them to the new count. Consumers share the shards between them and rebalance when one joins or leaves; a consumer that stops normally hands its shards over at once, and a crashed consumer's shards are taken over after its lease runs out (about 10 seconds). ingest and consumer processes don't run the run engine's workers or replication, whatever the rest of their environment says.

The Docker Compose setup and the Helm chart need no changes for the defaults. To set any of these, add them under the webapp service's environment in hosting/docker/webapp/docker-compose.yml, or in webapp.extraEnvVars with the Helm chart.

Multi-Provider Object Storage

The object storage system supports multiple S3-compatible providers (R2, S3, GCS, MinIO, etc.) using protocol prefixes. This enables migrating between providers without breaking existing runs.

How It Works

When data exceeds the configured threshold (TASK_PAYLOAD_OFFLOAD_THRESHOLD), it's uploaded to object storage. The storage location is saved in the database with an optional protocol prefix:

  • With protocol: s3://run_abc/payload.json or r2://batch_123/item_0/payload.json
  • Without protocol (legacy): batch_123/item_0/payload.json (uses default provider)

Configuration

Default Provider (Backward Compatible)

The default provider is used for data without a protocol prefix:

# Default provider (backward compatible - no protocol prefix)
OBJECT_STORE_BASE_URL=https://r2.example.com
OBJECT_STORE_ACCESS_KEY_ID=...
OBJECT_STORE_SECRET_ACCESS_KEY=...
OBJECT_STORE_REGION=auto
OBJECT_STORE_SERVICE=s3

Named Providers

Named providers are accessed via protocol-prefixed URIs. Configure them using OBJECT_STORE_{PROTOCOL}_* variables:

# S3 provider (accessed via s3:// prefix)
OBJECT_STORE_S3_BASE_URL=https://s3.amazonaws.com
OBJECT_STORE_S3_ACCESS_KEY_ID=...
OBJECT_STORE_S3_SECRET_ACCESS_KEY=...
OBJECT_STORE_S3_REGION=us-east-1
OBJECT_STORE_S3_SERVICE=s3

# R2 provider (accessed via r2:// prefix)
OBJECT_STORE_R2_BASE_URL=https://...r2.cloudflarestorage.com
OBJECT_STORE_R2_ACCESS_KEY_ID=...
OBJECT_STORE_R2_SECRET_ACCESS_KEY=...
OBJECT_STORE_R2_REGION=auto
OBJECT_STORE_R2_SERVICE=s3

Default Protocol for New Uploads

Set OBJECT_STORE_DEFAULT_PROTOCOL to specify which provider to use for new uploads:

# Use S3 for new uploads (old data without prefix still uses default provider)
OBJECT_STORE_DEFAULT_PROTOCOL=s3

Migration Guide

To migrate from R2 to S3 without breaking existing runs:

Configure S3 provider

Add S3 credentials as a named provider:

OBJECT_STORE_S3_BASE_URL=https://s3.amazonaws.com
OBJECT_STORE_S3_ACCESS_KEY_ID=...
OBJECT_STORE_S3_SECRET_ACCESS_KEY=...
OBJECT_STORE_S3_REGION=us-east-1

Keep your existing OBJECT_STORE_* variables (R2) as the default provider.

Test the configuration

Restart the webapp and verify both providers work:

  • Old runs (no prefix) should still access R2
  • New runs with s3:// prefix should use S3
Switch to S3 for new uploads

Set the default protocol to use S3 for new uploads:

OBJECT_STORE_DEFAULT_PROTOCOL=s3

After this change:

  • New data uses s3:// prefix and goes to S3
  • Old data (no prefix) still uses R2
  • Data with explicit protocol uses the corresponding provider
Optionally decommission R2

Once all active runs using R2 data have completed (check your data retention policies), you can remove the R2 credentials. Keep OBJECT_STORE_DEFAULT_PROTOCOL=s3 to ensure new data continues using S3.

Was this page helpful?

Last updated

Edit on GitHub