Server and worker settings

Every Flux server, database, scheduling, workers, security, and observability option in tabular form, with defaults and env var equivalents.

The canonical option lookup for Flux 0.56.0. Every field on FluxConfig and its nested models appears below with its type, default, env var, and one-line purpose. For operator deployment context see Server configuration; this page is the field-by-field reference.

Server

Top-level fields under [flux]. Env vars use a single underscore — FLUX_SERVER_HOST, not FLUX_SERVER__HOST.

FieldTypeDefaultEnv varPurpose
debugboolfalseFLUX_DEBUGEnable debug mode.
log_levelstr"INFO"FLUX_LOG_LEVELLogging level.
log_formatstr"%(asctime)s - %(name)s - %(levelname)s - %(message)s"FLUX_LOG_FORMATLog message format.
log_date_formatstr"%Y-%m-%d %H:%M:%S"FLUX_LOG_DATE_FORMATDate format in log messages.
server_hoststr"localhost"FLUX_SERVER_HOSTServer bind address.
server_portint8000FLUX_SERVER_PORTServer bind port.
homestr".flux"FLUX_HOMEFlux home directory. Bootstrap token and default SQLite DB live here.
cache_pathstr".cache"FLUX_CACHE_PATHCache directory path.
local_storage_pathstr".data"FLUX_LOCAL_STORAGE_PATHLocal storage directory path.
serializer"json" | "pkl""pkl"FLUX_SERIALIZERDefault serializer. Any other value raises ValueError at load.

Database

Top-level fields, also under [flux]. database_url accepts ${VAR} and $VAR interpolation.

FieldTypeDefaultEnv varPurpose
database_urlstr"sqlite:///.flux/flux.db"FLUX_DATABASE_URLSQLAlchemy URL. Supports env-var interpolation.
database_type"sqlite" | "postgresql""sqlite" (inferred from URL prefix)FLUX_DATABASE_TYPEBackend type. Auto-set to postgresql when database_url starts with postgresql://.
database_pool_sizeint20FLUX_DATABASE_POOL_SIZEConnection pool size (PostgreSQL only).
database_max_overflowint20FLUX_DATABASE_MAX_OVERFLOWMaximum pool overflow (PostgreSQL only).
database_executor_threadsint16FLUX_DATABASE_EXECUTOR_THREADSServer thread pool for blocking database calls. Keep at or below the pool size so threads never block waiting for a connection; 0 uses the asyncio default executor.
database_pool_timeoutint (seconds)30FLUX_DATABASE_POOL_TIMEOUTConnection acquisition timeout.
database_pool_recycleint (seconds)3600FLUX_DATABASE_POOL_RECYCLEConnection recycle interval.
database_health_check_intervalint (seconds)300FLUX_DATABASE_HEALTH_CHECK_INTERVALPool health-check interval.

Workers

Under [flux.workers]. Nested — env vars use double underscore.

FieldTypeDefaultEnv varPurpose
bootstrap_tokenstr | NoneNone (server auto-generates)FLUX_WORKERS__BOOTSTRAP_TOKENToken workers present to POST /workers/register. Required on workers; server persists an auto-generated one to <home>/bootstrap-token if unset.
server_urlstr"http://localhost:8000"FLUX_WORKERS__SERVER_URLServer URL workers connect to.
default_timeoutint (seconds)0FLUX_WORKERS__DEFAULT_TIMEOUTDefault task timeout. 0 means no timeout.
http_timeoutint (seconds)30FLUX_WORKERS__HTTP_TIMEOUTTimeout for worker HTTP calls to the server. 0 disables.
checkpoint_retry_max_delayint (seconds)30FLUX_WORKERS__CHECKPOINT_RETRY_MAX_DELAYBackoff cap between checkpoint send retries.
terminal_checkpoint_deadlineint (seconds)300FLUX_WORKERS__TERMINAL_CHECKPOINT_DEADLINEMax time to keep retrying a terminal (finished-state) checkpoint before giving up and leaving the execution to the server reaper.
retry_attemptsint3FLUX_WORKERS__RETRY_ATTEMPTSDefault retry attempts for failed tasks.
retry_delayint (seconds)1FLUX_WORKERS__RETRY_DELAYInitial delay between retries.
retry_backoffint2FLUX_WORKERS__RETRY_BACKOFFRetry-delay multiplier.
heartbeat_intervalint (seconds)10FLUX_WORKERS__HEARTBEAT_INTERVALSeconds between server ping events.
heartbeat_timeoutint (seconds)30FLUX_WORKERS__HEARTBEAT_TIMEOUTSeconds before a worker is considered stale.
reconnect_max_delayint (seconds)60FLUX_WORKERS__RECONNECT_MAX_DELAYMax backoff cap for worker reconnect.
eviction_grace_periodint (seconds)30FLUX_WORKERS__EVICTION_GRACE_PERIODWait after marking worker stale before evicting.
offline_ttlint (seconds)7200FLUX_WORKERS__OFFLINE_TTLHow long offline workers are kept in memory before pruning.
module_cache_ttlint (seconds)300FLUX_WORKERS__MODULE_CACHE_TTLCompiled-workflow-module cache TTL. 0 disables caching.
module_cache_max_sizeint64FLUX_WORKERS__MODULE_CACHE_MAX_SIZELRU bound on cached workflow modules; least-recently-used entries are evicted beyond it. 0 = unbounded (legacy behavior).
runnerslist[str]["inprocess", "subprocess"]FLUX_WORKERS__RUNNERSRunners enabled on this worker, advertised at registration. Workflows declaring runner=... only dispatch to workers advertising it. Set as JSON array.
default_runnerstr"subprocess"FLUX_WORKERS__DEFAULT_RUNNERRunner used when a workflow does not declare one.
subprocess_term_gracefloat (seconds)10.0FLUX_WORKERS__SUBPROCESS_TERM_GRACEWait after SIGTERM for a runner child to finish cancellation handling before SIGKILL.
subprocess_memory_limitint (bytes)0FLUX_WORKERS__SUBPROCESS_MEMORY_LIMITAddress-space limit per runner child (Linux only). 0 = unlimited.
docker_imagestr""FLUX_WORKERS__DOCKER_IMAGEImage the docker runner launches per execution; must have flux-core at a worker-compatible version. Required when "docker" is in runners.
docker_networkstr""FLUX_WORKERS__DOCKER_NETWORKDocker network for runner containers. Empty = docker default.
docker_memorystr""FLUX_WORKERS__DOCKER_MEMORYPer-container memory limit, docker syntax (e.g. "512m"). Empty = unlimited.
docker_cpusfloat0.0FLUX_WORKERS__DOCKER_CPUSPer-container CPU limit (docker --cpus). 0 = unlimited.
docker_extra_argslist[str][]FLUX_WORKERS__DOCKER_EXTRA_ARGSExtra docker run arguments (volumes, env vars, --user, …). Set as JSON array.
loop_lag_thresholdfloat (seconds)1.0FLUX_WORKERS__LOOP_LAG_THRESHOLDEvent-loop lag beyond which a self-health probe counts as a breach; three consecutive breaches mark the worker unhealthy (it declines new work and advertises the state on heartbeats until three clean probes). 0 disables self-health monitoring.
loop_lag_probe_intervalfloat (seconds)1.0FLUX_WORKERS__LOOP_LAG_PROBE_INTERVALSeconds between event-loop lag probes.
metrics_providerstr | NoneNoneFLUX_WORKERS__METRICS_PROVIDERDotted path ("package.module:callable") to a sync or async callable returning dict[str, float]. The worker advertises the snapshot on heartbeat pongs; routing policies read it through metric(...) selectors.
metrics_intervalfloat (seconds)10.0FLUX_WORKERS__METRICS_INTERVALSeconds between metrics-provider refreshes.
builtin_metricsbooltrueFLUX_WORKERS__BUILTIN_METRICSPublish the built-in flux.* worker metrics (loop lag, load, failure/crash rates, durations, CPU/memory, …) on heartbeats so routing policies can rank on them without a metrics_provider.
transient_fast_pathbooltrueFLUX_WORKERS__TRANSIENT_FAST_PATHExecute call() targets that are transient workflow objects in-process on the same worker (the mesh fast path). Disable to force every call() through the server.
max_concurrent_executionsint16FLUX_WORKERS__MAX_CONCURRENT_EXECUTIONSCapacity the worker advertises at registration; the server never assigns beyond it. 0 = unlimited (legacy behavior).
drain_timeoutint (seconds)60FLUX_WORKERS__DRAIN_TIMEOUTHow long a stopping worker waits for running executions to finish before cancelling them. 0 = cancel immediately.
register_rate_limitstr"30/minute"FLUX_WORKERS__REGISTER_RATE_LIMITPer-client-IP rate limit for POST /workers/register (slowapi syntax). Empty string disables. Raise for large fleets restarting behind a shared NAT.

Dispatch

Under [flux.dispatch]. Server-side execution dispatch — see Dispatch modes for when to switch off the default.

FieldTypeDefaultEnv varPurpose
mode"poll" | "event""poll"FLUX_DISPATCH__MODEDispatch strategy. poll is the legacy per-worker query loop (~5 queries per worker per 0.5 s); event runs one dispatcher task per replica that batch-claims on wakeups (LISTEN/NOTIFY on PostgreSQL) — the scalable mode for large fleets.
batch_sizeint64FLUX_DISPATCH__BATCH_SIZEMax executions claimed per dispatcher wakeup (event mode).
fallback_intervalfloat (seconds)15.0FLUX_DISPATCH__FALLBACK_INTERVALDispatcher safety-net tick (event mode); covers missed notifications, which are wakeups only and carry no data.

Retention

Under [flux.retention]. Execution-history cleanup — see Retention for semantics.

FieldTypeDefaultEnv varPurpose
enabledboolfalseFLUX_RETENTION__ENABLEDDelete terminal executions (and their events/approvals/sessions) older than retention_days. Off by default so upgrades never silently remove history; enable in production or the executions tables grow without bound.
retention_daysint30FLUX_RETENTION__RETENTION_DAYSAge (days since last event) after which terminal executions are deleted.
sweep_intervalint (seconds)3600FLUX_RETENTION__SWEEP_INTERVALSeconds between retention sweeps.
batch_sizeint500FLUX_RETENTION__BATCH_SIZEExecutions deleted per transaction during a sweep.

Scheduling

Under [flux.scheduling]. The scheduler runs in-process inside the server.

FieldTypeDefaultEnv varPurpose
poll_intervalfloat (seconds)30.0FLUX_SCHEDULING__POLL_INTERVALHow often the scheduler polls for due schedules.
schedule_check_tolerancefloat (seconds)1.0FLUX_SCHEDULING__SCHEDULE_CHECK_TOLERANCETolerance for cron schedule matching.
once_schedule_tolerancefloat (seconds)60.0FLUX_SCHEDULING__ONCE_SCHEDULE_TOLERANCETolerance for one-time schedule matching.
auto_schedule_enabledbooltrueFLUX_SCHEDULING__AUTO_SCHEDULE_ENABLEDAuto-create schedules from @workflow.with_options(schedule=...).
auto_schedule_suffixstr"_auto"FLUX_SCHEDULING__AUTO_SCHEDULE_SUFFIXSuffix appended to auto-created schedule names.

Security

Top-level fields under [flux.security]. Encryption and auth live in their own sub-tables.

FieldTypeDefaultEnv varPurpose
execution_token_secretstr | NoneNone (required in production)FLUX_SECURITY__EXECUTION_TOKEN_SECRETHMAC secret for signing execution tokens.
execution_token_ttlint (seconds)86400 (24 hours; earlier releases defaulted to 7 days)FLUX_SECURITY__EXECUTION_TOKEN_TTLExecution-token lifetime. The token is scoped to a single execution and minted fresh on every dispatch and resume, so it only needs to outlive one continuous run.

Provider validation order on the server is ExecutionToken → OIDC → API key: each incoming request is checked against the execution-token provider first, then OIDC, then API key.

Encryption

Under [flux.security.encryption]. The encryption key is a passphrase fed to PBKDF2 (SHA-256, 1,000,000 iterations) — Flux does not hex-decode or base64-decode the value.

FieldTypeDefaultEnv varPurpose
encryption_keystr | NoneNone (required for secrets store)FLUX_SECURITY__ENCRYPTION__ENCRYPTION_KEYMaster passphrase for encrypting secrets and configs at rest.

Auth

Under [flux.security.auth]. The master switch; provider-specific config lives in the OIDC and API-key sub-tables below.

FieldTypeDefaultEnv varPurpose
enabledboolfalseFLUX_SECURITY__AUTH__ENABLEDMaster switch for authentication. Enabling a provider forces this on; enabling it with no provider configured is rejected at startup.
resolution_cache_ttlfloat (seconds)30.0FLUX_SECURITY__AUTH__RESOLUTION_CACHE_TTLPer-process cache for token-to-identity and principal-to-permissions resolution (0 disables). Mutations invalidate the local replica immediately; other replicas converge within the TTL, so a revoked credential can remain usable there for up to this long — keep it short.
allow_anonymousboolfalseFLUX_SECURITY__AUTH__ALLOW_ANONYMOUSWhen auth is disabled, must be true to permit anonymous state-changing requests (POST/PUT/PATCH/DELETE). No effect when auth is enabled.

OIDC

Under [flux.security.auth.oidc].

FieldTypeDefaultEnv varPurpose
enabledboolfalseFLUX_SECURITY__AUTH__OIDC__ENABLEDToggle OIDC auth.
issuerstr""FLUX_SECURITY__AUTH__OIDC__ISSUEROIDC issuer URL.
audiencestr""FLUX_SECURITY__AUTH__OIDC__AUDIENCEExpected audience claim.
roles_claimstr"roles"FLUX_SECURITY__AUTH__OIDC__ROLES_CLAIMDeprecated. Flux reads roles from the principals registry, not the token.
jwks_cache_ttlint (seconds)3600FLUX_SECURITY__AUTH__OIDC__JWKS_CACHE_TTLJWKS-key cache lifetime.
clock_skewint (seconds)30FLUX_SECURITY__AUTH__OIDC__CLOCK_SKEWLeeway for exp/nbf claims.
default_user_roleslist[str][]FLUX_SECURITY__AUTH__OIDC__DEFAULT_USER_ROLESRoles auto-granted to a new OIDC user. Set as JSON array.

API keys

Under [flux.security.auth.api_keys]. Keys themselves are managed via flux principals.

FieldTypeDefaultEnv varPurpose
enabledboolfalseFLUX_SECURITY__AUTH__API_KEYS__ENABLEDToggle API-key auth.
worker_key_ttlint (seconds)604800 (7 days)FLUX_SECURITY__AUTH__API_KEYS__WORKER_KEY_TTLLifetime of API keys minted for workers at registration (0 = never expire). Workers re-register automatically on the first 401 after expiry, so keys rotate without operator action.

Observability

Under [flux.observability]. The OpenTelemetry pipeline runs only when enabled and the observability extra is installed.

FieldTypeDefaultEnv varPurpose
enabledboolfalseFLUX_OBSERVABILITY__ENABLEDMaster toggle for OTel.
service_namestr"flux"FLUX_OBSERVABILITY__SERVICE_NAMEOTel service.name resource attribute.
otlp_endpointstr | NoneNoneFLUX_OBSERVABILITY__OTLP_ENDPOINTOTLP collector endpoint (e.g. http://localhost:4317).
otlp_protocol"grpc" | "http""grpc"FLUX_OBSERVABILITY__OTLP_PROTOCOLOTLP exporter protocol: grpc or http (HTTP/protobuf).
prometheus_enabledbooltrueFLUX_OBSERVABILITY__PROMETHEUS_ENABLEDExpose /metrics for Prometheus scraping.
trace_sample_ratefloat (0.0–1.0)1.0FLUX_OBSERVABILITY__TRACE_SAMPLE_RATETrace sampling rate.
metric_export_intervalint (seconds)60FLUX_OBSERVABILITY__METRIC_EXPORT_INTERVALOTLP metric push interval.
resource_attributesdict[str, str]{}FLUX_OBSERVABILITY__RESOURCE_ATTRIBUTESExtra OTel resource attributes. Set as JSON object.

MCP

Under [flux.mcp]. Configures the MCP server started by flux start mcp.

FieldTypeDefaultEnv varPurpose
namestr"flux-workflows"FLUX_MCP__NAMEMCP server name advertised to clients.
hoststr"localhost"FLUX_MCP__HOSTBind address.
portint8080FLUX_MCP__PORTBind port.
server_urlstr"http://localhost:8000"FLUX_MCP__SERVER_URLFlux server URL the MCP server proxies to.
transport"stdio" | "streamable-http" | "sse""streamable-http"FLUX_MCP__TRANSPORTMCP transport protocol.

Two cross-cutting notes

auth.enabled and the providers. auth.enabled is a real settable field ([flux.security.auth] enabled = true, or FLUX_SECURITY__AUTH__ENABLED). Enabling either provider ([flux.security.auth.oidc] or [flux.security.auth.api_keys]) forces auth.enabled to true. Setting auth.enabled = true with no provider configured is rejected at startup — auth needs at least one provider to validate against.

${VAR} interpolation. A field validator on database_url expands ${VAR} and $VAR references from the process environment at load time. Unresolved references are left literal. This is the only field that does interpolation; other string fields take env values directly via FLUX_*.

See also