The engine reads its configuration from environment variables. With Docker Compose they live in apps/engine/.env; start from apps/engine/.env.example. Everything not marked required has a working default for a local stack.
Required
Variable
What it is
DATABASE_URL
PostgreSQL connection string. The default points at the bundled postgres service. The engine runs its sessions in UTC (it adds options=-c TimeZone=UTC unless you set a time zone yourself). Behind PgBouncer (pgbouncer=true), set the database's own zone instead: ALTER DATABASE <name> SET timezone = 'UTC'.
REDIS_URL
Redis connection string. The default points at the bundled redis service.
ENCRYPTION_MASTER_KEY
Key for AES-256-GCM encryption of adapter credentials and other secrets at rest. 64 hex characters: openssl rand -hex 32.
ENGINE_AUTH_SECRET
Signs tokens and sessions. At least 64 characters: openssl rand -hex 64.
LICENSE_KEY
The signed license issued by 1Putt under your contract (mdh_lic_v1.…).
METRICS_TOKEN
Token Prometheus sends to /api/metrics. At least 32 characters.
MLLP_ENGINE_TOKEN
Token the MLLP listener sends to the engine. At least 32 characters. Needed when you receive HL7v2 over MLLP.
ALLOWED_ORIGINS
Comma-separated origins allowed to call the engine API from another web app in a browser (CORS). When unset, the engine's own ENGINE_PUBLIC_URL; with neither, localhost only. * never matches.
Security and sign-in
Variable
Default
What it does
ENGINE_PUBLIC_URL
unset
The engine's public address behind a proxy. Used for sign-in links, the CSRF check and the Google redirect URI.
ENGINE_REFRESH_TOKEN_TTL
30d
How long an API client's refresh token lasts (12h, 90d, at most 365d). See Authentication.
Google Workspace sign-in. Off unless both are set, plus ENGINE_ALLOWED_DOMAINS.
ENGINE_ALLOWED_DOMAINS
empty
Workspace domains that may sign in, comma-separated.
ENGINE_BREAK_GLASS_EMAIL
empty
With "Require SSO for everyone" on, the one admin who may still sign in with a password. Empty: any admin may.
ENGINE_TRUSTED_DEVICE_DAYS
0 (off)
Days a browser may skip the emailed sign-in code after "Remember this device", 1 to 90 (Helm sso.trustedDeviceDays). The password is still asked. 0 turns it off and stops every remembered device.
ENGINE_SESSION_IDLE_MINUTES
60
Minutes without activity after which a person's session ends, 1 to 720 (Helm sso.sessionIdleMinutes). Background refreshes don't count as activity. Out of range: ignored with a warning.
ENGINE_SESSION_MAX_HOURS
12
Hours after sign-in at which every session ends, however active, 1 to 24 (Helm sso.sessionMaxHours). Out of range: ignored with a warning.
ENGINE_DEFAULT_ROLE
operator
Role for people created by their first Google sign-in.
ENGINE_EMAIL_FROM
unset
Sender for sign-in codes and links. Needs RESEND_API_KEY or ENGINE_EMAIL_WEBHOOK_URL.
Sends engine email through a webhook of your own. The engine posts each message and sends the token as a bearer token.
CLIENT_IP_SOURCE
none
Which header your proxy writes the client IP to: none, gclb, last-hop or x-real-ip. See Client IP addresses.
TRUSTED_PROXY_HOPS
0
Proxies in front of the one CLIENT_IP_SOURCE names (e.g. 1 for Cloudflare in front of GCLB). Alone, it keeps its old meaning.
AI_ZERO_DATA_RETENTION
unset
true when a zero-data-retention agreement covers your AI provider: the BAA card then reads "zero · not used for training". Otherwise it names the provider's standard terms.
AUDIT_FLAG_TIMEZONE
unset
Pins the zone the audit flags' working hours (06:00 to 22:00) are judged in. Unset: each workspace's zone, else the engine's (TZ).
IP_ALLOWLIST_FAIL_OPEN
true
Whether requests pass when the IP allowlist cannot be read. Set false to block instead.
ALLOW_PRIVATE_URLS
false
Lets adapters reach private IP ranges. The engine ignores it when NODE_ENV=production and logs a warning. Use SSRF_ALLOWLIST instead.
ENCRYPTION_MASTER_KEY_PREVIOUS
unset
Old keys, kept for decryption only while you rotate the master key.
Old message keys, comma-separated, kept so older stored messages still read.
ENCRYPT_STORED_MESSAGES
false
true encrypts every workflow's stored messages, whatever each workflow's own setting says.
Single sign-on
One generic OIDC identity provider and one SAML 2.0 identity provider. Both need ENGINE_PUBLIC_URL: the redirect URI, entity ID and ACS URL are built from it, never from the request's Host. Each is off until its first three variables are set, and turns itself off (with an error in the log) when a value doesn't parse. More providers can be added in Settings → Single sign-on → Other identity providers. See Single sign-on.
Variable
Default
What it does
ENGINE_OIDC_ISSUER
unset
The IdP's issuer URL (https; http only for a loopback test IdP). Discovery is read from it.
ENGINE_OIDC_CLIENT_ID, ENGINE_OIDC_CLIENT_SECRET
unset
The confidential client registered at the IdP. Keep the secret in your secrets manager.
ENGINE_OIDC_LABEL
Single sign-on
Button text: Continue with the label.
ENGINE_OIDC_SCOPES
openid email profile
Scopes to ask for, space-separated.
ENGINE_OIDC_GROUPS_CLAIM
groups
id_token claim with the person's groups or roles (roles for Entra app roles).
ENGINE_OIDC_TOKEN_AUTH
client_secret_basic
client_secret_post sends the secret in the body instead.
ENGINE_OIDC_TRUST_EMAIL
false
Let an email without email_verified create a new person (Entra single-tenant apps). Never links an existing account.
ENGINE_SAML_IDP_ENTITY_ID
unset
The IdP's entity ID (the Issuer of its assertions).
ENGINE_SAML_IDP_SSO_URL
unset
The IdP's single sign-on URL (HTTP-Redirect), https.
ENGINE_SAML_IDP_CERT
unset
The IdP's signing certificate, PEM or base64. Several during a rollover. \n escapes work.
ENGINE_SAML_LABEL
SAML single sign-on
Button text.
ENGINE_SAML_SP_ENTITY_ID, ENGINE_SAML_ACS_URL
from ENGINE_PUBLIC_URL
The engine's entity ID and ACS URL, if the IdP needs others. Setting both runs SAML without ENGINE_PUBLIC_URL.
ENGINE_SAML_GROUPS_ATTRIBUTE
common names
Attribute with groups; by default groups, memberOf and the Microsoft group and role claims.
ENGINE_SAML_TRUST_EMAIL
true
Let an email the IdP does not mark verified create a new person. Never links an existing account.
ENGINE_SAML_REQUIRE_SIGNED_RESPONSE
false
Also require the Response signature. The assertion signature is always required.
ENGINE_OIDC_GROUP_ROLES, ENGINE_SAML_GROUP_ROLES
empty
group=role entries, ; or new line separated. Roles: viewer, operator, admin.
Where the engine asks whether 1Putt revoked its license, at startup and every 6 hours. Unset turns the check off.
SKIP_LICENSE_VALIDATION
unset
true skips the license check when running the engine from source (next dev). Release images always run as production and refuse to start with it.
Runtime and retention
Variable
Default
What it does
NODE_ENV
production in .env.example
production, development or test.
LOG_LEVEL
info
debug, info, warn or error.
MAX_CONCURRENT_WORKFLOWS
20 (.env.example sets 5)
Executions one engine replica runs at the same time. One queue per process, so this is the replica's real capacity.
AUDIT_LOG_RETENTION_DAYS
2190 (six years)
Expired audit events are archived to AUDIT_LOG_ARCHIVE_DIR, then deleted. With no archive, nothing is deleted.
AUDIT_LOG_ARCHIVE_DIR
unset
Where expired audit events are written before deletion.
EXECUTION_RETENTION_DAYS
2190
Executions and step results older than this are deleted every 6 hours. 0 keeps them. A workflow can set its own retention with PUT /api/workflows/{id}/retention.
EXECUTION_ARCHIVE_DIR
unset
Where expired executions are archived (gzip NDJSON, message content encrypted) before retention deletes them. Unset: no archive.
GRAPHQL_ENABLED
off
true turns on /api/graphql.
AUDIT_LOG_PURGE_UNARCHIVED
unset
true deletes expired audit events even with no archive. Leave it off if you must keep six years.
ALERT_RULES_ENABLED
on
false stops the alert rule runner.
SAMPLE_FETCH_ENABLED
on
false turns off Fetch a sample in the workflow builder: a live, read-only read of a polling trigger's (or a first read step's) connection whose first item becomes the sample.
WORKFLOW_TIMEOUT_MS
1800000 (30 minutes)
The longest one execution may run before the engine aborts it.
MAX_CONCURRENT_ADAPTER_CALLS
10
Calls in flight at once for each adapter profile, per engine process. A profile's maxConcurrentCalls replaces it with a cap across all replicas.
ADAPTER_SLOT_WAIT_MS
60000
How long a step waits for a profile's call slot or calls-per-second token. Then it fails without sending, and its retry applies.
EXECUTION_NODE_RESULT_MAX_BYTES
10485760 (10 MiB)
The largest step output stored in an execution's history. A larger one is stored as a truncated marker.
WORKFLOW_MAX_PENDING
5000
Pending executions a workflow may have. Past that, inbound deliveries are answered 503 NOT_ACCEPTED, or AE over MLLP.
INTAKE_SLOW_ACK_FROM
a fifth of WORKFLOW_MAX_PENDING (1000)
Graceful back-pressure: from this many pending executions of a workflow, the answer to an accepted delivery (the AA, or the 2xx) waits a little before it is sent. The delivery is already recorded. A sender that sends one message at a time then keeps pace with the engine.
INTAKE_SLOW_ACK_MAX_MS
1500
The wait at WORKFLOW_MAX_PENDING. It rises evenly from 0 at INTAKE_SLOW_ACK_FROM. 0 turns the wait off. At most 10000.
INTAKE_BACKLOG_CACHE_MS
1000
How long intake reuses a workflow's pending count, plus what it accepted since, while the backlog is well under WORKFLOW_MAX_PENDING. Near the cap each delivery counts again, so the cap is exact. 0 counts on every delivery.
MESSAGE_SEARCH_TIMEOUT_MS
20000
Statement timeout on the indexed part of a Messages search (1000 to 300000). A search that runs longer answers 503 SEARCH_TIMEOUT and frees its database connection instead of holding it.
WORK_POLL_MS
1000
How often the work runner looks for pending executions.
SFTP_SESSION_IDLE_MS
60000
How long an idle SFTP session to a profile stays open for reuse.
CRON_CATCHUP_MAX_SLOTS
10
The most missed cron slots one trigger with missedRuns catches up when an engine starts.
CRON_CATCHUP_WINDOW_HOURS
24
How far back missed cron slots are caught up.
SANDBOX_ALLOW_UNSAFE_VM
off
true runs custom JavaScript on node:vm when isolated-vm cannot load. It enforces no memory limit and is not a security boundary. Local development only; never in production.
SANDBOX_ROUTE_BUDGET
100
Runs a chain may queue with router.routeMessage in Mirth scripts: a run and every run it started share it, across replicas. 1 to 100000.
SHUTDOWN_TIMEOUT_MS
30000
How long the engine waits for running executions to finish when it stops.
REDIS_EXECUTION_TTL_SECONDS
900
How long the live status snapshot of an execution stays in Redis. From 60 to 3600.
EXECUTION_HEARTBEAT_INTERVAL_MS
30000
How often a running execution records that its engine instance is alive.
EXECUTION_STALE_AFTER_MS
120000
A running execution with no heartbeat for this long is failed by recovery, or put back to pending if it had not started a step. At least three heartbeat intervals.
EXECUTION_RECOVERY_SWEEP_MS
60000
How often each engine instance looks for orphaned executions.
ENGINE_ID
derived
The name this engine gives itself when it publishes a workflow to the marketplace.
REDIS_PASSWORD
unset
The Redis password, used when REDIS_URL carries none, as with a managed Redis.
REDIS_TLS_CA_FILE
unset
A PEM file with the Redis server's CA, for a rediss:// URL. Set with a redis:// URL, the engine refuses to connect.
BULK_REPROCESS_MAX
1000
The most messages one bulk reprocess request may run again. At most 10000.
MIGRATION_CUTOVER_MIN_MESSAGES
100
A parallel run's Cut over recommends (in a production workspace, past it only with Cut over anyway and a reason) that the run has compared this many messages. A value that is not a whole number keeps the default.
MIGRATION_CUTOVER_MIN_DAYS
7
A parallel run's Cut over recommends that the run is this many days old. 0 turns the wait off.
MIGRATION_CUTOVER_MIN_PER_TYPE
1
A parallel run's Cut over recommends that each message type the run has seen has this many compared messages.
WEB_APP_URL
https://medhook.dev
The medhook.dev address the engine uses to publish to and import from the workflow marketplace, for the opt-in support heartbeat and for the diagnostics reachability check. The license check does not use it. Helm sets it from engine.env.WEB_APP_URL.
MEDHOOK_SKIP_MIGRATIONS
false
true makes the image start the server without applying database migrations first. Helm sets it, because its migrate init container already applied them.
NODE_EXTRA_CA_CERTS
unset
Node's own setting: a PEM file of extra CAs the engine trusts. A SQL Database profile for Oracle over TLS needs its private CA here, not in the profile. Set it with engine.env and a mounted file; Helm does not set it on the engine.
Workflow limits
Caps that keep one workflow from starving a shared engine. Each can be raised (or lowered) up to a hard ceiling; a value above it is clamped to it, and a value that is not a whole number is ignored. With Helm, set workflowLimits.*.
Variable
Helm value
Default
Range
What it caps
SANDBOX_MEMORY_LIMIT_MB
workflowLimits.sandboxMemoryMb
128
32 to 1024
Memory of one JavaScript step, shared library or JavaScript Writer run.
SANDBOX_CODE_TIMEOUT_MS
workflowLimits.sandboxTimeoutMs
5000
100 to 120000
Time of one script run, its engine calls (http.request, database, files, routes) included. Also a script database statement's timeout.
SANDBOX_DB_MAX_ROWS
workflowLimits.sandboxDbMaxRows
1000
1 to 10000
Rows one script executeCachedQuery may return; more fails the call.
SANDBOX_HTTP_MAX_CALLS
workflowLimits.sandboxHttpMaxCalls
20
1 to 200
http.request calls per script run.
SANDBOX_HTTP_MAX_BYTES
workflowLimits.sandboxHttpMaxBytes
8388608 (8 MiB)
1 KiB to 32 MiB
Request and response bodies of a run's http.request calls.
MAX_LOOP_ITERATIONS
workflowLimits.maxLoopIterations
1000
1 to 100000
Items one loop step runs (a loop's maxIterations up to it), and the default of WEBHOOK_MAX_NDJSON_RESOURCES.
WORKFLOW_MAX_CALL_DEPTH
workflowLimits.workflowMaxCallDepth
5
1 to 25
Workflows deep a chain of Run workflow, Call workflow, topic and routeMessage runs may go.
SOAP_MAX_BODY_BYTES
workflowLimits.soapMaxBodyBytes
5242880 (5 MiB)
1 byte to 50 MiB
Largest SOAP listener request body; larger is 413. The envelope is parsed with the same limit.
The builder's checks show the defaults; save and deploy check again with the engine's values. Raising a memory or time limit lets one step hold a worker longer: raise MAX_CONCURRENT_WORKFLOWS or the engine's resources with it.
PHI
Variable
Default
What it does
MEDHOOK_PHI_ENFORCEMENT
enabled
Blocks workflows marked as handling PHI unless the signed license allows PHI, which 1Putt sets once the BAA is executed. warn only logs; disabled is for development.
MEDHOOK_PHI_ALL
off
true treats every workflow as handling PHI.
Inbound triggers
Variable
Default
What it does
WEBHOOK_ALLOW_UNSIGNED
false
Lets webhook triggers without an HMAC secret accept unsigned requests. Leave it off.
TRIGGER_RATE_LIMIT_PER_MINUTE
600
Requests per minute for each webhook or FHIR subscription.
MLLP_INGEST_RATE_LIMIT
6000
Requests per minute from the MLLP listener.
DICOM_ENGINE_TOKEN
none
Token the DICOM listener sends to /api/triggers/dicom. At least 32 characters; use the same value on the listener. Needed when you receive DICOM.
DICOM_INGEST_RATE_LIMIT
6000
Requests per minute from the DICOM listener.
DICOM_MAX_OBJECT_BYTES
134217728 (128 MiB)
Largest DICOM object the engine stores, and the most a Deflated object may inflate to when a DICOM step sends it. Use the listener's value.
DICOM_STORE_DIR
/var/lib/medhook/dicom
Where received DICOM objects are kept (Helm dicom.store). Every engine replica needs it: ReadWriteMany with more than one.
DICOM_STORE_RETENTION_DAYS
30
Days a stored DICOM object and its reference last. 0 keeps objects; references then expire after 365 days.
MLLP_REPLAY_TARGETS
unset
host:port pairs that batch replay may send to over MLLP. Unset turns MLLP replay off.
WEBHOOK_MAX_BODY_BYTES
10485760
Largest webhook body, in bytes. A larger one is refused with 413.
WEBHOOK_MAX_NDJSON_RESOURCES
MAX_LOOP_ITERATIONS
Most resources in one NDJSON webhook upload (default: the loop limit, 1000).
INBOUND_DEDUP_TTL_HOURS
24
How long the engine remembers what it accepted, to drop resends: an MSH-10, an Idempotency-Key, a FHIR resource version, X12 control numbers, and SFTP pickup files once they leave the folder.
INBOUND_RETRY_AFTER_SECONDS
30
The Retry-After on every 503 from a webhook, X12 or FHIR subscription intake: nothing was recorded, or the original is still being recorded.
WEBHOOK_SYNC_MAX_WAITERS
50
Webhook and SOAP answers in response.mode: destination one replica waits for at once. Past that, the sender gets 202 at once.
SOAP_MAX_BODY_BYTES
5242880
Largest SOAP request body, in bytes, at most 50 MiB (workflow limits). A larger one is refused with 413 before parsing.
JMS_MAX_MESSAGE_BYTES
10485760
Largest JMS message the JMS Listener reads, in bytes. A larger one is rejected (dead-lettered by the broker) without being read.
WORK_LANE_LEASE_MS
120000
How long one engine replica holds an ordering lane (MLLP sending facility, or a fifo trigger) while its message runs. Renewed every quarter.
WORK_LANE_CONTINUE_MAX
32
Messages one replica runs in a row from an ordering lane, on one lease, before the lane yields to other lanes. 0 hands the lane back after every message.
WORK_GRAPH_CACHE_MS
1000
How long the work runner serves a workflow's graph without checking it, when the graph is asked for without a claim. A claimed message is always checked against the stamp its claim returned. 0: every time.
FHIR_SUBSCRIPTION_SYNC_ON_STARTUP
on
false stops the engine from refreshing FHIR subscriptions when it starts.
MEDPLUM_REQUEST_TIMEOUT_MS
10000
Timeout of each Medplum request the engine makes to manage FHIR subscriptions.
FHIR_SUBSCRIPTION_SAVE_SYNC_BUDGET_MS
15000
Longest a workflow save waits for its FHIR subscription sync; after that the sync continues in the background.
ENGINE_BASE_URL
http://engine:3000
The engine address the local Medplum server calls back for FHIR subscriptions. Set it when the engine is not reachable from Medplum at that name.
MLLP_ADVERTISED_HOST, MLLP_ADVERTISED_PORT
unset, then MLLP_PORT
The address and port the builder shows senders as Listening on. Helm sets the host from mllp.advertisedHost.
MLLP_INTERNAL_HOST
unset
The MLLP listener's in-cluster address, which the builder also shows. Helm sets it to the listener Service's DNS name whenever mllp.enabled is on.
MLLP_TUNNEL_NAME
unset
The site-to-site tunnel MLLP senders come through. The builder and the workflow list show its state next to MLLP workflows. Set it with engine.env.
MLLP_HEALTH_URL
http://medhook-mllp:8080/health
The MLLP listener's health route, read by /api/health and diagnostics. Helm sets it from the release's internal MLLP Service and mllp.healthPort.
SMART_CLIENT_ID, SMART_CLIENT_SECRET
empty
The client the SMART on FHIR launch uses.
SMART_REDIRECT_URI
the engine's /api/auth/smart/callback
Where the EHR sends the browser after authorization.
MLLP listener
The MLLP listener is a separate container. These variables are set on it, not on the engine. See MLLP and ACKs.
Variable
Default
What it does
MLLP_PORT
2575
The TCP port the listener binds to.
MLLP_LISTENERS
none
JSON list of named listeners (name, port, ackMode, tls, and for raw TCP framing, startBytes, endBytes, response, maxConnections, idleTimeoutMs, frameTimeoutMs). Helm renders it from mllp.listeners into the configmap both read. Under Docker Compose, set it in .env; the Compose file passes it to the engine and to mllp-server, which must see the same value: an engine that does not see a raw TCP listener refuses its data, the listener answers AE, and the sender retries forever. A bad value stops the listener.
MLLP_HOST
0.0.0.0
The interface it binds to.
MLLP_TIMEOUT
30000
Milliseconds it waits for the engine before it sends AE.
MLLP_MAX_FRAME_BYTES
10485760 (10 MiB)
The largest message in one frame. A larger frame gets AR and the connection closes.
ENGINE_URL
the engine service
Where it posts messages.
MLLP_ENGINE_TOKEN
none
The token the engine requires. Use the same value on both. At least 32 characters.
HEALTH_PORT
8080
The health endpoint's port.
DICOM listener
The DICOM listener is a separate container (Helm dicom.*). These variables are set on it, not on the engine. See Triggers: DICOM.
Variable
Default
What it does
DICOM_PORT
11112
The TCP port the listener binds to.
DICOM_AE_TITLE
MEDHOOK
The listener's AE title. An association that calls another one is refused.
DICOM_ALLOWED_CALLING_AE_TITLES
empty (any caller)
Comma-separated calling AE titles to accept. A routing check, not authentication: restrict the network, or use mutual TLS.
DICOM_MAX_OBJECT_BYTES
134217728 (128 MiB)
The largest object. A larger one aborts the association. Also caps any other DIMSE dataset.
DICOM_MAX_ASSOCIATIONS
10
Associations at once, one C-STORE at a time each. Past that, a new one is refused with a transient reason.
DICOM_MAX_INFLIGHT_BYTES
536870912 (512 MiB)
Object bytes held at once across all associations, at least DICOM_MAX_OBJECT_BYTES. Past it a C-STORE is answered Out of Resources (0xA700). Size memory at 2 x this + 64 MiB per association + 128 MiB. Slow senders with large objects can hold it until their association lifetime ends: restrict the port, or shorten DICOM_MAX_ASSOCIATION_LIFETIME_MS.
DICOM_IDLE_TIMEOUT_MS
60000
Time an associated peer may stay silent between PDUs; paused while the engine records an object. Past it the connection is dropped.
DICOM_ASSOCIATION_TIMEOUT_MS
10000
Time a peer has from connecting to finish its association request. Trickled bytes don't extend it.
DICOM_MAX_PENDING_CONNECTIONS
32
Connections not yet associated, across all peers. Past it a new connection is closed at once.
DICOM_MAX_CONNECTIONS_PER_IP
8
Open connections from one address: an IPv4 address, or an IPv6 /64 (::a.b.c.d and NAT64 64:ff9b::a.b.c.d senders share one). Raise it when a load balancer hides client addresses. Many IPv4 sources can still fill the pending pool: restrict the port with dicom.networkPolicy.allowedCidrs.
DICOM_MAX_ASSOCIATION_LIFETIME_MS
3600000 (1 h)
Longest an association lasts, however active; then A-ABORT and the sender reconnects. 0 turns it off (Mirth has no such limit).
DICOM_ENGINE_TIMEOUT_MS
60000
Milliseconds it waits for the engine before it answers Out of Resources (0xA700).
DICOM_TLS_CERT_FILE, DICOM_TLS_KEY_FILE
none
PEM certificate and key: set both to listen over TLS (1.2 or later, DICOM_TLS_MIN_VERSION).
DICOM_TLS_CA_FILE, DICOM_TLS_REQUIRE_CLIENT_CERT
none, false
true requires a client certificate signed by that CA (mutual TLS). It is not tied to an AE title.
ENGINE_URL
the engine service
Where it posts objects.
DICOM_ENGINE_TOKEN
none
The token the engine requires. Use the same value on both. At least 32 characters.
HEALTH_PORT
8080
The health and metrics port.
Network safety
Adapters that call out to a URL refuse addresses in private, loopback and link-local ranges.
Variable
Default
What it does
SSRF_ALLOWLIST
empty
Comma-separated host names or addresses that skip the check, such as one internal FHIR server, and CIDRs whose private addresses may be reached, such as 10.20.0.0/16. Never opens link-local or metadata addresses; a CIDR never opens loopback or the engine's own ranges.
SSRF_DENYLIST
empty
Comma-separated host names or addresses that are always blocked, on top of the built-in ranges.
The FTP, SMB and WebDAV adapters follow these rules too: a private file server needs its name or address in SSRF_ALLOWLIST, and the engine connects to the address it checked.
Variable
Default
What it does
FILE_ADAPTER_ROOTS
empty
Comma-separated absolute folders a Local File profile may use; its baseDir must be one of them or inside one, after symlinks are resolved. Empty refuses every path. Helm sets it from fileAdapter.mounts.
The EHR setup sandbox patient test calls only the Epic and Oracle Health public sandboxes. For a test or self-hosted sandbox that never holds live PHI:
Variable
Default
What it does
EHR_SANDBOX_HOSTS
empty
Comma-separated extra hosts the sandbox patient test may call. Plain http is allowed for these hosts only.
EHR_SANDBOX_HOSTS_IN_PRODUCTION
false
true honours EHR_SANDBOX_HOSTS on an engine with NODE_ENV=production. Otherwise production ignores it.
Log export
Set these to send engine logs to an external service. Pick one provider. Saved settings override these: once an admin saves in Settings → Notifications → Log export (or calls POST /api/settings/log-export), the engine ignores these variables until someone chooses Clear saved settings. Credentials are never returned. See Log exporters.
Variable
Default
What it does
LOG_EXPORT_PROVIDER
none
none, datadog, cloudwatch or splunk.
DATADOG_API_KEY
unset
The Datadog key.
DATADOG_SITE
datadoghq.com
The Datadog site.
DATADOG_SERVICE
unset
The service name on each log line.
AWS_REGION
us-east-1
The CloudWatch region.
CLOUDWATCH_LOG_GROUP
/medhook/engine
The log group.
CLOUDWATCH_LOG_STREAM
execution-logs
The log stream.
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
unset
The AWS credentials for CloudWatch.
SPLUNK_HEC_URL
unset
The HTTP Event Collector URL.
SPLUNK_HEC_TOKEN
unset
The collector token.
SPLUNK_INDEX
main
The index.
SPLUNK_SOURCE
medhook
The source name.
Google Cloud
On GKE, Terraform passes these to the Helm chart in engine.env, and the chart sets them on the engine. You rarely set them by hand. Site-to-site tunnels stay off until the Classic VPN group is complete. See Site-to-site tunnels.
Variable
Default
What it does
GCP_PROJECT_ID, GCP_REGION
unset
The project and region the engine runs in. Used for tunnels, support access, diagnostics and the Settings page. Unset means the engine is not on GCP.
GCP_VPC_NETWORK
unset
The VPC network tunnels route into.
GCP_VPN_GATEWAY, GCP_VPN_GATEWAY_IP
unset
MedHook's Classic VPN gateway and its public address.
VPN_LOCAL_SUBNETS
unset
Comma-separated subnets on MedHook's side of each tunnel. Terraform sets the node subnet.
VPN_EXTRA_LOCAL_RANGES
unset
Comma-separated extra local ranges every tunnel carries next to the node subnet: your other VPCs or on-prem networks (Use MedHook tunnels for your other applications). Terraform sets it from vpn_extra_local_ranges. VPN_LOCAL_SUBNETS keeps meaning the node subnet.
GCP_VPN_NAME_PREFIX
medhook
Prefix of the GCP names of new tunnels. Terraform sets the environment's name (e.g. medhook-staging), so each environment's tunnel-down alert matches only its own tunnels. Existing tunnels keep their names.
The second Classic gateway, for a backup tunnel. Terraform sets both with vpn_secondary_gateway_enabled.
GCP_HA_VPN_GATEWAY, GCP_HA_VPN_GATEWAY_IPS
unset
The HA VPN gateway and its two interface addresses, comma-separated.
GCP_CLOUD_ROUTER, GCP_CLOUD_ROUTER_ASN
unset
The Cloud Router and ASN for HA VPN's BGP sessions. HA VPN stays off without all four HA values.
GCP_HEALTHCARE_FHIR_STORE
unset
A Cloud Healthcare FHIR store, as projects/…/locations/…/datasets/…/fhirStores/…. The Adapters page's FHIR store card and the Google Cloud Healthcare FHIR adapter use it. Helm sets it from fhirStore.gcpHealthcare.name. Unset: the card shows the bundled Medplum.
MEDHOOK_SECRET_PREFIX
medhook
The Secret Manager prefix the Settings page uses to name the engine's secrets. Match Terraform's secret_prefix. Display only.
SUPPORT_GROUP
the 1Putt support group
The Google group Settings → Support access names. Match Terraform's support_group if you changed it.
Tunnel sample values
Variable
Default
What it does
TUNNEL_SAMPLE_VALUES
unset
JSON sample for Use sample values on New tunnel, for demo engines. See Sample values for demos. Admins only; never holds a pre-shared key. Helm sets it from engine.tunnelSampleValues.
Tunnel watcher
The engine watches its Classic and HA VPN tunnels and fails over, re-establishes and fails back on its own. See Self-healing watcher. The defaults suit most deployments.
Variable
Default
What it does
TUNNEL_WATCHER_ENABLED
on with GKE tunnels
false turns the watcher off.
TUNNEL_WATCHER_POLL_MS
15000
How often it reads tunnel status. Never below 10 seconds in production.
TUNNEL_WATCHER_DOWN_READS
4
Bad reads in a row before a tunnel counts as down (60 s at the 15 s poll).
TUNNEL_WATCHER_REESTABLISH_AFTER_MS
300000 (5 min)
How long a tunnel stays down before it is re-created, and the time between attempts.
TUNNEL_WATCHER_FAILBACK_STABLE_MS
300000 (5 min)
How long a pair's primary must stay up before traffic moves back to it.
TUNNEL_WATCHER_MAX_ACTIONS_PER_HOUR
4
Actions per tunnel per hour before the watcher pauses on it.
TUNNEL_WATCHER_FLAP_DROPS
3
Drops (up to down) within the flap window that pause the watcher on a tunnel.
TUNNEL_WATCHER_FLAP_TRANSITIONS
unset
Older form of the above, in state changes; two count as one drop.
TUNNEL_WATCHER_FLAP_WINDOW_MS
600000 (10 min)
The flap window.
TUNNEL_WATCHER_LEASE_MS
60000
How long a replica holds a tunnel before another may take it over.
AI features
Variable
Default
What it does
ANTHROPIC_API_KEY
empty
Enables AI mapping, condition and workflow suggestions. Empty hides them.
AI_FEATURES_ENABLED
off in production
Prompts go to Anthropic, so with NODE_ENV=production AI stays off until you set true. Do that only once a BAA with Anthropic covers the deployment.
AI_PROVIDER
anthropic
Which service runs AI calls: anthropic (the Anthropic API, ANTHROPIC_API_KEY) or vertex (Claude on your own Google Vertex project, with Workload Identity and no key). A bad value, or vertex without a project or region, stops the engine at startup while AI features are on. Helm engine.aiProvider, GKE Terraform engine_ai_provider. See AI under your own BAA (Vertex).
AI_VERTEX_PROJECT
empty
With AI_PROVIDER=vertex, the Google Cloud project whose Vertex AI runs Claude. Required. Helm engine.aiVertexProject, GKE Terraform engine_ai_vertex_project.
AI_VERTEX_REGION
empty
With AI_PROVIDER=vertex, the Vertex region Claude runs in, for example us-east5. Required, so prompts are processed in one region you chose: the engine, the Helm chart and Terraform refuse global, us and eu. Helm engine.aiVertexRegion, GKE Terraform engine_ai_vertex_region.
CHAT_ENABLED
on
The Agent screen, which is the assistant: read-only answers over the engine API as the signed-in user, guided setup, and drafts you save yourself. On whenever AI features are on (AI_FEATURES_ENABLED and a configured AI provider: ANTHROPIC_API_KEY, or AI_PROVIDER=vertex with AI_VERTEX_PROJECT and AI_VERTEX_REGION); false (any case) switches it off, any other value leaves it on. Helm sets it from engine.chatEnabled, GKE Terraform from engine_chat_enabled (both default on). Switched off, the Agent screen says so and /api/ai/chat answers 404. See Assistant.
AI_MESSAGE_CONTENT
on
The switch that turns message content in the assistant off. On, operators and admins may have message content sent to the model, masked first (patient-identifying values become tokens); this assumes a BAA covers the deployment or only sample data is used. false (any case) gives everyone metadata only: paths, field names, types and status, no values. Viewers always get metadata only. Helm engine.aiMessageContent. See Assistant.
AI_DAILY_TOKEN_LIMIT
2000000
Tokens the assistant (the Agent screen), its workflow drafts included, may use per UTC day, all users together. Cache writes count in full and cache reads (the system prompt and tool list, which are cached) at a tenth. A used-up budget answers 429 until midnight UTC. Helm engine.aiDailyTokenLimit, GKE Terraform engine_ai_daily_token_limit; unset keeps the default.
AI_DAILY_ITERATION_LIMIT
500
Requests the assistant may answer per UTC day: one per message, however many model calls it takes (a workflow draft is part of its message). Helm engine.aiDailyIterationLimit, GKE Terraform engine_ai_daily_iteration_limit; unset keeps the default.
AI_CHAT_VIEWER_DAILY_TOKEN_LIMIT
20000
Tokens one viewer may use in the assistant per UTC day, on top of the engine limit, so a read-only account cannot use up the engine's budget. Operators and admins use the engine limit only.
A limit must be a positive whole number, or unlimited (any case) to turn that cap off: usage is still counted and reported (GET /api/ai/chat answers that limit as null, with unlimited: true once neither tokens nor iterations are capped), and nothing answers 429 for it. Helm and GKE Terraform accept unlimited too. Any other value, 0 included, is ignored with a warning and the default applies.
Flat field paths (beta)
Variable
Default
What it does
FLAT_FIELD_PATHS_ENABLED
off
true turns on the builder's Fields view of a sample (OBX[2].5, PID.3(2).1), the matching Data Map rows and filter picker options, Retrohook key rewriting, {{hl7:PATH}} in templates, the message inspector's Fields tab and flat AI prompts. Only true (any case) turns it on. Helm engine.flatFieldPathsEnabled, GKE Terraform engine_flat_field_paths_enabled. /api/version reports it as features.flatFieldPaths. Does not turn AI on. See Field paths.
Canary deploys (beta)
Variable
Default
What it does
CANARY_DEPLOY_ENABLED
on
On unless set to false: a workflow's Versions tab offers Rollout (Canary at 10, 25 or 50% of messages, or All at once) and When (Now, or Schedule at the workflow's quietest hour of the last 24 h), and the engine runs the job that promotes a canary after 30 minutes under 1% errors or rolls it back at 1% or more. false turns it off: nothing new starts, every message runs on the deployed version, and a running canary can still be promoted or rolled back.
Bundled services
Variable
Default
What it does
MEDPLUM_BASE_URL
http://medplum-server:8103
The local FHIR server, used by the medplum adapter.
MEDPLUM_CLIENT_ID, MEDPLUM_CLIENT_SECRET
empty
Medplum client credentials.
GRAFANA_ADMIN_USER, GRAFANA_ADMIN_PASSWORD
admin
Change both before you expose Grafana.
GRAFANA_URL
empty
Where operators reach Grafana, http or https. The Dashboard's Engine services card links its Grafana row; empty hides it. Read on each request. Helm sets it from engine.env.GRAFANA_URL, and Terraform from grafana_url.
ENGINE_PORT, GRAFANA_PORT, MLLP_PORT, ...
3000, 3002, 2575
Host ports, if the defaults clash with other services.
VPN_TUNNELS
unset
JSON list of tunnels for the optional IPsec container. Pre-shared keys are never returned by the API.