Skip to content

Environment Variables

FlowVane can be configured entirely through environment variables. Each variable maps to a YAML config key with the FLOWVANE_ prefix.

The matching APFLOW_ setting is read only when its FLOWVANE_ counterpart is unset. FlowVane also searches the old YAML and SQLite paths when the new files are absent.

Configuration Priority

Defaults → flowvane.yaml → Environment Variables (highest priority)

Core Variables

Variable Config Key Default Description
FLOWVANE_CONFIG — — Explicit path to config YAML file
FLOWVANE_API_SERVER_URL api.server_url None Remote API server URL (used by API-gateway clients; the scheduler no longer has an API mode — it runs in-process)
FLOWVANE_API_TIMEOUT api.timeout 30.0 API request timeout (seconds)
FLOWVANE_API_RETRY_ATTEMPTS api.retry_attempts 3 API retry attempts
FLOWVANE_API_RETRY_BACKOFF api.retry_backoff 1.0 Initial retry backoff (seconds)

Authentication (JWT)

These configure the JWT Bearer auth shared by the REST, A2A, and MCP servers (enabled per server with --auth). The same token validates on every surface. See REST / HTTP API → Authentication.

Variable Config Key Default Description
FLOWVANE_API_JWT_SECRET api.jwt_secret None Shared secret for symmetric algorithms (HS256/384/512). Use ≥32 bytes in production.
FLOWVANE_API_JWT_ALGORITHM api.jwt_algorithm HS256 Allowed algorithm(s); comma-separated for multiple (e.g. RS256,RS512)
FLOWVANE_API_JWT_PUBLIC_KEY api.jwt_public_key None PEM public key for asymmetric algorithms (RS/ES/PS*); used to verify tokens
FLOWVANE_API_JWT_PUBLIC_KEY_PATH api.jwt_public_key_path None Path to a PEM public-key file (alternative to inline jwt_public_key)
FLOWVANE_API_JWT_AUDIENCE api.jwt_audience None Expected aud claim (optional)
FLOWVANE_API_JWT_ISSUER api.jwt_issuer None Expected iss claim (optional)

HS256 vs RS256. Symmetric (HS) verifies with jwt_secret. Asymmetric (RS/ES/PS) verifies with the public key — set jwt_algorithm=RS256 and provide jwt_public_key (or _path); the private key signs tokens elsewhere and is never needed by the servers.

Storage

Variable Config Key Default Description
DATABASE_URL — SQLite file Database connection string. Takes precedence over FLOWVANE_DATABASE_URL.
FLOWVANE_DATABASE_URL — — Alternative to DATABASE_URL.
FLOWVANE_STORAGE_DIALECT storage.dialect sqlite Not consumed by the storage factory at runtime. The dialect is inferred automatically from the connection string scheme (postgresql:// → PostgreSQL, sqlite:// → SQLite). This key is only meaningful in flowvane.yaml for documentation purposes.
FLOWVANE_STORAGE_PATH storage.path computed Not consumed by the storage factory at runtime. The SQLite file path is computed dynamically by internal project-aware path resolution (prefers <project-root>/.data/flowvane.db; falls back to ~/.apstack/data/flowvane.db). Set DATABASE_URL or FLOWVANE_DATABASE_URL to an explicit sqlite:///... URL to control the path.
FLOWVANE_MAX_SESSIONS — 50 Maximum concurrent pooled sessions (SessionPoolManager). Requests beyond this limit receive a SessionLimitExceeded error.
FLOWVANE_SESSION_TIMEOUT — 1800 Idle session timeout in seconds (30 minutes). Expired sessions are cleaned up on the next pool access.

Governance

Variable Config Key Default Description
FLOWVANE_GOVERNANCE_DEFAULT_POLICY governance.default_policy None Default cost policy name
FLOWVANE_GOVERNANCE_DOWNGRADE_CHAIN governance.downgrade_chain [] Comma-separated model names

Durability

Variable Config Key Default Description
FLOWVANE_DURABILITY_MAX_ATTEMPTS durability.max_attempts 3 Default retry attempts
FLOWVANE_DURABILITY_BACKOFF_STRATEGY durability.backoff_strategy exponential fixed/exponential/linear
FLOWVANE_DURABILITY_CIRCUIT_BREAKER_THRESHOLD durability.circuit_breaker_threshold 5 Consecutive failures to trip breaker

Distributed

Variable Default Description
FLOWVANE_CLUSTER_ENABLED false Enable distributed mode
FLOWVANE_NODE_ROLE auto Node role (auto/leader/worker/observer)
FLOWVANE_NODE_ID auto-generated Unique node identifier
FLOWVANE_MAX_PARALLEL_TASKS 4 Max concurrent task executions per node
FLOWVANE_LEADER_LEASE 30 Leader lease duration (seconds). The leader must renew before this expires or it loses leadership.
FLOWVANE_LEADER_RENEW 10 Leader renewal interval (seconds). Must be less than FLOWVANE_LEADER_LEASE.
FLOWVANE_LEASE_DURATION 30 Task lease duration (seconds). A worker must complete or renew its task claim within this window.
FLOWVANE_LEASE_CLEANUP_INTERVAL 10 Interval (seconds) between expired task lease cleanup runs.
FLOWVANE_POLL_INTERVAL 5 Worker poll interval (seconds). How often a worker checks for new tasks.
FLOWVANE_HEARTBEAT_INTERVAL 10 Node heartbeat interval (seconds). Nodes publish a heartbeat at this rate.
FLOWVANE_NODE_STALE_THRESHOLD 30 Seconds without a heartbeat before a node is considered stale.
FLOWVANE_NODE_DEAD_THRESHOLD 120 Seconds without a heartbeat before a node is considered dead and its tasks are reclaimed.

YAML Config File

Place flowvane.yaml in your project root or ~/.apstack/flowvane/:

api:
  server_url: http://localhost:8000
  timeout: 60.0
  # HS256 (symmetric): one shared secret signs and verifies.
  jwt_secret: ${FLOWVANE_API_JWT_SECRET}  # env var reference
  jwt_algorithm: HS256
  # RS256 (asymmetric): set algorithm + public key; the private key signs elsewhere.
  # jwt_algorithm: RS256
  # jwt_public_key_path: /etc/flowvane/jwt_public.pem

storage:
  dialect: sqlite
  path: .data/flowvane.db

governance:
  default_policy: auto-downgrade
  downgrade_chain:
    - claude-opus-4
    - claude-sonnet-4
    - claude-haiku-4

durability:
  max_attempts: 5
  backoff_strategy: exponential
  circuit_breaker_threshold: 10