Skip to content

Environment variables

FlowCatalyst is configured environment-first: there are no config files. The central loader is EnvCfg in internal/server/envcfg.go (LoadEnv()), which reads every knob the unified fc-server binary uses. A handful of services additionally read env via package-local FromEnv-style constructors at startup (encryption, email, ratelimit, loginbackoff, the scheduled-job scheduler, mcp), and cmd/fcdev seeds its CLI flag defaults from the same variable names.

Conventions used in the tables below:

  • Aliases are listed in priority order — the first set (non-empty) value wins. Where two names exist, the FC_* name is canonical and the alias is kept for drop-in compatibility with existing deployment configs.
  • Boolean variables accept 1/true/yes/on and 0/false/no/off (case-insensitive); anything else falls back to the default.
  • Unparseable numeric values silently fall back to the default.
  • “(required for X)” marks variables whose absence makes a feature error or refuse to start, as opposed to degrading gracefully.
  • — means no default / no alias.
  • File citations are package paths; consult the package for the exact read site.

Note: internal/secrets also exposes an env://VAR_NAME secret-provider scheme — any variable can be referenced that way; those reads are dynamic and not listed here.

All read in internal/server/envcfg.go.

Variable Default Aliases Read in Purpose
FC_API_PORT 8080 PORT internal/server/envcfg.go Unified API listener port (older deployments defaulted to 3000 — see README operator notes).
FC_METRICS_PORT 9090 — internal/server/envcfg.go Prometheus metrics listener port.
FC_API_BIND unset (all interfaces) — internal/server/envcfg.go, internal/server/listen.go Where the API and metrics listeners bind. Unset: every interface (fc-server’s behaviour, unchanged). loopback: 127.0.0.1 and [::1] only (IPv6 loopback is skipped with a debug log if the host has none). Any other value: a host or IP to listen on, e.g. 0.0.0.0. fcdev defaults to loopback (flag --bind; flag > FC_API_BIND > loopback). With test-header auth on and a non-loopback bind, startup logs a warning.
FC_PLATFORM_ENABLED true PLATFORM_ENABLED internal/server/envcfg.go Run the platform API (IAM, events, dispatch, BFF).
FC_ROUTER_ENABLED false MESSAGE_ROUTER_ENABLED internal/server/envcfg.go Run the message router subsystem.
FC_SCHEDULER_ENABLED false DISPATCH_SCHEDULER_ENABLED internal/server/envcfg.go Run the dispatch-job scheduler. It publishes each claimed job to its client’s queue for its priority — SQS FIFO or the built-in Postgres broker, per FC_DISPATCH_QUEUE_TYPE below. Only a process with no database at all falls back to the noop publisher (with a loud warning).
FC_SCHEDULER_BUFFER_CAPACITY 1000 — internal/server/envcfg.go Dispatch scheduler: most jobs between a claim and a dispatcher finishing them (published and marked QUEUED, or dropped). The poller blocks only when this many are in flight. Non-positive/unparseable = default.
FC_SCHEDULER_DISPATCHERS 10 — internal/server/envcfg.go Dispatch scheduler: number of dispatcher lanes that publish claimed jobs and bulk-mark them QUEUED. A message group is always handled by one lane (hash of the group).
FC_SCHEDULER_BATCH_SIZE 500 — internal/server/envcfg.go Dispatch scheduler: most rows one claim asks for (never more than the free buffer).
FC_SCHEDULER_DB_MAX_CONNECTIONS FC_SCHEDULER_DISPATCHERS + 2 (12) — internal/server/envcfg.go Size of the dispatch scheduler’s OWN Postgres pool (same URL/credentials/lifetimes as the main pool), opened only when the scheduler is enabled so it never competes with API requests. Default: one connection per dispatcher lane plus the poller’s claim and the hold-back query. Every connection of this pool (and of no other) sets plan_cache_mode = force_custom_plan and enable_sort = off (scheduler.PoolRuntimeParams) so the claim keeps an ordered index walk with no sort whatever the job table’s statistics say; see docs/db-index-plan.md.
FC_DISPATCH_PROCESSING_ENDPOINT http://localhost:<FC_API_PORT>/api/dispatch/process DISPATCH_SCHEDULER_PROCESSING_ENDPOINT internal/server/envcfg.go Internal callback the scheduler stamps as each dispatch message’s mediation_target; the router POSTs {messageId} here and the platform delivers to the subscription’s real target. Must point at the platform when the router runs in a separate task (ECS: http://fc-platform:8080/api/dispatch/process).
FC_SCHEDULED_JOB_ENABLED false SCHEDULED_JOB_SCHEDULER_ENABLED internal/server/envcfg.go Run the scheduled-job cron + dispatch engine.
FC_STREAM_PROCESSOR_ENABLED false STREAM_PROCESSOR_ENABLED internal/server/envcfg.go Run the stream processor (CQRS projections + fan-out + partition manager).
FC_OUTBOX_ENABLED false OUTBOX_PROCESSOR_ENABLED internal/server/envcfg.go Run the outbox processor.
FC_PUSH_ENABLED false (fcdev: true, flag --push) — internal/server/envcfg.go Run the push gateway: the framework’s push module serving /api/push/* from this process (Push gateway below, docs/push-gateway-spec.md). Needs the platform database; runs beside the platform API or alone (FC_PLATFORM_ENABLED=false).
FC_MCP_ENABLED false — internal/server/envcfg.go Run the MCP HTTP server.
FC_DISPATCH_QUEUE_TYPE "" (Postgres-backed) DISPATCH_QUEUE_TYPE internal/server/envcfg.go SQS (case-insensitive) publishes dispatch jobs to per-(tenant, priority) SQS FIFO queues and advertises them in the served router-config document; any other value, including unset, names Postgres-backed queues on the platform’s own database (what fcdev runs).
FC_DISPATCH_QUEUE_URL "" DISPATCH_QUEUE_URL internal/server/envcfg.go Read only to derive the AWS account id and region the platform composes its own per-tenant queue URLs with. The single queue this URL names is itself unused.
FC_DISPATCH_QUEUE_REGION "" DISPATCH_QUEUE_REGION internal/server/envcfg.go Overrides the region parsed from FC_DISPATCH_QUEUE_URL.
FC_DISPATCH_QUEUE_PREFIX "" — internal/server/envcfg.go The FC-{env} prefix every composed queue name starts with (e.g. FC-staging, giving FC-staging-acme-DEFAULT.fifo). Required when the type is SQS — a blank prefix there is a startup error, never a queue literally named FC-{env}-....

Resolution precedence: full URL (FC_DATABASE_URL/DATABASE_URL) > Secrets Manager (DB_SECRET_ARN + DB_HOST) > explicit DB_* credentials > local-dev default postgresql://postgres@localhost:5432/flowcatalyst.

Variable Default Aliases Read in Purpose
FC_DATABASE_URL local-dev DSN (see above) DATABASE_URL internal/server/envcfg.go, internal/server/dbsecret.go Full Postgres connection string; when set, all other DB vars are ignored.
DB_HOST — — internal/server/envcfg.go, internal/server/dbsecret.go Postgres host (may include :port); required to activate explicit-creds or Secrets-Manager mode.
DB_PORT 5432 — internal/server/envcfg.go, internal/server/dbsecret.go Postgres port; in SM mode the secret’s own port field wins over this.
DB_NAME flowcatalyst — internal/server/envcfg.go, internal/server/dbsecret.go Database name.
DB_USERNAME postgres — internal/server/envcfg.go Username for explicit-creds mode (SM mode takes it from the secret JSON).
DB_PASSWORD "" — internal/server/envcfg.go Password for explicit-creds mode (URL-escaped into the DSN).
DB_SECRET_ARN — — internal/server/dbsecret.go AWS Secrets Manager secret (RDS-style JSON: username/password/port). With DB_HOST set and no full URL, enables SM mode; region is taken from the ARN, credentials from the standard AWS chain.
DB_SECRET_PROVIDER aws — internal/server/dbsecret.go Secret provider; only aws is supported — any other value errors.
DB_SECRET_REFRESH_INTERVAL_MS 300000 (5 min) — internal/server/dbsecret.go Rotation poll cadence for DBSecretRefresher; 0 or negative disables rotation (single fetch at startup).
Variable Default Aliases Read in Purpose
FC_JWT_ISSUER http://localhost:8080 FC_EXTERNAL_BASE_URL, EXTERNAL_BASE_URL internal/server/envcfg.go JWT issuer + audience and the platform’s external base URL.
FC_JWT_SIGNING_KEY_PATH — — internal/server/envcfg.go Path to the PEM RSA private signing key (preferred source; fcdev auto-creates one).
FLOWCATALYST_JWT_PRIVATE_KEY — — internal/server/signing_key.go Inline PEM RSA private key (the name existing IaC uses; checked before FC_JWT_SIGNING_KEY_PEM). Mangled SSM values (\n, quotes, base64) are normalized.
FC_JWT_SIGNING_KEY_PEM — — internal/server/signing_key.go Go-native inline-PEM alias, checked after FLOWCATALYST_JWT_PRIVATE_KEY. If no key source is set, an ephemeral key is generated (tokens don’t survive restarts and replicas reject each other’s tokens — production must set one).
FC_JWT_KEY_STORE database when FLOWCATALYST_APP_KEY is set, else config — internal/server/wire_signing_keys.go database: the rotating JWT keyring in Postgres (docs/jwt-signing-keys.md); the configured RSA (and ML-DSA) key is adopted once, at bootstrap. config: the configured keys only, never rotated, session cookies RS256. database without an app key refuses to start.
FC_JWT_ACCESS_TOKEN_ALG RS256 — internal/server/envcfg.go RS256 or EdDSA: the algorithm access tokens are minted with. The platform verifies both; switch only once every SDK verifying your access tokens supports EdDSA (Rust and Java do not yet).
FLOWCATALYST_JWT_PREVIOUS_PUBLIC_KEY — — internal/server/envcfg.go config key store only: a validation-only previous RSA public key for a signing-key rotation; optional, skipped unless it parses as a PEM. It must be the retired key: a value equal to the current key is ignored with a warning. Leave it unset outside a rotation.
FC_JWT_MLDSA_KEY_PATH — — internal/server/signing_key.go Optional ML-DSA-65 key (PKCS#8 PRIVATE KEY PEM, seed form). With the keyring it is adopted at bootstrap (the keyring generates one otherwise); with config it is the ML-DSA key. Generate with openssl genpkey -algorithm ML-DSA-65 -provparam ml-dsa.output_formats=seed-only (OpenSSL 3.5+). A malformed key stops the server at boot.
FLOWCATALYST_JWT_MLDSA_PRIVATE_KEY — — internal/server/signing_key.go Inline-PEM alternative to FC_JWT_MLDSA_KEY_PATH (then FC_JWT_MLDSA_KEY_PEM).
FLOWCATALYST_JWT_MLDSA_PREVIOUS_PUBLIC_KEY — — internal/server/envcfg.go config key store only: a retired ML-DSA-65 public key (PKIX PEM) kept in the JWKS during a rotation.
FC_JWT_ACCESS_TOKEN_TTL_SECS 3600 OIDC_ACCESS_TOKEN_TTL internal/server/envcfg.go Access-token lifetime in seconds. Sets both the minted exp and the expires_in every token response advertises, so the two can’t disagree. The OIDC id_token has its own fixed 5-minute lifetime and is unaffected.
OIDC_SESSION_TTL 86400 (24 h) — internal/server/envcfg.go Session cookie + session JWT lifetime in seconds (password, passkey, 2FA and OIDC-bridge logins). A session is also ended early when its user changes their password, a password reset is confirmed, an administrator resets their password or 2FA, or they are deactivated (iam_principals.sessions_valid_after; the browser that changed its own password is re-issued a session; an ordinary sign-out only clears that browser’s cookie). The ECS task definitions set 28800 (8 h).
OIDC_REFRESH_TOKEN_TTL 604800 (7 d) — internal/server/envcfg.go Refresh-token lifetime in seconds. It is the family’s absolute cap: rotation carries the original deadline forward, so a family dies this long after first issuance. The ECS task definitions set 2592000 (30 d).
FC_FCDEV_LOGIN_REFRESH_TTL_SECS 604800 (7 d) — internal/server/envcfg.go Lifetime of an fcdev login session in seconds, for the built-in fcdev-cli OAuth client only. Absolute: counted from the original sign-in, rotation never extends it, so the person signs in again this long after logging in. Independent of OIDC_REFRESH_TOKEN_TTL (which other clients keep using). Non-positive or unparseable falls back to the default. See docs/fcdev-profiles.md.
AUTH_MODE — — internal/server/run.go NONE (case-insensitive) forces router HTTP BasicAuth off regardless of creds; any other value (incl. BASIC or unset) uses the resolved creds.
FC_ROUTER_AUTH_USER "" (auth disabled) AUTH_BASIC_USERNAME internal/server/run.go Router HTTP BasicAuth username; empty disables auth on the router surface.
FC_ROUTER_AUTH_PASS "" AUTH_BASIC_PASSWORD internal/server/run.go Router HTTP BasicAuth password.
FC_AUTH_ALLOW_TEST_HEADERS false — internal/server/envcfg.go Enables the X-FC-Test-Principal dev fallback in the platform Authenticator (fcdev turns it on in code; never in production). fc-server refuses to start when this is true unless APP_ENV is local or test.
FC_AUTH_STEPUP_MAX_AGE_SECS 900 — internal/server/envcfg.go How recent a browser session’s sign-in must be to add or remove a sign-in method: passkey register / delete (/auth/webauthn/register/*, DELETE /auth/webauthn/credentials/{id}), and the 2FA self-service writes (authenticator app and email enrolment, remove a method, regenerate recovery codes, revoke a trusted device), in both the SPA and the /ui console. An older session (by the cookie’s issued-at) is refused 403 REAUTH_REQUIRED (“Sign in again to change your sign-in methods”); signing in again clears it. 0 disables the check. Not applied to API bearers (they are refused outright, SESSION_REQUIRED), the dev test headers, or the first-login 2FA enrolment (which runs before a session exists).
FC_DEVELOPER_CREDENTIAL_SSO_MAX_AGE_DAYS 0 (off) — internal/server/envcfg.go A developer client_credentials token (client_id = the user’s principal id) for an SSO-managed user (email domain mapped to an OIDC identity provider) additionally requires a successful interactive sign-in (USER_LOGIN / SUCCESS in the login attempts, recorded by the OIDC callback) within this many days; an older or missing one is refused exactly like an inactive principal (401 invalid_client). Non-SSO users are unaffected. With 0 nothing is refused, but a request from an SSO-managed user whose last sign-in is over 30 days old logs one warning per principal per process, to show who would be cut off. Login attempts older than their retention (3 years) read as “never”.
FC_OAUTH_REVOKE_ENFORCE_CLIENT true — internal/server/envcfg.go /oauth/revoke only revokes a refresh token issued to the authenticated client (RFC 7009 §2.1); a mismatch returns 200 without revoking. false restores “any authenticated client may revoke any token it can name”. Bearer callers and tokens with no client binding are unaffected.
FC_OAUTH_INTROSPECT_CLIENT_AUTH_ONLY false — internal/server/envcfg.go true makes /oauth/introspect refuse Bearer-token authentication (client credentials only). Default keeps resource servers able to introspect with a Bearer.
FC_PASSWORD_RESET_REQUIRE_STRONG_FACTOR false — internal/server/envcfg.go Opt-in stricter password-reset rule of docs/auth-hardening-plan.md (owner ruling 2026-11-09: off by default). true: a self-service “Forgot password” for a user with no strong factor (no authenticator app and no passkey; an email PIN does not count) emails no link — it files a request in the console’s Reset Approvals and emails the client’s administrators; a user with no home client (anchor/partner) gets nothing (an administrator sends a reset from the console; the server logs why). false (default): such a user — including one whose only 2FA is the email PIN — gets the conventional emailed link, which alone authorises the reset. A user WITH a strong factor gets a link that must be confirmed with an authenticator code or a passkey either way.
FC_OIDC_REJECT_UNVERIFIED_EMAIL false — internal/server/envcfg.go true refuses an SSO login when the upstream IdP’s id_token carries email_verified = false (bool or the string "false"). An absent claim is always accepted. Off by default because some IdPs send false for accounts the tenant trusts.
FC_OIDC_ISSUER_PATTERN_STRICT false — internal/server/envcfg.go Applies only to a LEGACY multi-tenant oidcIssuerPattern that does not pin the issuer: true makes it a FULL match (^(?:pattern)$); default keeps the historical partial match. A pinned pattern (anchored ^...$, exact issuers only) is always a whole-issuer match.
FC_OIDC_ISSUER_PATTERN_REQUIRE_PINNED false — internal/server/envcfg.go true refuses every sign-in through a multi-tenant IdP whose oidcIssuerPattern does not pin the issuer to the tenant(s) it spells out (identityprovider.CheckIssuerPattern: anchored at both ends, no wildcard, character range or repeat — e.g. ^https://login\.microsoftonline\.com/<tenant-id>/v2\.0$). Off by default so a provider saved before the rule keeps signing in; such a provider is logged at startup and on first use and flagged in the console’s identity-provider drawer. Saving a new broad pattern is refused (ISSUER_PATTERN_NOT_PINNED) either way. Turn it on once no provider is flagged.
FC_OIDC_ROLE_SYNC_REQUIRE_ALLOWLIST false — internal/server/envcfg.go true makes a sign-in through an identity provider that serves a client or partner domain (a mapping whose scope is not ANCHOR), has role sync on and has an EMPTY allow-list of roles grant NO roles: the token’s roles claim is treated as mapping to nothing, so the user’s IdP-synced roles are dropped. Without an allow-list such a provider could put any role name that any provider’s role mapping names in its claim and have that platform role assigned. Off by default so a provider saved before the rule keeps working; such a provider is logged at startup and on first use and flagged in the console’s identity-provider drawer. Saving that state (or moving a client or partner domain onto such a provider) is refused (ROLE_ALLOWLIST_REQUIRED) either way. A provider serving only ANCHOR domains is unaffected. Turn it on once no provider is flagged.
FC_HTTP_TRUSTED_PROXY_HOPS 1 — internal/server/envcfg.go How many proxies you run in front of the server; decides which address is “the caller” for per-address rate limits, login backoff and the address recorded on sign-in attempts. 0: no proxy; the caller is the connection’s peer and X-Forwarded-For is ignored. 1: one proxy (a load balancer) appends the address it saw; the caller is the last X-Forwarded-For entry. 2: two proxies (a CDN, then a load balancer); the caller is the second entry from the right. With fewer entries than hops the leftmost is used; with no header, the peer. Pick 0 when the server is directly exposed, 1 behind one load balancer, 2 behind a CDN plus a load balancer. The default 1 suits one load balancer; a directly exposed server must set 0, otherwise a caller can choose its own address by sending the header. A value that is not a non-negative integer stops startup. With 2 or more, a caller who can reach an inner proxy directly can supply the outer entries, so inner proxies must accept traffic only from the outer one. True-Client-IP and X-Real-IP are never read. FC_HTTP_REAL_IP_MIDDLEWARE is retired: it is ignored and a warning is logged if set.
FC_SESSION_COOKIE_SAME_SITE lax — internal/server/envcfg.go SameSite mode of the session cookie (__Host-fc_session on HTTPS, fc_session on plain HTTP; none forces Secure and so the __Host- name): lax (default, required for the OIDC redirect-back flows), strict, none (needs HTTPS). Other values refuse startup. The trusted-device cookie stays Strict regardless.
Variable Default Aliases Read in Purpose
FLOWCATALYST_APP_KEY — — internal/platform/shared/encryption, internal/server/subsystems.go, internal/server/wire_routes.go, cmd/fcdev, cmd/decrypt-check Field-encryption key (base64, AES-GCM). Also the source of the field-worker PIN pepper (HKDF info fc-field-pin, internal/platform/fieldidentity/pin): unset → every PIN set/verify fails closed (503 FIELD_IDENTITY_UNCONFIGURED). Unset → encryption disabled: confidential OAuth client-secret minting fails and TOTP enrollment degrades; the dispatch scheduler refuses to start (its HMAC dispatch-auth secret is HKDF-derived from this key). fcdev generates + persists one.
FLOWCATALYST_APP_KEY_PREVIOUS — — internal/platform/shared/encryption Previous encryption key; decryption falls back to it during key rotation (new writes always use the current key).
FC_FIELD_ACCESS_TOKEN_TTL_SECS 600 — internal/platform/auth/authservice Lifetime of a field-worker access token (typ: fc-field+jwt). Short by design: the refresh token, not the access token, carries the session, and introspection answers revocation online.
FLOWCATALYST_SIGNING_SECRET — — pkg/fcsdk/webhook Webhook HMAC-SHA256 signing secret for consumer apps using the Go SDK’s ValidatorFromEnv (required for SDK webhook validation — errors when unset). Written to .env by fcdev init (the application’s service account’s), with FLOWCATALYST_WEBHOOK_AUTH_TOKEN, the bearer the platform sends on its deliveries (read by the Laravel SDK as flowcatalyst.webhook_auth_token).
FC_SECRET_REFERENCE_ALLOW — (off) — internal/secretref Comma-separated prefixes of whole references a stored secret reference must start with, for example aws-sm://prod/data_engineering/,aws-ps:///acme/np/shared/. A secret (function SECRET/DB setting, platform-config SECRET, ingestion secret) may hold aws-sm://<name-or-arn>[#<key>] or aws-ps://<parameter> instead of the secret; the platform resolves it from AWS each time it hands the secret out. Empty/unset turns the feature off: writing a reference is 400 SECRET_REFERENCE_NOT_ALLOWED, and a stored one fails to resolve. Checked at write and at resolve. An entry without a placeholder is a plain text prefix, so end it with / (aws-sm://prod/data would also allow aws-sm://prod/data-admin/x; the platform logs a WARN at start-up for each such entry). An entry may hold {app} and {client} as whole path segments, e.g. aws-sm://prod/{app}/ or aws-sm://prod/{app}/{client}/: it then admits a reference only when, at those segments, the reference has exactly the application code (and client id, clt_...) of the row the secret belongs to, so one application cannot point its secrets at another’s. An entry with a placeholder never matches when the row has no such coordinate (an application-wide config has no client). Recommended: scoped entries (aws-sm://prod/{app}/), or at least prefixes ending in /. The same rule is applied at write and at resolve. An ARN reference matches on the ARN text (allowing by name does not allow by ARN). The platform’s AWS role needs secretsmanager:GetSecretValue / ssm:GetParameter (+ kms:Decrypt) on what is allowed. fcdev leaves it unset.
FC_SECRET_REFERENCE_TTL 5m — internal/secretref How long a resolved reference is served from the platform’s cache before AWS is asked again (a Go duration). A rotation in AWS reaches consumers within this time.
FC_SECRET_REFERENCE_MAX_STALE 1h — internal/secretref How long past its TTL the last resolved value is still served when AWS cannot be reached (WARN-logged); after that the resolve fails. A failure with nothing cached is remembered for 30 s so a 15 s re-render loop does not hammer AWS.

Distributed cluster-wide policies (FC_RL_*) are read in internal/platform/shared/ratelimit (PoliciesFromEnv); the in-memory per-instance governors (FC_OAUTH_TOKEN_*, FC_OIDC_*) sit in front of them as defence-in-depth.

Variable Default Aliases Read in Purpose
FC_RL_OAUTH_TOKEN_IP_PER_MIN 600 — internal/platform/shared/ratelimit Cluster-wide /oauth/token requests per IP per minute.
FC_RL_OAUTH_TOKEN_CLIENT_PER_MIN 300 — internal/platform/shared/ratelimit Cluster-wide /oauth/token requests per client_id per minute.
FC_RL_OAUTH_AUTHORIZE_IP_PER_MIN 600 — internal/platform/shared/ratelimit Cluster-wide /oauth/authorize requests per IP per minute.
FC_RL_OAUTH_AUTHORIZE_CLIENT_PER_MIN 300 — internal/platform/shared/ratelimit Cluster-wide /oauth/authorize requests per client_id per minute.
FC_RL_PASSWORD_RESET_IP_PER_HOUR 20 — internal/platform/shared/ratelimit Enforced on POST /auth/password-reset/request and POST /auth/password-setup/request (one shared per-IP budget, keyed on the caller address set by FC_HTTP_TRUSTED_PROXY_HOPS). Over the limit: 429 + Retry-After.
FC_RL_PASSWORD_RESET_EMAIL_PER_HOUR 5 — internal/platform/shared/ratelimit Enforced on the same two routes, per lower-cased target email. Over the limit the request is silently dropped: the response is identical to an accepted one, no token is deleted or minted and no mail is sent (so a pending reset link or invitation survives a flood).
FC_RL_PASSWORD_RESET_FACTOR_PER_HOUR 10 — internal/platform/shared/ratelimit Failed second-factor proofs (authenticator code or passkey) at POST /auth/password-reset/confirm, counted per principal across all of its reset tokens. Once spent, confirm refuses with the same INVALID_TOKEN an exhausted token gets, even for a correct code. The per-token cap of 5 still applies.
FC_RL_CHECK_DOMAIN_IP_PER_MIN 600 — internal/platform/shared/ratelimit /auth/check-domain (POST and GET, one shared budget) per IP per minute; over the limit 429.
FC_RL_OAUTH_INTROSPECT_IP_PER_MIN 0 — internal/platform/shared/ratelimit Opt-in: /oauth/introspect requests per IP per minute; over the limit 429. 0 (default) means not enforced, because a resource server may introspect on every API call from one address.
FC_RL_OAUTH_REVOKE_IP_PER_MIN 0 — internal/platform/shared/ratelimit Opt-in: /oauth/revoke requests per IP per minute; over the limit 429. 0 (default) means not enforced.
FC_OAUTH_TOKEN_IP_RATE_PER_MIN 120 — internal/platform/shared/ratelimit Per-instance in-memory /oauth/token sustained rate per IP.
FC_OAUTH_TOKEN_IP_BURST 60 — internal/platform/shared/ratelimit Per-instance instantaneous burst allowance per IP at /oauth/token.
FC_OAUTH_TOKEN_CLIENT_RATE_PER_MIN 60 — internal/platform/shared/ratelimit Per-instance sustained rate per client_id at /oauth/token.
FC_OAUTH_TOKEN_CLIENT_BURST 30 — internal/platform/shared/ratelimit Per-instance burst allowance per client_id at /oauth/token.
FC_OIDC_RATE_PER_MIN 60 — internal/platform/shared/ratelimit Per-instance sustained rate per IP on the /auth/oidc/* bridge routes.
FC_OIDC_BURST 30 — internal/platform/shared/ratelimit Per-instance burst allowance on the OIDC bridge routes.
FC_LOGIN_RATE_PER_MIN 120 — internal/platform/shared/ratelimit Per-instance in-memory sustained rate per source IP on the password-login and 2FA-step routes (POST /auth/login, /auth/2fa/*). Each request can spend a 64 MiB Argon2id verify, so this bounds one address. Over the limit answers 429 with Retry-After.
FC_LOGIN_BURST 60 — internal/platform/shared/ratelimit Per-instance instantaneous burst allowance per IP on those routes.
FC_FIELD_LOGIN_ATTEMPT_RETENTION_DAYS 90 — internal/server (purger) Retention of the field-worker sign-in history (field_login_attempts). Older rows are deleted in batches of 5000 by the minute purger. 0 or negative keeps the history forever.
FC_FIELD_RATE_PER_MIN 600 — internal/platform/shared/ratelimit Per-instance in-memory sustained rate per source IP on the field-worker device routes (/field/*). Looser than the browser flows: a depot shares one NAT address across a whole shift starting at once.
FC_FIELD_BURST 200 — internal/platform/shared/ratelimit Per-instance burst allowance per IP on /field/*.
FC_APP_UPDATES_MANIFEST_RATE_PER_MIN 300 — internal/platform/shared/ratelimit Per-instance sustained rate per source IP on the Expo Updates manifest route (/app-updates/{app}/{appKey}/manifest). A phone asks once per launch; a depot’s phones share one address.
FC_APP_UPDATES_MANIFEST_BURST 100 — internal/platform/shared/ratelimit Per-instance burst allowance per IP on the manifest route.
FC_APP_UPDATES_ASSET_RATE_PER_MIN 3000 — internal/platform/shared/ratelimit Per-instance sustained rate per source IP on the update asset route: one new update is every file it names that a phone does not hold.
FC_APP_UPDATES_ASSET_BURST 1000 — internal/platform/shared/ratelimit Per-instance burst allowance per IP on the asset route.
FC_APP_UPDATES_INSTALL_RATE_PER_MIN 300 — internal/platform/shared/ratelimit Per-instance sustained rate per source IP on the install page of an install link (/app-updates/{app}/{appKey}/install/{token}): a depot’s people behind one address open the link at once.
FC_APP_UPDATES_INSTALL_BURST 100 — internal/platform/shared/ratelimit Per-instance burst allowance per IP on the install page.
FC_APP_UPDATES_DOWNLOAD_RATE_PER_MIN 120 — internal/platform/shared/ratelimit Per-instance sustained rate per source IP on binary downloads (.../install/{token}/{variant}.apk); each request may be a whole APK, and a poor connection resumes with ranges.
FC_APP_UPDATES_DOWNLOAD_BURST 100 — internal/platform/shared/ratelimit Per-instance burst allowance per IP on downloads.
FC_FIELD_DEVICE_FAILURES_PER_HOUR 20 — internal/platform/shared/ratelimit Field-worker PIN failures per enrolled device per rolling hour (counted across ALL worker codes, so it catches spraying). At the limit, logins from that device answer 429 + Retry-After and one field-device.throttled event is emitted per hour. Disabled with FC_RATE_LIMIT_DISABLE.
FC_FIELD_CLIENT_FAILURES_PER_HOUR 300 — internal/platform/shared/ratelimit Field-worker PIN failures per client per rolling hour, counted from ENROLLED devices only; at the limit every device of the client, and every unenrolled key naming it, gets 429 and one field-device.throttled (scope CLIENT) event is emitted per hour.
FC_FIELD_UNENROLLED_CLIENT_FAILURES_PER_HOUR 300 — internal/platform/shared/ratelimit Field-worker PIN failures per client per rolling hour from keys that are NOT enrolled devices (bucket field_pin_client_unenrolled). At the limit only unenrolled keys naming that client get 429 (scope CLIENT, one field-device.throttled event per hour); enrolled devices are never refused because of it.
FC_FIELD_IP_FAILURES_PER_HOUR 100 — internal/platform/shared/ratelimit Field-worker PIN failures per source IP per rolling hour, for sign-ins from a key that is not an enrolled device (no device bucket applies). At the limit that IP gets 429 and one field-device.throttled (scope IP, with ipAddress) event is emitted per hour. Generous by default: a depot shares one NAT address. Enrolled devices keep the device bucket and do not count here.
FC_RATE_LIMIT_DISABLE unset — internal/platform/shared/ratelimit 1 replaces the distributed store with a no-op (everything allowed): every FC_RL_* limit above, including the password-reset and factor-proof limits, stops applying.
FC_REDIS_URL — — internal/platform/shared/ratelimit Redis backend for the distributed rate-limit store; set + reachable → Redis, else falls back to the Postgres store.

A subscription endpoint, scheduled-job target or SDK dispatch-job targetUrl is customer input that the platform POSTs to from inside the cluster. The guard in internal/netguard refuses destinations that could expose the cluster: at write time (a 400 INVALID_ENDPOINT / INVALID_TARGET_URL) and, authoritatively, at dial time after DNS resolution, so a hostname that resolves to a forbidden address is refused too. Cloud metadata (169.254.169.254, fd00:ec2::254), link-local, unspecified and multicast addresses are always refused, and so is an IPv6 address with a zone ([fe80::1%25eth0], [::%25lo0]): the rules judge the address without its zone, and a zone, which names a network interface, is refused even where the variables below allow loopback or private targets (F63). An exemption in FC_DELIVERY_ALLOW_HOSTS still skips every check.

The guard applies where the platform delivers to those targets: the dispatch processing endpoint (subscription webhooks and dispatch jobs) and the scheduled-job dispatcher. The router applies none (owner decision #56, 2026-10-01): its targets are first-party, from the queue config and our own apps’ message pointers, and the endpoint that receives a pointer checks its own target. Customer-supplied URLs (subscription endpoints, dispatch-job and scheduled-job targets) are checked by one policy that has no exemption for the platform’s own endpoints: http://localhost:<FC_API_PORT>/... and the function runner’s address are refused there like any other loopback or private URL. A second, internal policy additionally exempts the function runner (FC_FUNCTIONS_RUNNER_URL, FC_FUNCTIONS_RUNNER_URL_<RT>); it is used only to deliver what the platform itself wrote for a function (a function subscription’s jobs, a function-materialised scheduled job), never for customer-supplied URLs. FC_DISPATCH_PROCESSING_ENDPOINT needs no exemption: only the router calls it. fc-dev allows loopback and private targets, on both policies, unless the variables below are set.

Variable Default Aliases Read in Description
FC_DELIVERY_ALLOW_LOOPBACK false — internal/netguard Permit 127.0.0.0/8, ::1 and localhost targets. Development only.
FC_DELIVERY_ALLOW_PRIVATE false — internal/netguard Permit RFC 1918, fc00::/7 and CGNAT (100.64.0.0/10) targets. Off by default: these are the cluster’s pods, services and internal APIs.
FC_DELIVERY_ALLOW_HOSTS — — internal/netguard Comma-separated host:port patterns (* wildcard) exempt from the checks, e.g. partner-gw.internal:443,*.fn.svc:8095. Use for a specific private target instead of opening every private range.

All read in internal/platform/auth/loginbackoff (PolicyFromEnv) — brute-force protection on the password login endpoint.

Variable Default Aliases Read in Purpose
FC_LOGIN_BACKOFF_FREE_ATTEMPTS 3 — internal/platform/auth/loginbackoff Failures per (identifier, IP) allowed before any delay.
FC_LOGIN_BACKOFF_BASE_SECS 2 — internal/platform/auth/loginbackoff Delay at the first throttled attempt; doubles per further failure.
FC_LOGIN_BACKOFF_MAX_SECS 300 — internal/platform/auth/loginbackoff Cap on the per-(identifier, IP) exponential backoff delay.
FC_LOGIN_GLOBAL_WINDOW_SECS 3600 — internal/platform/auth/loginbackoff Sliding window for the per-identifier global failure ceiling.
FC_LOGIN_GLOBAL_CEILING 100 — internal/platform/auth/loginbackoff Failures across all IPs in-window that trigger a lock.
FC_LOGIN_GLOBAL_LOCK_SECS 900 — internal/platform/auth/loginbackoff Lock duration once the global ceiling trips.

All read in internal/platform/shared/email (FromEnv). When no host is set, emails (password-reset links, 2FA PINs) are logged instead of sent.

Variable Default Aliases Read in Purpose
FC_SMTP_HOST — (unset → log-only mailer) SMTP_HOST internal/platform/shared/email SMTP server host; required to send real email.
FC_SMTP_PORT 587 SMTP_PORT internal/platform/shared/email SMTP port.
FC_SMTP_USERNAME "" SMTP_USERNAME internal/platform/shared/email SMTP auth username (empty → unauthenticated).
FC_SMTP_PASSWORD "" SMTP_PASSWORD internal/platform/shared/email SMTP auth password.
FC_SMTP_FROM noreply@flowcatalyst.local SMTP_FROM internal/platform/shared/email From address.
FC_SMTP_SECURE false (STARTTLS) SMTP_SECURE internal/platform/shared/email true → implicit TLS (e.g. :465); false → STARTTLS (e.g. :587).
Variable Default Aliases Read in Purpose
FC_WEBAUTHN_RP_ID localhost — internal/server/wire_services.go Relying-party ID — the registrable parent domain covering all passkey origins.
FC_WEBAUTHN_ORIGINS http://localhost:8080 FC_WEBAUTHN_RP_ORIGIN (legacy, singular) internal/server/envcfg.go Comma-separated allowed origins; go-webauthn matches exact scheme+host, so every origin must be listed verbatim.

Toggle (FC_ROUTER_ENABLED) and BasicAuth are in families 1 and 3; broker config (FLOWCATALYST_CONFIG_URL), notifications and ALB self-registration are in families 11 and 1.

Variable Default Aliases Read in Purpose
FC_ROUTER_HTTP_PREFIX /router — internal/server/envcfg.go Mount prefix for the router HTTP surface on the unified API listener.
FC_DRAIN_TIMEOUT_SECONDS 60 — internal/server/envcfg.go Upper bound for the router’s graceful in-flight drain on shutdown.
FLOWCATALYST_DEV_MODE false — internal/server/envcfg.go Swaps in the router’s dev mediator (relaxed TLS, longer timeouts).
FC_ROUTER_CONFIG_INTERVAL_SECONDS 0 (router package default 30; was 300 before F29) FLOWCATALYST_CONFIG_INTERVAL internal/server/envcfg.go How often the router re-fetches FLOWCATALYST_CONFIG_URL while leader. The platform’s own document answers 304 to the router’s If-None-Match, so a short interval costs a conditional request, and the same tick re-probes queues that were missing when first seen (a new client’s queue is created on its first publish): young ones every tick, the rest every 5 minutes. A router in the same process as the platform is also nudged the moment a client, dispatch pool or subscription is written (about a second). A deployment that sets this explicitly keeps its value (check the IaC for FLOWCATALYST_CONFIG_INTERVAL); lower it to cut the time a new client’s first dispatch jobs wait for a separately-run router.
FC_NOTIFY_BATCH_INTERVAL_SECONDS 0 (router package default 300) NOTIFICATION_BATCH_INTERVAL internal/server/envcfg.go How long the router’s warning notifier holds non-critical warnings before flushing a batch to FC_NOTIFY_WEBHOOK_URL. A full batch (20) or a CRITICAL warning flushes immediately.
FC_ROUTER_SYNTH_POOL_IDLE_SECS 0 (router package default 3600) — internal/server/envcfg.go Idle TTL after which a synthesised per-client {identifier}-DEFAULT-POOL with no routed message is stopped and removed; re-synthesised on demand. Configured pools are never evicted.
FC_ROUTER_DEFERRAL_MAX_DELAY_SECONDS 0 (router package default 3600) — internal/server/envcfg.go Reservation horizon for messages a full pool hands back to the broker (docs/router-architecture.md §3a): the longest any one deferral asks the broker to hold a message, and so the longest a pool can idle waiting for already-deferred messages after its capacity improves.
FC_ROUTER_DEFERRAL_BUDGET 0 (router package default 15000) — internal/server/envcfg.go How many deferred messages one queue’s consumer may have outstanding before it stops polling into pools that are all full. Must be at least the largest slow-pool backlog the queue is expected to carry: SQS FIFO serves oldest-first, so reaching the other pools’ messages means deferring the whole backlog ahead of them. Bounded by SQS FIFO’s 20,000 in-flight ceiling, which deferred messages count toward; a backlog beyond ~15k needs its own queue.
FC_ROUTER_STRICT_ROUTING false — internal/server/envcfg.go When true, a message with an empty pool_code, an empty/absent dispatch_mode, or an ordered mode with no message_group_id is malformed: ACKed (never delivered, never NACKed) with a CONFIGURATION warning, instead of the usual fallback (DEFAULT-POOL / NEXT_ON_ERROR / the shared "" group).
FC_ROUTER_HTTP2_READ_IDLE_TIMEOUT_SECONDS 0 (router package default 30) — internal/server/envcfg.go HTTP/2 connection health check for deliveries: after this many seconds with no frame received on a connection, the router sends it a PING. Together with the next variable it bounds how long a half-open connection (NAT or load-balancer idle drop, a peer gone without a FIN) can stall the deliveries on it — about 45 s by default, instead of each request’s 15-minute deadline. The PING is answered by the target’s HTTP/2 layer, so a healthy connection carrying a long request is never closed.
FC_ROUTER_HTTP2_PING_TIMEOUT_SECONDS 0 (router package default 15) — internal/server/envcfg.go How long the router waits for that PING’s ack before closing the connection; the requests on it fail with a retryable connection error and are retried on a new connection.
FC_ROUTER_PLATFORM_URL (see also the router credentials above — setting this also enables the A-01 settled-group hook) — (falls back to FC_API_BASE_URL, then FLOWCATALYST_URL) FC_API_BASE_URL, FLOWCATALYST_URL internal/server/envcfg.go Platform base URL the router POSTs /api/dispatch/settled to (A-01), reporting the untried siblings it ACKed when a BLOCK_ON_ERROR head failed terminally, so the platform can mark the group pending. Unset disables the hook — correct for a standalone router with no platform; the platform-side reaper still recovers such rows within its 2-minute sweep, so this affects recovery latency, not correctness.
Variable Default Aliases Read in Purpose
FC_OUTBOX_PLATFORM_URL — (required: processor logs an error and skips startup without it) FC_OUTBOX_API_URL, FC_API_BASE_URL, FLOWCATALYST_URL internal/server/envcfg.go Platform API base URL the outbox delivers batches to.
FC_OUTBOX_PLATFORM_AUTH_TOKEN "" FC_OUTBOX_TOKEN, FC_API_TOKEN internal/server/envcfg.go Bearer token / OAuth client_secret used against the platform.
FC_OUTBOX_BATCH_SIZE 0 (library default 100) — internal/server/envcfg.go, cmd/fcdev Rows per poll.
FC_OUTBOX_MAX_IN_FLIGHT 0 (library default 1000) — internal/server/envcfg.go, cmd/fcdev Cap on outstanding HTTP requests.
FC_OUTBOX_POLL_INTERVAL_MS 0 (library default 1000) — internal/server/envcfg.go, cmd/fcdev Sleep between empty polls.
FC_OUTBOX_MAX_REQUEST_BYTES 0 (library default 8388608, 8 MiB) — internal/server/envcfg.go, cmd/fcdev (--max-request-bytes) The largest request body the processor sends. The ungrouped rows of a type in one claim are sent in requests cut at FC_OUTBOX_BATCH_SIZE rows or this many bytes, whichever comes first, one request after the other; a row larger than this is sent on its own. Keep it at or under half of the platform’s FC_INGEST_BATCH_MAX_BYTES (the default, 8 MiB, is half the platform’s default of 16 MiB). A grouped row is always sent on its own, so the cut never changes a message group’s order. See Requests the platform refuses as too large below.
FC_OUTBOX_MAX_CONCURRENT_GROUPS 0 (library default 10) FC_MAX_CONCURRENT_GROUPS internal/server/envcfg.go Max message groups processed concurrently.
FC_OUTBOX_BLOCK_ON_ERROR true — internal/server/envcfg.go Stop a message group at a row the platform refuses (BAD_REQUEST, FORBIDDEN) until an operator unblocks (retries) or skips it on the admin API; the group’s later rows wait in order. The block is rebuilt at start-up and on taking leadership from the stored rows this version refused ([blocking] marker, see below), so a restart never moves a group past the row; rows refused by earlier versions do not block. false: the row stays failed and its group carries on past it. Retryable failures never block (see below).
FC_OUTBOX_ADMIN_PORT 0 (off) — internal/server/envcfg.go Serves the operational admin API (pause/resume/unblock/skip groups, GET /outbox/holds for what is waiting out a backoff or a 429) on 127.0.0.1:<port>.
FC_OUTBOX_BACKEND postgres FC_OUTBOX_DB_TYPE (legacy name) internal/server/envcfg.go Storage backend: postgres (shared pool), mysql (or mariadb), mongo, or sqlite; anything else errors clearly.
FC_OUTBOX_MYSQL_URL — FC_OUTBOX_DB_URL internal/server/envcfg.go MySQL 8.0+ / MariaDB 10.6+ database (required when backend is mysql): a mysql://user:pass@host:3306/db?param=value URL (mariadb:// too) or a Go MySQL DSN (user:pass@tcp(host:3306)/db). It must name the database. The connection always runs in UTC (time_zone '+00:00', parseTime), whatever the URL says.
FC_OUTBOX_MONGO_URI — FC_OUTBOX_DB_URL internal/server/envcfg.go Mongo connection string (required when backend is mongo).
FC_OUTBOX_MONGO_DB flowcatalyst — internal/server/envcfg.go Mongo database name.
FC_OUTBOX_SQLITE_PATH — FC_OUTBOX_DB_URL internal/server/envcfg.go SQLite database file path or DSN (required when backend is sqlite).
FC_OUTBOX_SOURCE_DB_URL — — cmd/fcdev fcdev outbox only: the external app’s database to poll (flag default): a Postgres URL, or MySQL 8.0+ / MariaDB 10.6+ as a mysql:// or mariadb:// URL or a Go MySQL DSN (user:pass@tcp(host:3306)/db), which must name the database. The kind is read from the URL; `FC_OUTBOX_DB_TYPE=postgres
FC_OUTBOX_INIT_SCHEMA true — cmd/fcdev fcdev outbox only (flag --init-schema): true creates outbox_messages and its indexes at start if missing (CREATE TABLE IF NOT EXISTS). false runs no DDL at all against the source database: if the table is not there yet the poller waits for it (checks every 2 s, logs that it is waiting and again every minute), then polls; a database it cannot reach or a wrong password is still an error. Set false whenever the application’s own migrations create outbox_messages (the Go framework’s outbox module, an SDK migration run by the application’s migration tool, Laravel’s migrate): those use a plain CREATE TABLE, and a poller started beside the application (a second container of the same task) can create the table first, so the application’s first migration fails with relation "outbox_messages" already exists and so does every restart. A value other than true/false/1/0/yes/no/on/off is refused.
FC_OUTBOX_LEADER true — cmd/fcdev fcdev outbox only (flag --leader): the pollers of one outbox elect one leader through a lock in the source database, so any number may run (one per application task); only the leader claims and sends, the others stand by on one connection each. false: no election and no lock connection, as before: for a deployment that guarantees one poller some other way. See fcdev outbox: more than one poller, and the health check below. A value other than true/false/1/0/yes/no/on/off is refused.
FC_OUTBOX_LEADER_LEASE_MS 5000 — cmd/fcdev fcdev outbox only (--leader-lease-ms, at least 100): how long a leader keeps sending after it last confirmed its lock. The lock is confirmed every lease/5, the server ends a holder that has been silent for two leases, and a new leader waits 1.2 leases before it sends. A standby takes over 1.4 leases (7 s) after the leader’s process ends, 3.4 leases (17 s) after it goes silent (host lost, partition, paused process).
FC_OUTBOX_HEALTH_ADDR 127.0.0.1:9180 — cmd/fcdev fcdev outbox only (--health-addr): the poller serves GET /health here (200 healthy, 503 not, with a JSON report), and fcdev outbox health (which reads the same variable) asks it and exits 0 or 1. off disables it. A port that is taken is a start-up error.
FC_OUTBOX_STALL_TIMEOUT_MS 60000 — cmd/fcdev fcdev outbox only (--stall-timeout-ms, at least two leases): how long a failure may last before the poller is unhealthy: the leader’s poll loop not completing a cycle, no successful claim (claims that time out on a locked table or a slow database do not count: a restart cannot help, and would stop a task whose migration holds the lock), no platform token, a standby (or a poller waiting for outbox_messages) not reaching the database. A leader whose poll loop stalls this long also gives the leadership up and the command exits with status 1.
FC_OUTBOX_HEALTH_REQUIRE_TOKEN true — cmd/fcdev fcdev outbox only (--health-require-token): the leader, using client credentials, probes the platform token every 30 s and is unhealthy when it has been unobtainable for the stall timeout. false reports it in the health report without failing the check (see below for why you might).

Failures never drop a row. A retryable failure (a 5xx, a transport error or timeout, a 401, an unreadable answer, a per-item INTERNAL_ERROR/GATEWAY_ERROR) puts the row back to PENDING, bumping retry_count and recording error_message, and holds its message group (an ungrouped row: its type when the whole request failed, else the row alone) for 1 s, doubling with each consecutive failure to at most 5 minutes, less up to a quarter of jitter. There is no attempt limit and no variable for one: the library’s Config.MaxRetries is deprecated and ignored (it used to leave a row failed after 3 attempts, so an outage of a few seconds lost events). The backoff bounds are Config.RetryBackoffBase / RetryBackoffMax, not configurable by environment. A held group’s later rows are never sent ahead of the held row, and claims pass over held, paused and blocked groups so they cannot starve the rest. A 429 holds for its Retry-After without counting an attempt. At start-up (and on taking leadership) the processor returns rows an older version left in a retryable failure status (3, 4, 6) to PENDING, logging the count.

Requests the platform refuses as too large. A 413 on a request of several rows splits it in two and sends the halves in order (the second only if the first did not fail as a whole). A 413 on a single row means the platform will never take it: the row is refused like a BAD_REQUEST result (terminal, [blocking] , its group blocked with FC_OUTBOX_BLOCK_ON_ERROR), its message starting PAYLOAD_TOO_LARGE. A per-item BAD_REQUEST whose error starts PAYLOAD_TOO_LARGE or PAYLOAD_NOT_TEXT is terminal the same way; an INTERNAL_ERROR starting PAYLOAD_STORE_UNAVAILABLE is retried. When one request of a cut batch fails as a whole (a 5xx, a transport error, a 401, a 429), the later requests are not sent: their rows go back to PENDING untouched, behind the hold of their type.

A refused row’s error_message carries a marker saying what it means for its group: [blocking] (refused by this version: it blocks its group, and only these rows are read back to rebuild the blocks), [skipped by operator] (skipped on the admin API; replaces [blocking] ) or [skipped before upgrade] (refused by a version before the markers, whose group had already moved on past it: marked once at start-up, logged with a count, never blocks). The status code stays 2/5 in every case; the admin API and logs show the text without the marker.

fcdev outbox: more than one poller, and the health check

Section titled “fcdev outbox: more than one poller, and the health check”

Any number of fcdev outbox pollers may run against one outbox (the outbox_messages table the connection’s search_path resolves to; outboxes in other schemas or databases elect separately). They elect a leader through a lock held in the source database: the leader holds pg_try_advisory_xact_lock(1717784386, <hash of schema.table>) in a transaction it keeps open on a connection of its own (it creates nothing, so FC_OUTBOX_INIT_SCHEMA=false still runs no DDL). That transaction holds no snapshot and no table lock, so it holds back no vacuum and blocks no migration; it shows in pg_stat_activity as idle in transaction with application_name fc-outbox-leader. The design note is at the top of internal/outbox/postgres/leader.go.

On MySQL / MariaDB the leader holds a named lock, GET_LOCK('fcob_<hash of database.table>', 0), on a connection of its own, which is in no transaction (it holds no row or table lock). The connection runs with wait_timeout set to two leases, rounded up to whole seconds, so the server closes it, and releases the lock, once the leader goes silent; each confirmation checks that IS_USED_LOCK is still this connection’s CONNECTION_ID(), so a proxy that moves the session (ProxySQL multiplexing) is caught and the poller exits. A named lock is per server: every poller must reach the same server (the primary), and the election does not work across a Galera or Group Replication cluster’s nodes. The design note is at the top of internal/outbox/mysql/leader.go; the election itself is internal/outbox/leader, shared by both.

  • At most one sends. A leader checks its leadership immediately before every request and stops one lease after its last confirmation; a new leader starts 1.2 leases after it took the lock. A row whose turn comes after the loss goes back to PENDING unsent.
  • Order across a takeover. Rows the old leader had claimed stay IN_PROGRESS until the new leader puts them back, HTTP timeout + 5 s (35 s) after it took over, when every request the old leader sent is over; until then the claim passes over their message groups, so no later row of such a group is sent first. Other groups go on at once.
  • Poolers. The lock is a transaction lock because transaction-mode poolers (PgBouncer pool_mode=transaction, RDS Proxy) move a session between server connections between transactions, and PgBouncer does not support session advisory locks in that mode; a transaction stays on one server connection, so the election works directly and through session- or transaction-mode poolers (RDS Proxy does not pin a session for transaction locks). Behind a pooler the server’s idle-in-transaction timeout ends the pooler’s server connection, so a silent leader is still replaced; a client that dies without closing its socket is detected by that timeout too, not by the pooler. A statement-mode pooler refuses transactions: the poller exits with an error. The election holds one server connection per leader for as long as it leads, and gives each standby a short transaction every lease/5.
  • Exits. The command exits with status 1 when it cannot carry on: the health address is taken, a statement-mode pooler, the leader’s poll loop stalled for the stall timeout (it gives the leadership up first), or the source database unusable at start. With essential: true an exit stops the task.

The health check needs nothing but the binary. In an ECS task definition, for the poller container:

"essential": true,
"healthCheck": {
"command": ["CMD", "/fcdev", "outbox", "health"],
"interval": 10,
"timeout": 5,
"retries": 3,
"startPeriod": 60
}

ECS replaces a task whose essential container is unhealthy (a service’s task is stopped and started again), and stops the task when an essential container exits. Healthy is: a leader polling (its poll loop completed a cycle and a claim succeeded within the stall timeout, and the platform token could be obtained within it), a poller standing by or taking over that reached the database within the stall timeout, or one still waiting for outbox_messages that can check for it. The start period covers the connection at start; with FC_OUTBOX_INIT_SCHEMA=false the wait for the application’s migration is healthy for as long as it lasts. When the platform’s token endpoint is down for longer than the stall timeout, the leader’s task is replaced, then the next leader’s: set FC_OUTBOX_HEALTH_REQUIRE_TOKEN=false if the application’s tasks must not cycle during a platform outage (the rows wait in the outbox either way).

FC_PUSH_ENABLED=true hosts the framework’s go/push module in this process (internal/platform/pushgw): POST /api/push/subscriptions, GET /api/push/stream, GET /api/push/keys, CORS from the platform’s allowed-origins table (never with credentials), and GET /health/push (200 once the hub follows the log). It uses the platform database for the push outbox and log (tables from migration 104), the relay lock (fw_lock), and the rules, ticket keys and limits it reads per application (push_rules, push_ticket_keys, push_app_settings). A deployment runs it beside the platform or as its own service from the same image (FC_PLATFORM_ENABLED=false); the service must then validate the platform’s tokens, so it must be configured with the same JWT signing key as the platform: FLOWCATALYST_JWT_PRIVATE_KEY (or FC_JWT_SIGNING_KEY_PEM / FC_JWT_SIGNING_KEY_PATH), and the same FC_JWT_ISSUER (and FLOWCATALYST_JWT_PREVIOUS_PUBLIC_KEY during a key rotation). A standalone gateway with no key configured refuses to start (it would generate an ephemeral key of its own and refuse every token); only a development process (FLOWCATALYST_DEV_MODE=true, fcdev) may generate one. Streams end at once (and a subscribe is 503) when the process begins to shut down; the load balancer’s idle timeout must exceed the 25 s heartbeat.

Every module setting is an environment variable with the prefix FC_PUSH_ in place of PUSH_ (framework push contract section 10): FC_PUSH_X_Y is the setting push.x.y. Only the component flag is not a setting.

Variable Default Aliases Read in Purpose
FC_PUSH_STREAM_SECRET — (required; fcdev generates one per start) — internal/server/push.go → framework push.stream.secret Signs stream tokens (HMAC-SHA256); at least 32 characters, the same on every gateway task. Inject it from the secret store.
FC_PUSH_DRIVER postgres — framework push.driver The log: postgres (A1, fw_push_log) or redis (A2, a Redis stream; uses FC_REDIS_URL, Redis 6.2+ or Valkey). A switch resets every client once.
FC_PUSH_RETENTION 24h — framework push.retention How long the log keeps pushes for clients that resume (10m to 24h).
FC_PUSH_MAX_STREAMS, FC_PUSH_MAX_STREAMS_PER_PRINCIPAL, FC_PUSH_MAX_TOPICS, FC_PUSH_MAX_DATA_BYTES 50000, 20, 100, 16384 — framework push.* Host-wide limits (the per-application overrides are in push_app_settings).
FC_PUSH_STREAM_MAX_LIFETIME, FC_PUSH_STREAM_BUFFER, FC_PUSH_RECENT 1h, 256, 10000 — framework push.* Stream token life, per-stream buffer, pushes each task keeps in memory for replays.
FC_PUSH_RELAY_BATCH, FC_PUSH_RELAY_INTERVAL, FC_PUSH_RELAY_LEASE 500, 1s, 5s — framework push.relay.* The single relay (one task holds the svc:push-relay lock): rows per run, longest wait between runs, lock lease.
FC_PUSH_DB_POOL_MAX 10 — internal/server/push.go Connections of the framework module’s own pool on the platform database (the module cannot be handed the platform’s pool, so the gateway has a second, small one; the ingest and sync paths use the platform’s). Not a module setting.
FC_REDIS_URL — — internal/server/push.go The A2 driver’s server, only when FC_PUSH_DRIVER=redis (the same setting the rate limiter reads).

Ingest and configuration, no setting needed: POST /api/push/batch (permission platform:messaging:batch:push-write, the outbox processor’s PUSH rows; an application over its publish rate or paused is answered 429 with Retry-After, the rows wait in its outbox), POST /api/applications/{appCode}/push/sync (rules and ticket keys, permission platform:application-service:push:sync) and GET/PUT /api/applications/{appCode}/push/settings (limits and pause, anchor with platform:admin:push:manage). The publish rate is per gateway task. The module’s fw_push_* series and the gateway’s fc_push_* ones are served on the platform’s Prometheus listener (FC_METRICS_PORT, /metrics) when the gateway runs in the process. The outbox processor wakes on a PUSH row’s commit (LISTEN fc_outbox_push; the SDK writers notify in the insert’s statement) and polls as the fallback.

Revocation needs no setting: the trigger of migration 105 notifies when a field login family’s last session ends, and every sign-out notifies the principal (fc_push_session_end, fc_push_principal_end); a gateway task turns them into the end of the matching streams on all tasks. The permission platform:push:stream:all-clients (held by super-admin’s wildcard) lets a credential open a platform-wide stream.

Per-projection batch-size precedence: per-projection env var > FC_STREAM_BATCH_SIZE > the built-in default (events/dispatch 100, fan-out 200).

Variable Default Aliases Read in Purpose
FC_STREAM_EVENTS_ENABLED true — internal/server/envcfg.go Event projection sub-toggle (defaults ON so the top-level flag suffices).
FC_STREAM_DISPATCH_JOBS_ENABLED true — internal/server/envcfg.go Dispatch-job projection sub-toggle.
FC_STREAM_FAN_OUT_ENABLED true — internal/server/envcfg.go Event fan-out sub-toggle.
FC_STREAM_PARTITION_MANAGER_ENABLED true FC_STREAM_PARTITIONS_ENABLED (back-compat) internal/server/envcfg.go Partition-manager sub-toggle (leader-only DDL).
FC_STREAM_BATCH_SIZE 0 (per-projection defaults) — internal/server/envcfg.go Global batch-size override for all projections.
FC_STREAM_EVENTS_BATCH_SIZE 0 (default 100) — internal/server/subsystems.go Event-projection batch size.
FC_STREAM_DISPATCH_JOBS_BATCH_SIZE 0 (default 100) — internal/server/subsystems.go Dispatch-job-projection batch size.
FC_STREAM_FAN_OUT_BATCH_SIZE 0 (default 200) — internal/server/subsystems.go Fan-out batch size.
FC_STREAM_FAN_OUT_SUBS_REFRESH_SECS 0 (default 5s) — internal/server/envcfg.go Fan-out subscription-cache TTL.
FC_STREAM_PARTITION_MONTHS_FORWARD 0 (default 3) — internal/server/envcfg.go Months of partitions to pre-create.
FC_STREAM_PARTITION_RETENTION_DAYS 0 (default 90) — internal/server/envcfg.go Partition retention before drop (all partitioned tables except the scheduled-job history pair).
FC_STREAM_PARTITION_RETENTION_DAYS_SCHEDULED_JOBS 0 (default 30) — internal/server/envcfg.go Retention for msg_scheduled_job_instances + msg_scheduled_job_instance_logs. Monthly partitions ⇒ on-disk window floats between retention and retention+1 month.
FC_STREAM_PARTITION_TICK_HOURS 0 (default 24) — internal/server/envcfg.go Partition-manager tick cadence.

All read in internal/platform/scheduledjob/scheduler (ConfigFromEnv); unset or unparseable → the built-in default.

Variable Default Aliases Read in Purpose
FC_SCHEDULED_JOB_POLL_SECONDS 30 — internal/platform/scheduledjob/scheduler Upper bound on the cron poller’s sleep (it wakes earlier for the next due tick, so sub-30s schedules fire on time); also how soon new or edited jobs are noticed.
FC_SCHEDULED_JOB_DISPATCH_SECONDS 5 — internal/platform/scheduledjob/scheduler Dispatcher wake-up interval.
FC_SCHEDULED_JOB_DISPATCH_BATCH 32 — internal/platform/scheduledjob/scheduler Max QUEUED instances per dispatch tick.
FC_SCHEDULED_JOB_HTTP_TIMEOUT_SECONDS 10 — internal/platform/scheduledjob/scheduler Webhook HTTP timeout for jobs that set no timeoutSeconds; a job’s timeoutSeconds overrides it.
FC_SCHEDULED_JOB_HTTP_TIMEOUT_MAX_SECONDS 300 — internal/platform/scheduledjob/scheduler Ceiling on a job’s timeoutSeconds as the webhook timeout. An instance IN_FLIGHT longer than this plus 60 s is abandoned (DELIVERY_FAILED, not re-fired).
Variable Default Aliases Read in Purpose
FC_STANDBY_ENABLED false STANDBY_ENABLED internal/server/envcfg.go Enable Redis leader election for HA (single-active subsystems gate on it; election failure fails closed).
FC_STANDBY_REDIS_URL redis://127.0.0.1:6379 REDIS_URL internal/server/envcfg.go Redis used for leader election.
FC_STANDBY_LOCK_KEY fc:server:leader — internal/server/envcfg.go Election lock key; background subsystems elect on subsystem-suffixed keys (e.g. …:stream).

Resolution: env vars → mcp-credentials.json in the OS cache dir (<user-cache>/flowcatalyst-dev/mcp-credentials.json, written by fcdev’s bootstrap) → defaults. With client_id+secret it mints OAuth tokens; with only a secret it uses it as a static bearer token; with neither it calls the platform unauthenticated (local dev only — the standalone server fails fast).

Variable Default Aliases Read in Purpose
FC_FN_CLI_CREDENTIALS_PATH <user cache dir>/flowcatalyst-dev/fng-cli.json — cmd/fcdev/fn_platform.go Location of the dev CLI credential file fcdev start writes and fcdev fn ... reads. Isolated/test fcdevs MUST set it to a path under their own state dir, or they overwrite the developer’s real file. The Java fcdev honours the same variable.
FC_MCP_CREDENTIALS_PATH <user cache dir>/flowcatalyst-dev/mcp-credentials.json — internal/mcp/config.go Location of the local MCP credentials file fcdev start writes and fcdev mcp reads. Isolated/test fcdevs MUST set it (like FC_FN_CLI_CREDENTIALS_PATH), or they overwrite the developer’s file. On every start fcdev rewrites the file from the stored client secret when it does not match its own database, so an overwritten file heals on the owner’s next fcdev start.
FC_MCP_PORT 8090 — internal/server/envcfg.go MCP HTTP listener port.
FC_MCP_BIND 127.0.0.1 (localhost-only) — internal/server/envcfg.go MCP bind host; set 0.0.0.0 to expose (e.g. in a container). A non-loopback bind requires FC_MCP_AUTH_TOKEN: without it the server refuses to start, and so does fcdev mcp --http.
FC_MCP_AUTH_TOKEN — (no caller authentication) — internal/mcp/httpauth.go Bearer token the MCP HTTP endpoint (/mcp) requires: every request must send Authorization: Bearer <token> (constant-time comparison; 401 otherwise). Applies to the fc-server subsystem and to fcdev mcp --http; /health stays open. Unset is accepted only on a loopback bind. The stdio transport has no HTTP endpoint and is unaffected. The MCP server’s own platform credential is separate (FLOWCATALYST_CLIENT_ID / _SECRET).
FLOWCATALYST_URL http://localhost:8080 (after credentials-file fallback) FC_MCP_PLATFORM_URL (in-process server only) internal/mcp, internal/server/envcfg.go Platform API root the MCP server proxies into. Also the last alias of FC_OUTBOX_PLATFORM_URL.
FLOWCATALYST_CLIENT_ID — (credentials-file fallback) — internal/mcp, internal/server/envcfg.go OAuth client_credentials client id for token minting.
FLOWCATALYST_CLIENT_SECRET — (credentials-file fallback) — internal/mcp, internal/server/envcfg.go OAuth client secret (or static bearer token when used alone).

Over-the-air updates of Expo phone apps (docs/app-updates-design.md; read in internal/server/envcfg.go). Part of the platform API (FC_PLATFORM_ENABLED).

Variable Default Aliases Read in Purpose
FC_APP_UPDATES_SIGNING_KEYS `` (none: the update routes answer 503) — internal/server/envcfg.go The manifest-signing keyring: comma-separated keyid=source, where source is aws-sm://... or aws-ps://... (a secret reference, resolved at use by internal/secretref, so FC_SECRET_REFERENCE_ALLOW must admit it), env:NAME (a variable holding the PEM, as a task definition injects a secret) or file:/path. RSA, at least 2048 bits, PKCS#1 or PKCS#8. A phone asks for its key id; keep old ids while binaries embedding their certificates are in use. Never put a different key behind an existing id. fcdev creates a development key (main).
FC_APP_UPDATES_DEFAULT_KEY_ID the first key — internal/server/envcfg.go The key that signs for a client that names none.
FC_APP_UPDATES_STORE `` (empty → /var/lib/flowcatalyst/app-updates) — internal/server/envcfg.go Update file store: s3://bucket/prefix (deployed) or file:///abs/path. Content-addressed by SHA-256, like the function artifact store. fcdev uses its data directory.
FC_APP_UPDATES_ASSET_BASE_URL `` (relative asset URLs) — internal/server/envcfg.go When set, manifests name assets at <base>/app-updates/... (for a CDN in front of the asset route); empty names them relative to the manifest URL, which both clients resolve.
FC_APP_UPDATES_MAX_FILE_BYTES 67108864 (64 MiB) — internal/server/envcfg.go Largest update file PUT /api/app-updates/files/... accepts.
FC_APP_UPDATES_MAX_BINARY_BYTES 536870912 (512 MiB) — internal/server/envcfg.go Largest app binary (APK) PUT /api/app-updates/binary-files/... accepts. The upload is spooled to the system’s temporary directory (TMPDIR) while it is checked, then streamed into FC_APP_UPDATES_STORE; the host needs that much free temporary space per concurrent upload.
FC_APP_UPDATES_INSTALL_BASE_URL `` (the platform’s external base URL, FC_JWT_ISSUER / FC_EXTERNAL_BASE_URL) — internal/server/envcfg.go The address install links are handed out under, and the address the install page’s QR code encodes: set it when phones reach the platform under another host than its issuer (for example an updates host).
FC_FIELD_PHOTOS on — internal/server/envcfg.go Field-worker photos (docs/field-worker-photo-spec.md). off (or false, 0, no) turns the feature off platform-wide: the photo routes answer 404 PHOTOS_DISABLED and worker JSON shows no photo. The bytes live in Postgres; nothing else needs configuring. A client switches photos off with its own field policy.
FC_FIELD_PHOTO_MAX_BYTES 10485760 (10 MiB) — internal/server/envcfg.go Largest photo upload PUT /api/field-workers/{id}/photo accepts; a larger Content-Length is refused before the body is read.
FC_FIELD_PHOTO_MAX_PIXELS 25000000 — internal/server/envcfg.go Most pixels (width times height) an uploaded photo may have, read from the image header before any decoding; a side may be at most 10 000 px. A decode holds about 4 bytes a pixel, so lower this before raising the concurrency.
FC_FIELD_PHOTO_CONCURRENCY 2 — internal/server/envcfg.go Photos decoded at once per process; another upload waits a few seconds for a slot, then 503 PHOTO_BUSY.
FC_FIELD_PHOTO_READS_PER_HOUR 120 — internal/platform/shared/ratelimit A signed-in worker’s reads of their own photo (POST /field/worker/photo) per worker per rolling hour; over it the device gets 429 + Retry-After. 0 is no limit. Disabled with FC_RATE_LIMIT_DISABLE.
FC_FIELD_PHOTO_WRITES_PER_HOUR 20 — internal/platform/shared/ratelimit A signed-in worker’s changes to their own photo (set and remove) per worker per rolling hour, as above.
FC_FIELD_UNLOCK_CHALLENGES_PER_HOUR 30 — internal/platform/shared/ratelimit Unlock-key challenges (POST /field/auth/unlock/challenge) per enrolled device per rolling hour (docs/field-unlock-keys-spec.md section 4.3); over it 429 TOO_MANY_ATTEMPTS + Retry-After. 0 is no limit. Failed unlocks count in the device and client sign-in buckets above, as wrong PINs do. Disabled with FC_RATE_LIMIT_DISABLE.
FC_FIELD_ATTESTATION_ROOTS unset — internal/server/wire_routes.go Path to a PEM file of the root certificates an unlock key’s Android key attestation may chain to (Google’s published hardware attestation roots). Unset, or a file that cannot be read (logged at boot): attestation is still parsed, recorded and shown, no chain is TRUSTED, no client policy can set unlockKeyAttestation: REQUIRED (400 POLICY_INVALID), and the status list below is not fetched. Read at boot.
FC_FIELD_ATTESTATION_STATUS_URL https://android.googleapis.com/attestation/status — internal/server/wire_routes.go Google’s attestation key status list (revoked and suspended attestation certificates), fetched in the background when attestation roots are configured; no request waits on it (docs/field-unlock-keys-spec.md section 6.4). Set it empty to switch the check off: REQUIRED then means a trusted chain within its dates without the revocation check. It must be an https URL: the platform refuses to start with any other while the check is on, and a fetch follows a redirect only to https on the same host. After each good fetch the registered keys under REQUIRED are checked against it (a listed key is revoked and its sessions end). A platform with REQUIRED in use needs outbound HTTPS to this address.
FC_FIELD_ATTESTATION_STATUS_REFRESH 1h — internal/server/wire_routes.go How often the status list is fetched (a Go duration). A failed fetch keeps the last good copy; it is logged as a warning while that copy is usable and as an error at every attempt once none is.
FC_FIELD_ATTESTATION_STATUS_MAX_AGE 48h — internal/server/wire_routes.go How old the last good copy may be and still be used. With none usable, under REQUIRED, a registration that would otherwise pass, every unlock challenge and every unlock are refused 503 ATTESTATION_STATUS_UNAVAILABLE (the workers sign in with their PIN meanwhile; no key is revoked for it), the fetch failures are logged as errors, and the console’s policy page says the list is unavailable.

Where the payloads of events and dispatch jobs are kept (docs/payload-offload-design.md, section 4; read in internal/server/envcfg.go, checked by internal/platform/shared/payloadstore). Unlike most numeric variables, a value here that is not a whole number, or out of its range, stops the server at startup instead of falling back to the default. The readers accept both shapes of a row (a payload in the payload table, or in the row’s own column) whatever is set here; what the writers produce is FC_PAYLOAD_TABLE_WRITES (the design’s section 10).

Variable Default Aliases Read in Purpose
FC_PAYLOAD_STORE `` (none: nothing is offloaded) — internal/server/envcfg.go The payload store: s3://bucket/prefix (the default AWS credential chain; the role needs s3:PutObject and s3:GetObject under the prefix) or file:///abs/path (an absolute directory, for fcdev, tests and a single node). Anything else stops the server. Objects in S3 are never deleted by the platform: set a lifecycle rule on the bucket’s prefix that expires objects after the partition retention plus 35 days (125 days at the default retention; see Turning payload storage on below). A file:// directory is cleaned by the partition manager’s daily pass, after the same retention plus 35 days. Removing the store while rows still hold references makes those payloads unreadable: set FC_PAYLOAD_OFFLOAD_MIN_BYTES=0, wait one retention period, then remove it.
FC_PAYLOAD_OFFLOAD_MIN_BYTES 5120 — internal/server/envcfg.go A payload larger than this is offloaded to the store. 0 stops offloading (references already written stay readable). Otherwise at least 2048, and less than FC_PAYLOAD_INLINE_MAX_BYTES when a store is set. Ignored when no store is set.
FC_PAYLOAD_INLINE_MAX_BYTES 1048576 (1 MiB) — internal/server/envcfg.go The largest payload kept in PostgreSQL: with no store (or offloading stopped) the largest payload accepted; with a store, the most kept in the database when the store cannot be written (a larger payload then answers a retryable error). Positive.
FC_PAYLOAD_MAX_BYTES 5000000 (5 MB) — internal/server/envcfg.go The largest payload accepted while offloading. 5 MB and not 5 MiB, so a delivery in an envelope still fits a receiver’s 5 MiB limit. At least FC_PAYLOAD_INLINE_MAX_BYTES. Ignored when no store is set.
FC_PAYLOAD_CODEC zstd — internal/server/envcfg.go Compression of an offloaded payload: zstd or none. Each reference records its own codec, so changing it leaves stored payloads readable.
FC_PAYLOAD_CACHE_BYTES 67108864 (64 MiB) — internal/server/envcfg.go Size of the in-process cache of resolved offloaded payloads; a payload larger than an eighth of it is not cached. 0 disables the cache.
FC_PAYLOAD_TABLE_WRITES false — internal/server/envcfg.go The writers’ switch. false: events, the platform’s own events, dispatch jobs and payload edits are written as before (the payload in msg_events.data / msg_dispatch_jobs.payload); the only limit is the largest payload, FC_PAYLOAD_INLINE_MAX_BYTES, held per item on the ingest routes (see FC_INGEST_BATCH_MAX_BYTES). true: each payload is a msg_payloads row (offloaded above FC_PAYLOAD_OFFLOAD_MIN_BYTES when a store is set) that the event or job points at, and a payload larger than the largest accepted (FC_PAYLOAD_MAX_BYTES with a store, FC_PAYLOAD_INLINE_MAX_BYTES without) or not UTF-8 text is refused. Turn it on only once every instance of the deployment runs a release that reads both shapes; rolling back past such a release is unsafe once rows are written. A value that is not a boolean stops the server.
FC_INGEST_BATCH_MAX_BYTES 16777216 (16 MiB) — internal/server/envcfg.go The request body cap of the routes that take a batch of payloads: POST /api/events/batch, /bff/events/batch and POST /api/dispatch-jobs/batch. A larger body is refused whole, 413 BODY_TOO_LARGE. Each item is still held to the largest payload accepted (FC_PAYLOAD_MAX_BYTES while payloads are offloaded, which needs a store, a threshold that is not 0 and FC_PAYLOAD_TABLE_WRITES=true; FC_PAYLOAD_INLINE_MAX_BYTES otherwise, the switch off included) and refused in its own result slot (BAD_REQUEST PAYLOAD_TOO_LARGE). Must be at least twice that largest payload, because the outbox processor sends data as a JSON string and escaping lengthens it; a smaller value stops the server. The routes that carry one payload (POST /api/events, POST /api/dispatch-jobs, PUT /api/dispatch-jobs/{id}/payload and its /bff twin, the console’s payload edit) are capped at twice the largest payload plus 64 KiB, not configurable on their own. The ingestion runtime’s routes keep their own caps (FC_INGESTION_JOBS_MAX_BYTES, FC_INGESTION_REPORT_MAX_BYTES).

For an operator, in this order (docs/payload-offload-design.md, section 10). Each step is safe to stop at.

  1. Deploy this release everywhere with FC_PAYLOAD_TABLE_WRITES off (the default). Migration 123 adds the payload table and the payload_id columns; nothing is written to them yet. Every instance now reads both shapes. Rolling back is still safe.
  2. Turn FC_PAYLOAD_TABLE_WRITES=true on once every instance runs this release, on every instance. An older instance would read a row of the new shape as having no payload and deliver an empty body. From here, rolling back to a release older than this one is unsafe once rows have been written; rolling back to this release with the switch off is safe.
  3. Optionally, offload large payloads: set FC_PAYLOAD_STORE and, if 5 KiB is not right, FC_PAYLOAD_OFFLOAD_MIN_BYTES, on every instance. The largest payload accepted then rises from FC_PAYLOAD_INLINE_MAX_BYTES (1 MiB) to FC_PAYLOAD_MAX_BYTES (5 MB). Subscribers of event types with large payloads must accept a body of that size.
    • S3: the platform’s role needs s3:PutObject and s3:GetObject on arn:aws:s3:::<bucket>/<prefix>/*, and s3:ListBucket on the bucket limited to that prefix; nothing that deletes or reconfigures. s3:ListBucket is there for one reason: without it S3 answers a key that does not exist with 403, not 404, and the platform then treats an object that is gone as a store that cannot be read: the job is retried and never fails with PAYLOAD_MISSING. Keep the bucket private and encrypted at rest. The infrastructure code must set a lifecycle rule that expires objects under the store’s prefix after the partition retention plus 35 days (a monthly partition keeps a row up to 31 days past the retention), 125 days at the default 90-day FC_STREAM_PARTITION_RETENTION_DAYS:

      {
      "ID": "fc-payloads",
      "Status": "Enabled",
      "Filter": { "Prefix": "<prefix>/v1/" },
      "Expiration": { "Days": 125 }
      }

      The platform neither writes this rule nor checks for it. A bucket without it keeps every stored payload for ever. Change the days when you change the retention.

    • file://: for fcdev, tests and a single node (several instances only when they share the directory). The partition manager’s daily pass (FC_STREAM_PARTITION_MANAGER_ENABLED, on the leader) removes the date directories v1/<client>/<yyyy-mm-dd>/ older than now minus (FC_STREAM_PARTITION_RETENTION_DAYS

      • 35 days), then the client directories left empty. It touches nothing else in the directory. The process that runs the partition manager must see the same directory as the processes that write payloads.
  4. The outbox processor (FC_OUTBOX_MAX_REQUEST_BYTES, 8 MiB by default) must stay at or under half of the platform’s FC_INGEST_BATCH_MAX_BYTES (16 MiB by default). Raise the platform’s cap before the processor’s, never the other way round.

Turning offloading off again. Set FC_PAYLOAD_OFFLOAD_MIN_BYTES=0: nothing new is offloaded, and payloads already in the store stay readable. Wait one retention period (FC_STREAM_PARTITION_RETENTION_DAYS, plus the month a partition can outlive it), so every row that refers to the store has been dropped. Only then remove FC_PAYLOAD_STORE. Removing the store while rows still refer to it makes those payloads unreadable: their jobs are not delivered (the callback answers 503 payload store not configured and the queue tries again) and their reads come back with dataUnavailable / payloadUnavailable. Changing the threshold is safe at any time for what is stored, but note that a threshold of 0 also lowers the largest payload accepted to FC_PAYLOAD_INLINE_MAX_BYTES: a larger payload is then refused PAYLOAD_TOO_LARGE, and the outbox processor does not send it again.

Health. A process that runs the platform API answers GET /health/payload-store on its API listener (no authentication, always 200), with the payload store’s state as JSON: status (NOT_CONFIGURED when no store is set, which is healthy; UP; or DEGRADED when a store write failed, so payloads were kept in the database or refused, or a store read failed, in the last 5 minutes), configured, kind (s3, file), reachable (from the outcome of the last real store operation; absent while unknown), offloading, lastSuccessAt, lastFailureAt, lastFailure and windowSeconds. The bucket and the directory are never shown. The metrics listener’s /ready carries the same status as payload_store. A health request never calls the store: reachability comes from real operations, plus one check at start-up (the file store makes its directory and a temporary file in it; the S3 store reports a failure only when its credentials do not resolve). A store that is down never makes the process unready or fails its liveness probe: ingestion goes on, payloads up to FC_PAYLOAD_INLINE_MAX_BYTES are kept in the database, and fc_payload_inline_fallback_total and fc_payload_store_errors_total rise. Alert on DEGRADED or on those counters.

Platform-side settings for functions (internal/platform/function/artifact, docs/function-runner-plan.md §8.4), followed by the runner subsystem’s own FC_FUNCTIONS_* knobs (read by LoadFunctionRunnerEnv in internal/server/functions.go).

Variable Default Aliases Read in Purpose
FC_FUNCTIONS_ARTIFACT_STORE `` (empty → a file-store default directory) — internal/server/envcfg.go Artifact store URL for PUT /api/functions/{id}/artifacts/{digest}: file:///abs/path or s3://bucket/prefix. Empty uses file:// rooted at a fixed data directory (internal/server/wire_services.go’s defaultFunctionArtifactDir) — set this to an s3:// URL in any deployed environment.
FC_FUNCTIONS_RUNNER_URL http://127.0.0.1:8095 — internal/server/envcfg.go The function runner’s base URL, templated with {pool} (one platform may address several runner deployments, one per pool). 8095 is the runner’s own private-listener default (8090 is FC_MCP_PORT’s default, also live in fc-dev). Promote wiring (WP8, docs/function-runner-plan.md §8.5) substitutes {pool} and appends /fn/<address><path> to build each subscription/scheduled-job delivery target.
FC_FUNCTIONS_RUNNER_URL_<RT> — — internal/server/envcfg.go Per-runtime override of FC_FUNCTIONS_RUNNER_URL: <RT> is the runtime tag upper-cased (for example a jvm runtime is configured by the variable ending _JVM), same {pool} templating. A delivery to a function whose version runs on that runtime (promote wiring: the version being promoted; function dispatch: the target’s live version) is built from this URL; runtimes without an override use FC_FUNCTIONS_RUNNER_URL. A suffix that is not a valid runtime tag (2-16 chars, lower-case alphanumerics, a letter first) or an empty value is logged and ignored. The jvm runtime (jars, hosted by the ingestor runtime’s function host) is configured this way: deployed, point the variable ending _JVM at the ingestor (or function-host) service; fc-dev sets it to http://127.0.0.1:<FC_INGESTOR_PORT> while it runs the ingestor child, unless it is already set.
INGEST_FUNCTIONS_ENABLED true — ingestor runtime (Java); set by cmd/fcdev/ingestor.go Turns the ingestor’s function role (hosting jvm functions) on or off. The runtime’s service account must also hold platform:function-runner for the role to fetch desired state. fc-dev always passes true.
INGEST_FUNCTIONS_POOL default — ingestor runtime (Java); set by cmd/fcdev/ingestor.go The function pool the ingestor’s function role serves (the pool of the desired-state request). fc-dev passes FC_FUNCTIONS_POOL (default default), the pool the local Go runner serves.
INGEST_FUNCTIONS_DB_MAX_POOLS 32 — ingestor runtime (Java) Database pools the function host keeps for ctx.dataSource(name): one per distinct DSN, shared by every function bound to it. At the cap the least recently used pool is closed and made again by the next call. PostgreSQL only.
INGEST_FUNCTIONS_DB_MAX_CONNS 4 — ingestor runtime (Java) Connections per function database pool.
INGEST_FUNCTIONS_DB_IDLE_TTL PT10M — ingestor runtime (Java) A function database pool unused this long is closed.
INGEST_FUNCTIONS_LOG_RATE 100 — ingestor runtime (Java) The most log lines a second one function address may write (all its versions share the budget). Lines over the budget are dropped and counted; the host logs one warning a minute for a function that dropped any. A message over 8 KiB is cut.
INGEST_FUNCTIONS_LOG_BURST 1000 — ingestor runtime (Java) The most log lines one function address may write in a burst before INGEST_FUNCTIONS_LOG_RATE applies.
INGEST_INGESTION_ENABLED true — ingestor runtime (Java) Turns the ingestor’s ingestion role on or off. false makes a functions-only process: it never polls for ingestions, takes no ingestion leases, runs no routes and serves no /ingest/ endpoint. With INGEST_FUNCTIONS_ENABLED=false it is an ingestion-only process.
FC_FUNCTIONS_KEEP_VERSIONS 20 — internal/server/envcfg.go How many untagged versions of a function are kept. After each successful publish the oldest untagged versions beyond this number are deleted for good (the fng_versions row and, if no remaining version of any function uses it, the stored artifact). A version is tagged when any alias (live or another) points at it: tagged versions are never pruned and do not count toward the limit. The function’s newest version and a PUBLISHED version younger than one hour are also never pruned. Version numbers are never reused. Non-positive or unparseable = the default; pruning cannot be switched off (set a very large number to approximate that). Functions already over the limit are pruned on their next publish, or sooner with POST /api/functions/{id}/versions/prune (fcdev fn prune).
FC_FUNCTIONS_TRACE_MAX_MINUTES 60 — internal/server/envcfg.go The longest window (minutes) a function’s declared trace context may be switched on for (PUT /api/functions/{id}/trace/{context}); a longer minutes is refused TRACE_WINDOW_TOO_LONG. Non-positive or unparseable = the default.
FC_FUNCTIONS_TRACE_HTTP_MAX_MINUTES 15 — internal/server/envcfg.go The same cap for the built-in http trace context, lower because it captures request and response bodies. It always applies: http cannot be left on “until switched off”. Non-positive or unparseable = the default.
FC_FUNCTIONS_TRACE_INDEFINITE_MAX_DAYS 7 — internal/server/envcfg.go The hard ceiling of a declared trace context switched on “until switched off” (indefinite: true, which needs platform:function:trace:indefinite): after this many days the window closes by itself. Non-positive or unparseable = the default.
FC_FUNCTIONS_TRACE_RETENTION_DAYS 30 — internal/server/envcfg.go How long function trace records (fng_trace_log) are kept, counted from when the platform stored them (created_at, never the runner’s at). Older records are deleted in chunks: for a function in the background after one of its contexts is switched on, every 10 minutes for each function with a live window, and by a sweep across all functions every FC_FUNCTIONS_TRACE_PRUNE_INTERVAL_MINUTES (function.RunTraceRetention, run on every platform process; the deletes are idempotent). Non-positive or unparseable = the default.
FC_FUNCTIONS_TRACE_PRUNE_MAX_ROWS 5000000 — internal/server/envcfg.go The most trace records one retention sweep deletes (across all functions, or for one function), in DELETEs of 5000. With the hourly default that is 120 M rows a day, against at most 17.28 M a day for one function ingesting at the 200/s cap on one platform process. Non-positive or unparseable = the default.
FC_FUNCTIONS_TRACE_PRUNE_INTERVAL_MINUTES 60 — internal/server/envcfg.go How often the trace retention sweep across all functions runs. Non-positive or unparseable = the default.
FC_DISPATCH_JOB_MAX_WINDOW_DAYS 31 — internal/server/envcfg.go Widest created_at time window a dispatch-job list-shaped read may cover: GET /api/dispatch-jobs, /list-raw, /filter-options, and POST /api/dispatch-jobs/requeue-by-filter (+ /preview), and the /ui/dispatch-jobs page. A read that names no since/until is held to the last 24 hours and the response echoes the window; a wider one is 400 WINDOW_TOO_LARGE. Lookups keyed by one job or event (by id, by event, attempts, sign) are exempt. Non-positive or unparseable = the default. Keep it at or below the partition retention (FC_STREAM_PARTITION_RETENTION_DAYS).
FC_INGESTION_ENABLED false (fcdev: true) — internal/server/envcfg.go Mounts the ingestion API (/api/ingestions..., /api/ingestion-source-kinds, /api/ingestion-tests...) and the runtime API (/api/ingestion-runtime/v1/...), and starts the ingestion retention sweep and reports features.ingestion in the public platform config (GET /api/config/platform) so the SPA shows the ingestion pages. Off: the ingestion routes answer 404. The platform:ingestion-* roles and permissions are seeded and the ing_* tables exist either way; the tables stay empty. See docs/ingestion-design.md section 6.
FC_INGESTION_LEASE_SECONDS 180 — internal/server/envcfg.go How long a polled ingestion’s lease (sftp, s3, database-poll, api-poll, custom sources run on one runtime at a time) lasts without being renewed by its runtime’s poll. A holder that stops polling loses the ingestion to another runtime when this has passed. It is also the liveness window: a runtime that polled within one lease (and has not said goodbye) is live. Non-positive or unparseable uses the default. Below 120 the server refuses to start (fc-server and fcdev alike): the runtime polls every minute and stops a single-owner route before its lease ends, so a shorter lease stops routes at the first slow poll. A running polled ingestion no runtime has held for this plus two minutes is shown as “not running” and counted in fc_ingestion_unheld. See docs/ingestion-design.md section 7.
FC_INGESTION_UNHEALTHY_COOLDOWN 10m — internal/platform/ingestion/runtime.go A Go duration (5m, 10m). For this long after a runtime reports an ingestion’s route FAILED or FAILING, that runtime neither renews nor claims the ingestion while another live runtime that carries its kind has not failed it recently, so it moves there when its lease ends. An ingestion every live carrier has failed stays put. Non-positive or unparseable = the default. Read on every poll. See docs/ingestion-design.md section 7.
FC_INGESTION_RECENT_WINDOW 10m — internal/platform/ingestion/runtime.go A Go duration. A runtime returning after a gap (new, silent for longer than a lease, or after a goodbye) claims at most, per kind, its share over the runtimes that carry the kind and polled within this window (and have not said goodbye), itself included, in new leases in that poll; renewals are not capped. It keeps the first runtime back after a platform outage from claiming everything. Non-positive or unparseable = the default. Read on every poll.
FC_INGESTION_JOBS_MAX_BYTES 10485760 (10 MiB) — internal/platform/ingestion/runtimeapi/api.go The largest request body POST /api/ingestion-runtime/v1/ingestions/{id}/jobs takes (up to 1,000 records a request). A bigger body is refused before it is read. Non-positive or unparseable = the default. Read when the routes are mounted.
FC_INGESTION_REPORT_MAX_BYTES 4194304 (4 MiB) — internal/platform/ingestion/runtimeapi/api.go The largest request body POST /api/ingestion-runtime/v1/report takes. The other runtime calls keep huma’s 1 MiB. Non-positive or unparseable = the default.
FC_INGESTION_RETENTION_MAX_CHUNKS 500 — internal/platform/ingestion/retention.go How many chunks of 10,000 rows the hourly ingestion retention sweep deletes from each high-volume table (job keys, exchange metrics, failures, test requests) per run: 5 million rows a table an hour by default, steady state for about 1,400 records a second with an externalId each. Raise it for a fleet beyond that; the deletes are bounded and idempotent. Non-positive or unparseable = the default.
FC_INGESTION_TRACE_PICKUP_GRACE 2m — internal/platform/ingestion/trace.go A Go duration (90s, 2m) added to an ingestion trace window’s hard stop: the time runtimes have to learn of the window at their next sync (a minute in production). A runtime captures for the window’s length from when it first sees it, never past the hard stop, and the platform refuses records dated after the hard stop. Non-positive or unparseable = the default. See docs/ingestion-trace-design.md.
FC_INGESTION_TRACE_RETENTION_DAYS 7 — internal/platform/ingestion/trace.go How long ingestion trace records are kept, counted from when the platform stored them (never the runtime’s time); pruned by the hourly ingestion retention sweep, which also removes windows that ended before that. Non-positive or unparseable = the default.

The runner is off unless FC_FUNCTIONS_ENABLED is true. When it is on, the runner needs a platform to fetch function versions from and a service account (holding platform:function-runner) to authenticate as; without them it logs an error and does not start (the rest of the process keeps running). Booleans accept 1/true/yes/on and 0/false/no/off; an unparseable integer falls back to the default.

Variable Default Aliases Read in Purpose
FC_FUNCTIONS_ENABLED false — internal/server/functions.go Run the function runner in this process. (fcdev defaults it to true, see below.)
FC_FUNCTIONS_BIND 0.0.0.0 — internal/server/functions.go Listen address for both runner entries.
FC_FUNCTIONS_PORT 8095 — internal/server/functions.go Private entry port (/fn/<address><path>, /metrics): where the platform’s promoted subscription and schedule deliveries land.
FC_FUNCTIONS_PUBLIC_PORT 0 (off) — internal/server/functions.go Public entry port (Host-header routing of *-auth endpoints). 0 disables it.
FC_FUNCTIONS_POOL default — internal/server/functions.go Runner pool this process serves; it only loads functions whose pool matches (a function with no pool belongs to default).
FC_FUNCTIONS_PLATFORM_URL — (if the platform runs in this process: http://127.0.0.1:<FC_API_PORT>) — internal/server/functions.go Platform base URL for the control plane and the token endpoint. Required for a runner-only deployment.
FC_FUNCTIONS_CLIENT_ID — — internal/server/functions.go OAuth client_credentials client id of the runner’s service account. Required.
FC_FUNCTIONS_CLIENT_SECRET — — internal/server/functions.go Its client secret. Required.
FC_FUNCTIONS_MEMORY_LIMIT_MB 0 → detect (cgroup v2, then v1, then physical RAM) — internal/server/functions.go Total memory the runner may use, in MiB. If 0 and no limit can be detected the runner does not start.
FC_FUNCTIONS_MEMORY_RESERVE_MB 0 → max(128 MiB, 10% of the limit), capped at half the limit — internal/server/functions.go Memory kept back for the runner itself; function instances are budgeted from limit - reserve. Must be below the limit.
FC_FUNCTIONS_CACHE_DIR <user-cache-dir>/flowcatalyst/functions — internal/server/functions.go Local cache of downloaded function artifacts.
FC_FUNCTIONS_IDLE_EVICT_SECONDS 1800 — internal/server/functions.go Seconds a lazily-loaded version may sit unused before its compiled code is dropped (<= 0 behaves as 1800).
FC_FUNCTIONS_LOAD_RETRY_INITIAL_MS 1000 — internal/server/functions.go First delay (milliseconds) before retrying a version whose artifact fetch failed transiently (control-plane 5xx/429/503, network errors, timeouts, storage download errors). Doubles per attempt up to ..._MAX_MS, with jitter (uniform in [d/2, d]). While retrying the version stays PREPARING (the runner’s heartbeat shows state RETRYING); it is not reported FAILED, because the platform latches the first FAILED report. <= 0 behaves as the default. Permanent failures (404, digest mismatch, invalid module/ABI, compile errors) are reported FAILED at once.
FC_FUNCTIONS_LOAD_RETRY_MAX_MS 30000 — internal/server/functions.go Cap (milliseconds) on a single retry delay. <= 0 behaves as the default; a value below the initial delay is raised to it.
FC_FUNCTIONS_LOAD_RETRY_BUDGET_SECONDS 300 — internal/server/functions.go Total time (seconds) one load may spend retrying transient fetch failures. When the next delay would overrun it the version is reported FAILED with the last error and the attempt count (… (gave up after N attempts over Ts)); an explicit re-publish of the digest then re-queues it (docs/function-runner-plan.md §6.5). <= 0 behaves as the default.
FC_FUNCTIONS_TRUSTED_PROXIES — — internal/server/functions.go Comma-separated CIDRs or addresses allowed to set X-Forwarded-For on the public entry; invalid entries are logged and ignored.
FC_FN_TRACE_QUEUE 5000 — internal/functions/runner/runner.go Trace records the runner keeps queued for shipping to the platform (docs/function-trace-design.md). When the queue is full the oldest record of the function with the most queued records is dropped and counted (fc_fn_trace_dropped_total); tracing never blocks a call. Only used while a function has a trace window switched on.
FC_FN_TRACE_BODY_BYTES 65536 — internal/functions/runner/runner.go Largest request or response body the built-in http trace context captures per record; longer bodies are cut and flagged bodyTruncated. The capture is shrunk further if the whole record would exceed the platform’s 64 KiB record limit.
FC_FN_TRACE_QUEUE_BYTES 33554432 (32 MiB) — internal/functions/runner/runner.go Memory budget of the queued trace records (their encoded JSON size). When either this or FC_FN_TRACE_QUEUE is exceeded the oldest records of the function with the most queued are dropped and counted in fc_fn_trace_dropped_total. A record with two captured bodies can be about 64 KiB, so size this against the runner task’s memory; at least 1 MiB.

When the runner is the process’s only subsystem (platform, router, scheduler, scheduled jobs, stream, outbox and MCP all off) it also sets the Go memory limit to the reserve, because function guest memory lives outside the Go heap.

fcdev builds its runner configuration itself: it is on by default (--functions / FC_FUNCTIONS_ENABLED=true), binds 127.0.0.1, uses this instance’s own platform with an auto-provisioned fcdev-functions credential, public port 8096 (--functions-public-port), a 256 MiB limit (--functions-memory-mb / FC_FUNCTIONS_MEMORY_LIMIT_MB), a 32 MiB reserve unless FC_FUNCTIONS_MEMORY_RESERVE_MB is set, and the cache under <user-cache-dir>/flowcatalyst/fcdev-functions.

The seeder creates the initial super-admin only when both email and password are set and no anchor user exists yet; otherwise it logs a warning and skips (production must opt in explicitly). fcdev pre-sets admin@flowcatalyst.local / DevPassword123! / Local Admin so the local flow just works (existing env values win) — on fcdev’s own embedded database. With --database-url / FC_DATABASE_URL (an external database) fcdev does not seed that public administrator unless you ask: --seed-dev-admin / FC_DEV_SEED_ADMIN=true (default true embedded, false external; the flag wins over the variable). When it is skipped fcdev logs one line saying so. FLOWCATALYST_BOOTSTRAP_ADMIN_EMAIL / _PASSWORD set by you are honoured on any database. fcdev fresh follows the same rule.

Variable Default Aliases Read in Purpose
FLOWCATALYST_BOOTSTRAP_ADMIN_EMAIL — — internal/platform/seed Initial ANCHOR super-admin email (required together with the password to seed).
FLOWCATALYST_BOOTSTRAP_ADMIN_PASSWORD — — internal/platform/seed Initial super-admin password.
FLOWCATALYST_BOOTSTRAP_ADMIN_NAME Bootstrap Admin — internal/platform/seed Initial super-admin display name.
FC_BOOTSTRAP_ADMIN_EMAIL — — cmd/fcdev fcdev init only: flag default for --admin-email.
FC_BOOTSTRAP_ADMIN_PASSWORD — — cmd/fcdev fcdev init only: flag default for --admin-password (required with --yes).
Variable Default Aliases Read in Purpose
FC_LOG_LEVEL info — internal/logging slog level: debug, warn/warning, error (case-insensitive variants accepted).
FC_DEBUG_ENDPOINTS_ENABLED false (fcdev: true) — internal/server/envcfg.go Mounts the debug surface at <FC_ROUTER_HTTP_PREFIX>/debug/ (or /debug/ when the router is off): net/http/pprof (pprof/goroutine?debug=2 is the full stack dump; ?debug=1 groups stacks and shows each router worker’s pprof labels message_id/group/pool/queue; pprof/profile, pprof/trace, heap, allocs, block, mutex), vars (expvar, with a router entry), and dump (which message or group each worker is on, the held groups, then every goroutine’s stack). Never anonymous: router Basic auth (FC_ROUTER_AUTH_USER/PASS) when configured, otherwise an anchor principal’s platform bearer or session; with neither in the process the surface is not mounted. Independently of this flag, SIGQUIT writes the same dump to stderr and keeps the process running (a second SIGQUIT within 5s restores Go’s default: dump and exit), and the metrics listener’s /metrics carries the Go runtime and process collectors.
FLOWCATALYST_CONFIG_URL — — internal/server/envcfg.go Router pool/queue configuration endpoint(s), comma-separated — the platform serves its own at GET /api/dispatch/router-config on the API listener, authenticated; fcdev defaults this to its own. Unset → the router starts with no queues and no pools. (FC_DEFAULT_BROKER used to synthesise a single fixed queue here; that branch is gone — dev and prod both learn their queues from a served document.)
FC_ROUTER_CLIENT_ID "" — internal/server/envcfg.go OAuth client id the router authenticates to its own platform with, to fetch the router-config document. Must be set together with FC_ROUTER_CLIENT_SECRET and alongside FC_ROUTER_PLATFORM_URL — a half-configured credential is refused at startup. Unset → every config URL is fetched unauthenticated, and a platform-served URL then answers 401.
FC_ROUTER_CLIENT_SECRET "" — internal/server/envcfg.go The matching client secret. The credential is sent only to URLs whose origin matches FC_ROUTER_PLATFORM_URL, so a comma-separated config URL listing third-party config services never receives it.
FC_NOTIFY_WEBHOOK_URL — (log-only) — internal/server/envcfg.go Webhook receiving router stall + backlog warnings.
FC_NOTIFY_MIN_SEVERITY WARNING — internal/server/envcfg.go Floor below which the notifier drops a warning instead of webhooking it (X-04): one of INFO/WARNING/ERROR/CRITICAL, case-insensitive. Empty or unrecognised leaves the WARNING default in place — it can never accidentally widen the floor. Warnings below the floor are still recorded on /warnings; only the webhook delivery is filtered.
FC_ALB_ENABLED false — internal/server/envcfg.go Router ALB self-registration: register this instance on leader-gain / start, deregister on leader-loss / shutdown.
FC_ALB_TARGET_GROUP_ARN — — internal/server/envcfg.go ELBv2 target group to (de)register with.
FC_ALB_TARGET_ID — FC_ALB_INSTANCE_IP internal/server/envcfg.go Target id (this instance’s IP) for RegisterTargets.
FC_ALB_TARGET_PORT 8080 — internal/server/envcfg.go Target port registered with the ALB.
FC_ALB_REGION — (AWS SDK default region chain) — internal/server/envcfg.go AWS region for the ELBv2 client.
FC_ALB_DEREGISTRATION_DELAY_SECONDS 0 — internal/server/envcfg.go Wait after deregistration before shutdown proceeds.
GOMAXPROCS Go default — Go runtime; internal/runtimetune Go’s container-aware default never goes below 2. When this is unset and the cgroup CPU limit (v2 cpu.max, v1 cpu.cfs_quota_us/cpu.cfs_period_us) is at most 1.0 CPU, fc-server calls GOMAXPROCS(1) at start-up; with a larger or no limit (or no cgroup files, e.g. macOS) the default is left alone. Setting it explicitly disables this.
GOGC Go default (100) — Go runtime; internal/runtimetune When set (non-empty), fc-server leaves the GC target and FC_GC_PERCENT entirely alone.
FC_GC_PERCENT unset: 200 when the router or dispatch scheduler is enabled, else Go’s default — internal/runtimetune GC target for fc-server, only consulted when GOGC is unset. A positive integer sets that target (applied whether or not the router/scheduler runs); off disables the percentage trigger (-1, so only the memory limit drives collection); any other value, including 0 and negatives, logs a warning and falls back to the default rule. Higher targets trade memory for throughput (router at 1 CPU: ~714 MB at 200 vs ~522 MB at 100).
GOMEMLIMIT Go default (none) — Go runtime; internal/runtimetune When unset, and fc-server raised or overrode the GC target (above), a soft memory limit of 90% of the cgroup memory limit (v2 memory.max, v1 memory.limit_in_bytes; max/huge = none, in which case nothing is set) is applied so the collector tightens before an OOM-kill. Setting it explicitly disables this.
XDG_DATA_HOME OS app-data dir — cmd/fcdev Overrides the per-user data directory that hosts fcdev’s embedded-Postgres cluster, JWT key and app key.

fcdev seeds its flag defaults from env, reusing the server names — FC_API_PORT, FC_API_BIND, FC_METRICS_PORT, FC_DATABASE_URL, FC_SCHEDULER_ENABLED, FC_STREAM_PROCESSOR_ENABLED, FC_OUTBOX_ENABLED, FC_ROUTER_ENABLED, FC_PUSH_ENABLED, FC_MCP_ENABLED — but with dev-friendly defaults (scheduler/stream/router/push ON, FC_OUTBOX_PLATFORM_URL defaulting to http://localhost:8080 for fcdev outbox). Flags always win over env.

fcdev listens on the local machine only (127.0.0.1 and [::1]) by default, because it seeds a well-known administrator password and honours X-FC-Test-* headers. Widen it with --bind 0.0.0.0 or FC_API_BIND=0.0.0.0 (a warning is logged). Independently of the bind, X-FC-Test-* headers are honoured only for requests whose TCP peer is a loopback address. Variables unique to fcdev:

Variable Default Aliases Read in Purpose
FC_EMBEDDED_DB true — cmd/fcdev Start an embedded Postgres when no --database-url is given.
FC_EMBEDDED_DB_PORT 15432 — cmd/fcdev Embedded Postgres port.
FC_EMBEDDED_DB_PATH <user-data-dir>/flowcatalyst/embedded-pg — cmd/fcdev Embedded Postgres data directory (never /tmp).
FC_EMBEDDED_DB_PASSWORD postgres — cmd/fcdev/embedded.go (--embedded-db-password, the flag wins) Password of the embedded Postgres superuser postgres. Applied when the cluster is first created; a later start with a different password fails with a clear message (fcdev never changes an existing cluster’s password; use the original, or --embedded-db-reset). Printable ASCII, no spaces, quotes or backslashes. Every fcdev command that connects to the embedded database (start, fresh, init, db upgrade) uses it. The default stays postgres/postgres because developers’ own applications connect to the database with that well-known URL, and the server listens on loopback only. A cluster created with a custom password records a salted PBKDF2 check value beside the data directory (db-password.check, mode 0600), never the password.
FC_DEV_SEED_ADMIN embedded: true; --database-url: false — cmd/fcdev/devadmin.go (--seed-dev-admin) Create the built-in admin@flowcatalyst.local administrator (public dev password) when the database has no anchor user. See section 10.
FC_INGESTOR_ENABLED true — cmd/fcdev/start.go (--ingestor) Run the ingestor runtime beside fcdev. Only effective while FC_INGESTION_ENABLED is on. fcdev provisions the fcdev-ingestor credential (role platform:ingestion-runtime, re-secreted and role-reconciled on every start), installs its own Java and starts the runtime jar as a child process. Any failure (offline, no jar) is a log line and fcdev starts without it. See fcdev-ingestor.md.
FC_INGESTOR_PORT 8091 — cmd/fcdev/start.go (--ingestor-port) The runtime’s HTTP_PORT: HTTP ingestions (POST /ingest/...) and /health/live, /health/ready. If the port is taken the ingestor is skipped with a WARN.
FC_INGESTOR_JAR — — cmd/fcdev/ingestor_jar.go Explicit path of the runtime fat jar. Without it fcdev uses a locally built ingestor/ingestor-runtime/target/ingestor-runtime-*-all.jar when run from a checkout (newest), then the pinned release (none is released yet). A path that does not exist is an error (WARN, ingestor skipped). An auto-discovered jar (the checkout search) is used only if the jar, every directory from its own up to the checkout’s ingestor directory (its target directory included) are owned by the current user and not group- or world-writable, and the jar is not a symlink; otherwise it is skipped with one WARN naming the path and reason. On Windows these checks do not apply and discovery is unchanged. The explicit variable is never checked.
FC_INGESTOR_EXTENSIONS_DIR ~/.flowcatalyst/ingestor-extensions — cmd/fcdev/ingestor.go Passed to the runtime as INGEST_EXTENSIONS_DIR (a directory of extension jars). The default is created on start; an extension’s build drops its jar there.
FC_INGESTOR_JRE_DIR <user-cache-dir>/flowcatalyst/fcdev-jre — cmd/fcdev/ingestor_jre.go Where fcdev keeps its own Java installs (jre-<major>/) and, under ingestor-jars/, downloaded release jars. Isolated/test fcdevs set it so they do not share the developer’s cache.
FC_INGESTOR_STATE_DIR <user-data-dir>/flowcatalyst/fcdev-ingestor/api-<api-port> — cmd/fcdev/ingestor.go The runtime’s working directory: the generated config/application.yaml, ingestor.log (truncated on each fcdev start) and ingestor.pid. Per API port, so two fcdevs do not collide.
FC_DEV_UPGRADE_REPO flowcatalyst/flowcatalyst — cmd/fcdev GitHub repo fcdev upgrade pulls releases from (point at a fork). The Linux signature check uses this repository in the expected certificate identity.
FC_PROFILES_PATH <user config dir>/flowcatalyst/profiles.toml — cmd/fcdev/profile_store.go Location of the fcdev profile file (named remote platforms and secret references, never secret values). See fcdev-profiles.md.
FC_PROFILE — — cmd/fcdev/fn_target.go Profile fcdev fn ... uses when --profile is not given. A profile makes FC_PLATFORM_URL, FC_RUNNER_URL, FC_CLIENT_ID and FC_CLIENT_SECRET ignored (with a warning).
FC_PLATFORM_URL, FC_RUNNER_URL, FC_CLIENT_ID, FC_CLIENT_SECRET — — cmd/fcdev/fn_target.go Connection settings for fcdev fn ... against a loopback platform only. A non-loopback FC_PLATFORM_URL without a profile is refused; use fcdev profile add (profile secret_ref may be env:NAME/file:/command: for CI). See fcdev-profiles.md.

The installer scripts (install.sh / install.ps1) additionally honour FC_DEV_VERSION, FC_DEV_INSTALL_DIR, FC_DEV_FORCE and FCDEV_INSECURE_SKIP_CHECKSUM (1 lets an install proceed when the release has no readable SHA-256 sidecar; a mismatch always stops) — shell-side only, documented in the README. fcdev upgrade has the matching --insecure-skip-checksum flag.

13. SDK example programs (not server configuration)

Section titled “13. SDK example programs (not server configuration)”

The runnable examples under pkg/fcsdk/examples/ read their own variables; listed for completeness only.

Variable Default Aliases Read in Purpose
FC_BASE_URL — (required) — pkg/fcsdk/examples Platform base URL for the example clients.
FC_TOKEN — (required by fc-sync / scheduled-jobs-runner; optional in list-event-types) — pkg/fcsdk/examples Static bearer token.
FC_APP — — pkg/fcsdk/examples/list-event-types Application code to query.
FC_ISSUER — — pkg/fcsdk/examples/list-event-types OAuth issuer when minting a token instead of FC_TOKEN.
FC_CLIENT_ID — — pkg/fcsdk/examples/list-event-types OAuth client id for token minting.
FC_CLIENT_SECRET — — pkg/fcsdk/examples/list-event-types OAuth client secret for token minting.
FC_DATABASE_URL — — pkg/fcsdk/examples/order-service, pkg/fcsdk/examples/outbox-sql The example app’s own outbox Postgres URL (same name, different process).
FC_CLIENT_CODE — — pkg/fcsdk/examples/order-service Client identifier slug written as clientCode on the example’s outbox rows.
FC_TEST_DATABASE_URL — (test skipped) — pkg/fcsdk/examples/order-service (its test) Scratch Postgres the example’s test runs against (CI’s go-sdk workflow sets it).