> ## Documentation Index
> Fetch the complete documentation index at: https://docs.servflow.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration Reference

> Every TOML option and environment variable for a ServFlow Pro instance

ServFlow is an agent builder: you define AI agents and the workflows they run, and a Go engine serves them. The instance itself — ports, storage, authentication, tracing — is configured with a single TOML file passed to `servflow-pro start --config`.

This page is the complete reference for that file. For installing the binary see [Installation](/installation); for what an agent *is*, see [Agents](/concepts/agents).

<Tip>
  Every option can also be set with an environment variable. Environment variables take precedence over the TOML file, which makes them convenient for containers and CI.
</Tip>

## Minimal configuration

Only `server.config_folder` is required. Everything else has a working default:

```toml theme={null}
[server]
config_folder = "./configs"
```

Start the instance with:

```bash theme={null}
servflow-pro start --config config.toml
```

## `[server]`

Controls how the process is hosted. **One port serves everything.** The workflow engine owns the root path, so a workflow listening on `/hello` answers at `http://localhost:8080/hello`. When you pass `--dashboard`, the builder UI is mounted under `/dashboard` on this same port — there is no second port.

```toml theme={null}
[server]
port = "8080"
config_folder = "./configs"
engine_config_file = "./integrations.yaml"
env = "production"
```

| Field                | Environment variable                 | Default      | Description                                                       |
| -------------------- | ------------------------------------ | ------------ | ----------------------------------------------------------------- |
| `port`               | `SERVFLOW_SERVER_PORT`               | `8080`       | Port serving the engine, the API, and (with `--dashboard`) the UI |
| `config_folder`      | `SERVFLOW_SERVER_CONFIG_FOLDER`      | —            | **Required.** Directory holding workflow configuration files      |
| `engine_config_file` | `SERVFLOW_SERVER_ENGINE_CONFIG_FILE` | —            | Path to the engine integrations YAML file                         |
| `env`                | `SERVFLOW_SERVER_ENV`                | `production` | Environment mode: `production` or `development`                   |

## `[sqlite]`

Persistent storage for agents, workflow configs, secrets, integrations, and user accounts.

```toml theme={null}
[sqlite]
path = "./secrets.db"
master_key = ""
```

| Field        | Environment variable         | Default | Description                                                                            |
| ------------ | ---------------------------- | ------- | -------------------------------------------------------------------------------------- |
| `path`       | `SERVFLOW_SQLITE_PATH`       | —       | Path to the SQLite database file. Relative paths resolve against the working directory |
| `master_key` | `SERVFLOW_SQLITE_MASTER_KEY` | —       | Encryption key for secrets and credentials at rest. Empty disables encryption          |

<Warning>
  Never commit `master_key` to version control. Set it with `SERVFLOW_SQLITE_MASTER_KEY` in production. Changing it makes previously encrypted secrets unreadable.
</Warning>

<Note>
  SQLite backs the dashboard, secrets, and user accounts. Without it, ServFlow falls back to file-based storage and those features are unavailable. See [Secrets Management](/references/secrets).
</Note>

## `[authentication]`

Controls how the dashboard and management API are gated.

```toml theme={null}
[authentication]
mode = "local"
domain = "your-domain.com"
```

| Field    | Environment variable   | Default | Description                                                                                                       |
| -------- | ---------------------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
| `mode`   | `SERVFLOW_AUTH_MODE`   | `local` | `local` gates the dashboard behind username/password accounts stored in SQLite. `none` disables the gate entirely |
| `domain` | `SERVFLOW_AUTH_DOMAIN` | —       | Public base URL of this instance, used to build OAuth integration callback URLs                                   |

**`mode` defaults to `local`.** A config file that omits this section is still gated — the first time you open the dashboard you are asked to create an account. See [First run](/installation#first-run-create-your-account).

<Warning>
  `mode = "none"` leaves the dashboard and management API open to anyone who can reach the port. Use it only on a trusted local machine.
</Warning>

Sessions are opaque tokens stored in the database, so they survive restarts and can be revoked by logging out.

## `[tracing]`

OpenTelemetry tracing for debugging workflow and agent runs.

```toml theme={null}
[tracing]
enabled = false
service_name = "servflow-pro"
org_id = ""
collector_endpoint = ""
```

| Field                | Environment variable                  | Default | Description                                                                                                                     |
| -------------------- | ------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `enabled`            | `SERVFLOW_TRACING_ENABLED`            | `false` | Enable OpenTelemetry tracing                                                                                                    |
| `service_name`       | `SERVFLOW_TRACING_SERVICE_NAME`       | —       | Service name attached to every span                                                                                             |
| `org_id`             | `SERVFLOW_TRACING_ORG_ID`             | —       | Organization ID for multi-tenant collectors                                                                                     |
| `collector_endpoint` | `SERVFLOW_TRACING_COLLECTOR_ENDPOINT` | —       | Base URL of the OTLP/HTTP ingest endpoint. The `/v1/traces` path is appended automatically, so give a full URL including scheme |

Tracing can also be configured during [first-run setup](/installation#first-run-create-your-account), which offers a hosted collector, a custom endpoint, or disabling it.

## Complete example

```toml theme={null}
[server]
port = "8080"
config_folder = "./configs"
engine_config_file = "./integrations.yaml"
env = "production"

[sqlite]
path = "./secrets.db"
master_key = ""

[authentication]
mode = "local"

[tracing]
enabled = false
service_name = "servflow-pro"
org_id = ""
collector_endpoint = ""
```

## Environment variable overrides

Environment variables always win over the TOML file. This keeps secrets out of configuration files and lets one image serve several environments:

```bash theme={null}
docker run -d \
  -p 8080:8080 \
  -e SERVFLOW_SQLITE_MASTER_KEY=my-secret-key \
  -e SERVFLOW_SQLITE_PATH=/data/servflow.db \
  -e SERVFLOW_AUTH_MODE=local \
  -v $(pwd)/config.toml:/data/config.toml \
  servflow/servflow-pro start --config /data/config.toml --dashboard
```

## Viewing the active configuration

To see the settings an instance actually resolved, including defaults and environment overrides:

```bash theme={null}
servflow-pro resource settings view --config config.toml
```

## Next steps

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/installation">
    Install ServFlow and create your first account.
  </Card>

  <Card title="Running ServFlow" icon="server" href="/running-modes">
    Understand what the server serves and how to deploy it.
  </Card>

  <Card title="Secrets Management" icon="key" href="/references/secrets">
    Store API keys and credentials for your agents.
  </Card>

  <Card title="Agents" icon="robot" href="/concepts/agents">
    Learn the object model your configuration serves.
  </Card>
</CardGroup>
