Skip to content

Environment Variables Reference

Environment Variables Reference

All variables are loaded from the .env file in the project root. Copy .env.example to get started.

Server

VariableDefaultRequiredPurpose
SERVER_PORT4454NoHTTP server listen port
CHANNEL_PORT_RANGE7701-7799NoPort range allocated to HTTP/WS/MCP channel runtimes (one port per active channel)
API_URLhttp://localhost:4454/api/YesBase URL used internally for self-referencing API calls
FRONTEND_URLhttp://localhost:3000/NoFrontend origin (used for CORS and redirect generation)
ALLOWED_ORIGINS(empty)NoComma-separated list of allowed CORS origins
COOKIE_DOMAIN(empty)NoCookie domain for session cookies (set for multi-subdomain deployments)

Database

VariableDefaultRequiredPurpose
MONGODB_URImongodb://mongo:27017YesMongoDB connection string
MONGODB_DBudYesMongoDB database name

Encryption

flow8 uses NaCl SecretBox with Argon2id key derivation. Both keys must be set and have exact lengths.

VariableDefaultRequiredFormatPurpose
ENV_KEY_SALT(none)Yes64 hex chars (32 bytes)Salt for Argon2 key derivation
ENC_KEY_SECRET(none)Yes256 hex chars (128 bytes)Secret input for Argon2 key derivation
ENC_KEY_P_N32768NoIntegerArgon2 N parameter (memory cost)
ENC_KEY_P_R8NoIntegerArgon2 R parameter (block size)
ENC_KEY_P_P1NoIntegerArgon2 P parameter (parallelism)
ENC_KEY_LEN32NoIntegerDerived key length in bytes

Generate keys:

Terminal window
openssl rand -hex 32 # → ENV_KEY_SALT (64 chars)
openssl rand -hex 128 # → ENC_KEY_SECRET (256 chars)

Authentication

VariableDefaultRequiredPurpose
EXTERNAL_JWT_SECRET(none)NoJWT HS256 secret for external API token validation
MCP_JWT_SECRET(none)NoJWT HS256 secret for MCP server authentication

Microsoft OAuth2

VariableDefaultRequiredPurpose
MICROSOFT_CLIENT_ID(none)If using MS authAzure AD app client ID
MICROSOFT_CLIENT_SECRET(none)If using MS authAzure AD app client secret
MICROSOFT_SCOPEoffline_access https://graph.microsoft.com/User.Read ...If using MS authOAuth2 scopes requested

Retention Policies

VariableDefaultRequiredPurpose
RETENTION_CLEANUP_INTERVAL2mNoHow often the cleanup job runs (Go duration string: 2m, 5m, 1h)
RETENTION_CLEANUP_BATCH_SIZE500NoMax records deleted per cleanup run
RETENTION_DEFAULT_CADENCE30dNoDefault retention duration for flow executions
RETENTION_DEFAULT_ENTRIES100NoDefault max execution records to keep per flow
RETENTION_ENFORCED_MIN_FLOWS_ENTRIES10NoMinimum execution records that can never be deleted
RETENTION_ENFORCED_MIN_FLOWS_ALL_CADENCE0NoMinimum cadence enforced for all-flow retention (0 = no minimum)
RETENTION_ENFORCED_MIN_FLOWS_FILTERED_CADENCE3dNoMinimum cadence for filtered-flow retention
RETENTION_ENFORCED_MIN_AUDIT_CADENCE14dNoAudit logs are never deleted before this duration

Alert Email

VariableDefaultRequiredPurpose
ALERT_EMAIL_FROM(none)If using alertsFrom address for alert emails
ALERT_EMAIL_HOST(none)If using alertsSMTP host
ALERT_EMAIL_PORT(none)If using alertsSMTP port
ALERT_EMAIL_USER(none)If using alertsSMTP auth username
ALERT_EMAIL_PASS(none)If using alertsSMTP auth password

AI

VariableDefaultRequiredPurpose
OPENAI_API_KEY(none)If using OpenAIOpenAI API key for AI modules and flow generation

Capabilities

These flags enable/disable features that depend on native system binaries:

VariableDefaultPurpose
CAPS_STORAGEtrueEnable local file storage
CAPS_SOFFICEtrueEnable LibreOffice document conversion
CAPS_TESSERACTtrueEnable Tesseract OCR
CAPS_MAGICKtrueEnable ImageMagick image processing

Set to false to disable a capability if the binary is not installed.

Output & Display

VariableDefaultPurpose
UNIT_OUTPUT_UI_MAX_BYTES(unlimited)Maximum bytes of module output displayed in the UI per field
AUDIT_LOG_FIELD_MAX_BYTES(unlimited)Maximum bytes of any single field stored in audit logs (prevents huge payloads)

Application Registration

VariableDefaultPurpose
APPS_AUTOCREATEtrueAuto-register new modules in the apps catalog on startup
APPS_FORCEUPDATEfalseForce re-registration of all modules on startup (useful after module changes)

Docker / Compose (Dev Only)

VariableDefaultPurpose
COMPOSE_FILEdocker-compose.dev.ymlWhich compose file to use
DEV_APP_PORT8000Host port for app in dev compose
DEV_MONGO_PORT27017Host port for MongoDB in dev compose
DEV_MEXPRESS_PORT8081Host port for MongoDB Express UI

Build-time (Go Module Access)

VariablePurpose
GOPRIVATEPrivate Go module paths (e.g., git.qix.sx/gorgany/gorgany.git)
GIT_HOSTGit host for private module auth
GIT_USERGit username
GIT_PASSGit personal access token
GOPROXYGo module proxy (use https://goproxy.cn if direct access to proxy.golang.org is blocked)