Skip to content

Configuration

flowline is configured in two places: environment variables for anything secret or per-deployment, and jac.toml for everything else. jac.toml pulls the variables in with ${VAR} interpolation.

How interpolation works

jac.toml references variables such as ${GOOGLE_CLIENT_ID} or ${HOST:-http://localhost:8000}. The runtime resolves them from the process environment when it loads the file:

Reference Variable set (even to "") Variable not set
${VAR} its value the literal text ${VAR} stays in place
${VAR:-fallback} its value fallback

Three consequences worth remembering:

  • The .env file is not read by the runtime. Export it first: set -a; . ./.env; set +a. On jachammer, the project's environment variables play the same role.
  • An exported empty value really is empty. That is what makes the webhook secret refuse to boot when the template is sourced unchanged.
  • A deploy refuses a bare ${VAR} that the pods will not receive (Jac 0.37.18+). On jachammer every key in the project's environment reaches the pods, so set it there; optional values such as the SSO pairs use ${VAR:-}.

Environment variables

Variable Needed for If empty or missing
HOST The public origin, including the scheme (https://flowline.example.com). Becomes the SSO host, the /auth/callback URL and the link preview image URL. Falls back to http://localhost:8000. A value without a scheme breaks the sign-in round trip, and one that is not the origin the app is served from hides the sign-in buttons.
OPENAI_API_KEY The assistant (byLLM reads it from the environment) The app runs; the assistant answers "not available right now" and the server log says why.
LLM_MODEL Choosing the assistant's model gpt-4o-mini
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET Google sign-in The sign-in page shows no Google button.
GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET GitHub sign-in (an OAuth app, not the GitHub App) Same as Google.
GITHUB_APP_ID, GITHUB_APP_SLUG, GITHUB_APP_CLIENT_ID, GITHUB_APP_CLIENT_SECRET, GITHUB_APP_PRIVATE_KEY The GitHub integration The GitHub page says GitHub is not set up on this server instead of failing; GithubStatus names the missing ones.
GITHUB_APP_WEBHOOK_SECRET Verifying signed webhook deliveries Required. Set but empty, the server refuses to boot.
GRAFANA_ADMIN_PASSWORD The Grafana admin in a Kubernetes deploy with monitoring The monitoring stack falls back to a well-known default password.
JAC_SERVE_WORKERS Worker processes for jac run jac.toml says 2; hot-reload mode needs 1.
GITHUB_API_BASE, GITHUB_WEB_BASE Pointing the integration at a stand-in (the CI stub) https://api.github.com and https://github.com
JAC_DB_URL An external Postgres instead of the embedded one The embedded local store
The full .env.example template
# flowline - environment template.
#
# Copy to .env and fill in the values. .env is gitignored; this file is not,
# so it must never contain a real secret.
#
#   cp .env.example .env
#
# jac.toml reads these with ${VAR} interpolation, so the names must match.
#
# Interpolation reads the PROCESS environment, not this file, so export it
# before starting the server or every ${VAR} ships through as a literal:
#
#   set -a; . ./.env; set +a
#   jac run --no-dev main.jac

# --- Where the app is reachable ---------------------------------------------
# Origin of this deployment, INCLUDING the scheme and any port. It becomes the
# SSO host and the /auth/callback URL, so a missing scheme breaks the sign-in
# round trip. Leave empty for local work and jac.toml falls back to
# http://localhost:8000.
#   e.g. HOST=https://flowline.example.com
HOST=

# --- AI assistant (byLLM) ---------------------------------------------------
# Used by the v3 assistant. byLLM reads the provider key from the environment.
OPENAI_API_KEY=

# --- Single sign-on (optional) ----------------------------------------------
# Leave a pair empty to hide that provider's button on the auth page.
# Google: https://console.cloud.google.com/apis/credentials
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

# GitHub: https://github.com/settings/developers
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=

# --- GitHub integration (optional) ------------------------------------------
# A GitHub App, separate from the SSO pair above. SSO only proves who someone
# is; the runtime discards that OAuth token, so reading issues and pull
# requests needs its own credential.
#
# Create one at https://github.com/settings/apps/new
#   Callback URL:      <HOST>/github
#   Setup URL:         <HOST>/github   and tick "Redirect on update"
#   Request user authorization (OAuth) during installation:  ON
#       (this is what proves the installer owns the installation; without it
#        the connect step refuses, because an installation id alone is
#        guessable)
#   Webhook:           Active, URL <HOST>/webhook/GithubEvent, with the
#                      secret below; subscribe to Issues, Pull requests,
#                      Pull request reviews and Sub-issues. Local dev:
#                      GitHub cannot reach localhost,
#                      so tunnel with smee.io and redeliver from the App's
#                      Advanced tab while iterating.
#   Repository permissions: Issues = Read and write, Pull requests = Read,
#                           Metadata = Read
# Then generate a private key. Leave every field below empty to run without
# GitHub: the GitHub page then says it is not set up on this server.
GITHUB_APP_ID=
# The URL slug of the app, from https://github.com/apps/<slug>
GITHUB_APP_SLUG=
# From the app's own OAuth credentials, NOT the SSO pair above.
GITHUB_APP_CLIENT_ID=
GITHUB_APP_CLIENT_SECRET=
# The generated .pem. Either base64 it into one line (recommended):
#   GITHUB_APP_PRIVATE_KEY=$(base64 -i your-app.private-key.pem | tr -d '\n')
# or paste the PEM with literal \n escapes between the lines.
GITHUB_APP_PRIVATE_KEY=
# The webhook secret set on the App. Deliveries are verified against it
# before any code runs; leave it empty and every delivery is refused.
GITHUB_APP_WEBHOOK_SECRET=

# --- Monitoring (optional) --------------------------------------------------
# Only needed when deploying the Kubernetes Grafana stack; the /metrics
# endpoint itself needs nothing here. Set it rather than accepting the
# built-in default, which is a well-known password.
GRAFANA_ADMIN_PASSWORD=

# --- PR review service -------------------------------------------------------
# Signs the web app's calls to the review service when no user is behind them
# (the scheduled runner). Any long random string, the same on every pod:
#   JAC_BRIDGE_TOKEN=$(openssl rand -hex 32)
# Set it before the deploy that ships it: a pod reads it once, at start.
JAC_BRIDGE_TOKEN=

# --- AI agents: the workspace's own model keys --------------------------------
# Seals each workspace's saved model key at rest. Any long random string, the
# same on every pod and never changed afterwards (a key sealed with another
# value cannot be opened and must be saved again):
#   FLOWLINE_SECRETS_KEY=$(openssl rand -hex 32)
# Empty: the Models and keys page cannot save a key.
FLOWLINE_SECRETS_KEY=

# jac.toml serves two workers per pod; `jac run` dev mode (HMR) is
# single-process and refuses that count, so local runs pin one worker.
JAC_SERVE_WORKERS=1

jac.toml, table by table

[project]
name = "flowline", kind = "web-app", entry-point = "main" (the dotted module name; Jac 0.37.12+ refuses "main.jac") and the exact jac-version pin. Keep the app declared here: an [apps.<name>] table makes deploys skip the client bundle. See Production configuration.
[dependencies], [dependencies.npm]
Python and npm packages that jac install fetches.
[jac-shadcn], [client.vite], [client.app_meta_data]
The UI kit's style and theme, the Tailwind Vite plugin, and the page title, description, theme colour, icon and link preview tags (og_*, twitter_*, with assets/brand/og-image.png as the image) the client shell ships with.
[byllm], [byllm.model], [byllm.call_params]
The assistant's system prompt (answer only from the snapshot, never invent people or dates), the model (${LLM_MODEL:-gpt-4o-mini}), and a low temperature with output retries.
[serve.workers]
count = "2" worker processes per app pod. Keep it equal to the cores in cpu_limit, and never "auto" (it resolves on the deploying machine).
[scale.sso], [scale.sso.google], [scale.sso.github]
The SSO host and client callback (both from HOST) and each provider's client id and secret (${VAR:-}, so an unset pair is empty and its button stays hidden).
[scale.monitoring]
Off (enabled = false): jachammer refuses a deploy whose app runs its own monitoring. On, it gives /metrics, per-walker metrics and a Prometheus plus Grafana pair in the namespace; k8s_metrics_enabled = false keeps a node-exporter DaemonSet off a shared cluster.
[scale.kubernetes]
App pod sizing and autoscaling: CPU 1000m to 2000m, memory 4Gi to 6Gi, 2 to 6 replicas at 70% CPU.
[scale.gateway], [scale.gateway.hpa], [scale.gateway.logs]
The gateway pod in front of the app: a 120 second forward timeout, its own smaller sizing, 1 to 2 replicas, and log shipping off.
[scale.webhook]
github_secret (from GITHUB_APP_WEBHOOK_SECRET) and a 2 MiB body cap for GitHub deliveries.
[placement], [placement.pins]
default = "server", plus a "server" pin for models and every services.* module and three "client" pins for lib.utils helpers. A new service module needs its own pin line. See Jac gotchas.

Something may rewrite jac.toml behind you

A workspace tool (most likely an editor's Jac language server) has been seen rewriting jac.toml minutes after an edit and stripping its comments. Commit a jac.toml change promptly and re-check the diff before you push.