Skip to content

Environment variables

Without these, the backend refuses to start.

VarDefaultNotes
DATABASE_URLPostgres URI. Include ?sslmode=require for managed providers.
POSTGRES_PASSWORDOnly read when using the bundled Postgres container.
REDIS_URLredis://, rediss://, or redis-sentinel://.
JWT_SECRET≥32 chars. Encryption for credential vault also derives from this.

Workforce0 needs at least one AI provider configured, or planner calls will silently fall back to a deterministic stub.

VarNotes
ANTHROPIC_API_KEYClaude via direct API.
OPENAI_API_KEYGPT family via direct API.
GEMINI_API_KEYGemini; free tier works.
VarDefaultNotes
AI_COUNCIL_MODEbest-availablestrict-quorum | majority | best-available
AI_COUNCIL_MIN_PROVIDERS2Quorum cutoff; set 1 to disable council voting.
MODEL_DEFAULT_PLANNERprovider-defaultOverride the chief-of-staff model slug.
SELF_CONSISTENCY_N3Parallel plan drafts; 1 = off.
VarNotes
JIRA_BASE_URLe.g. https://acme.atlassian.net
JIRA_EMAILAtlassian account email.
JIRA_API_TOKENAtlassian API token.
GCHAT_WEBHOOK_URLGoogle Chat incoming webhook URL.
SLACK_BOT_TOKENxoxb-…; required for Slack integration.
SLACK_SIGNING_SECRETverifies Slack → Workforce0 webhook signatures.
TWILIO_ACCOUNT_SIDVoice.
TWILIO_AUTH_TOKENVoice.
TWILIO_PHONE_NUMBERE.164 format.
VarDefaultNotes
CORS_ORIGINSsame-originComma-separated list of allowed origins.
COOKIE_SECURE1 in prod0 for localhost.
COOKIE_SAMESITElaxstrict | lax | none.
RATE_LIMIT_AUTH_PER_MIN20Per-IP login throttle.
RETAIN_RECORDINGS01 keeps meeting audio after transcription.
RETAIN_CALL_AUDIO01 keeps Twilio call audio.
VarNotes
LOG_LEVELdebug | info | warn | error (default info).
LOG_FORMATpretty (dev) | json (prod).
TRACE_SAMPLE_RATE0..1 (OTLP export sampling).
OTEL_EXPORTER_OTLP_ENDPOINTEnable OpenTelemetry traces.
VarDefaultNotes
WORKFORCE0_CRON_ENABLED1Turn off for horizontal backend replicas that shouldn’t own cron.
DIGEST_CRON_HOUR9Local hour to post the daily digest.
DIGEST_TIMEZONEUTCIANA timezone for the cron schedule.
VarDefaultNotes
PLANNER_MONTHLY_BUDGET_TOKENSnoneHard cap; planner falls back to deterministic stub once hit.
AGENT_MONTHLY_BUDGET_TOKENSnonePer-specialist monthly cap.
VarDefaultNotes
FEATURE_VOICE_ENABLED1Gate the voice dial-in endpoint.
FEATURE_PROJECT_GRAPH1Gate project graph build endpoints.
FEATURE_AUTO_BRIEF0Auto-generate briefs on transcript-ready.
  • Backend: backend/src/config/env.ts is a single Zod schema that parses process.env once at boot. Invalid values crash on start.
  • Frontend (Next.js): only NEXT_PUBLIC_* prefixed vars are available at runtime.
  • Agent daemon: its own agent/src/config.ts, narrower surface.
Terminal window
cd backend
npm run env:template > .env.example

This re-exports the Zod schema as a commented .env.example. Use it to stay in sync across upgrades.

  • Commit .env.example, never .env.
  • Rotate keys quarterly. JWT_SECRET rotation logs out every user — schedule it.
  • Managed platforms (Railway, Render, Fly, DO) have secret stores; prefer them over plain env vars where offered.

If you found an env var in the source that isn’t documented above, that’s a docs bug — open an issue.