Overview
DBOS Transact is configured using aDBOSConfig dictionary or a dbos-config.yaml file. This page documents all available configuration options.
Configuration File
The default configuration file isdbos-config.yaml in your project root. DBOS automatically loads this file when you call DBOS.launch() or use the CLI.
Basic Example
dbos-config.yaml
DBOSConfig Class
TheDBOSConfig TypedDict class defines all available configuration options. You can pass this directly to DBOS() or use a YAML file.
Application name. Must be 3-30 characters, lowercase letters, numbers, dashes, and underscores only.
Database Configuration
Connection string for the DBOS system database. Defaults to
sqlite:///{name}.sqlite if not provided.Format:- SQLite:
sqlite:///path/to/database.sqlite - PostgreSQL:
postgresql://user:password@host:port/database
Connection string for your application database where
@Transaction functions run. Optional.Must be the same database type (SQLite or Postgres) as the system database.Deprecated. Use
application_database_url instead.Connection pool size for the system database.
SQLAlchemy engine keyword arguments for database connections.See SQLAlchemy create_engine documentation.Default values:
Schema name for DBOS system tables.
A custom system database engine. If provided, DBOS will use this instead of creating its own.
Runtime Configuration
Port for the DBOS admin server.
Whether to run the DBOS admin server.
Maximum number of executor threads for running workflows and steps.
Polling interval in seconds for the notification listener background process.Minimum value:
0.001. Lower values can speed up test execution.Polling interval in seconds for the scheduler thread to detect new workflow schedules.
Telemetry & Logging
Global log level. Options:
DEBUG, INFO, WARNING, ERROR, CRITICAL.Log level specifically for console logging. Must be no less severe than
log_level.Log level specifically for OTLP logging (if enabled). Must be no less severe than
log_level.Enable built-in DBOS OTLP tracing and logging.
OTLP traces endpoints for exporting telemetry data.
OTLP logs endpoints for exporting log data.
Custom attributes to apply to OTLP-exported logs and traces.
Advanced Configuration
Application version identifier.
Executor ID, used to identify the application instance in distributed environments.
A custom serializer and deserializer DBOS uses when storing program data in the system database.See the Serialization API for details.
Whether to use PostgreSQL LISTEN/NOTIFY or polling for notifications and events.
An API key for DBOS Conductor. Pass this to connect your process to Conductor.
The websockets URL for your DBOS Conductor service. Only set if you’re self-hosting Conductor.
Configuration File Schema
The YAML configuration file is parsed into aConfigFile TypedDict with the following structure:
YAML File Structure
Environment Variable Substitution
You can use environment variables in your configuration file with${VAR_NAME} syntax:
Docker Secrets
For Docker secrets, use${DOCKER_SECRET:SECRET_NAME} syntax:
/run/secrets/SECRET_NAME.
Database URL Format
SQLite
PostgreSQL
database: Database name must be specified
connect_timeout: Connection timeout in seconds (default: 10)sslmode: SSL mode (e.g.,require,disable)application_name: Application name visible in pg_stat_activity
Loading Configuration
DBOS provides several ways to load configuration:From File
From DBOSConfig Dict
Programmatic Loading
Validation
DBOS validates your configuration on startup:- Application name: Must be 3-30 characters, lowercase letters, numbers, dashes, and underscores only
- Database URLs: Must include required fields (database name for PostgreSQL)
- Log levels: Must be valid Python logging levels
- Intervals: Must meet minimum value requirements
DBOSInitializationError at startup.
Configuration in YAML File
In the YAML file, configuration is organized into sections:runtimeConfig Section
Commands to start your application. Used by
dbos start.Optional setup commands run before starting.
database Section
Migration commands to run with
dbos migrate. Executed after DBOS system migrations.telemetry Section
Disable OTLP export. Set to
false to enable.Examples
Minimal SQLite Configuration
simple_app.sqlite
Production PostgreSQL Configuration
Development Configuration with Custom Serializer
See Also
- Serialization API - Custom serializers
- CLI Overview - Using configuration with the CLI
- Configuration Guide - Configuration best practices