durable.config
Configuration for DBOS durable execution.
Provides configuration for the DBOS database backend used for workflow persistence and recovery. Supports both SQLite (single-pod, default) and PostgreSQL (multi-pod, production).
DurableConfig Objects
@dataclass
class DurableConfig()
Configuration for DBOS durable execution.
Attributes
enabled : bool
Whether durable execution is enabled (default: False).
database_url : str | None
Full database URL for Postgres (e.g. postgresql://user:pass@host/db).
When set, takes precedence over sqlite_path.
sqlite_path : str
Path to the SQLite database file (used when database_url is None).
recovery_on_startup : bool
Whether to recover pending workflows on DBOS launch.
from_env
@classmethod
def from_env(cls) -> "DurableConfig"
Build configuration from environment variables.
Environment variables:
AGENT_DURABLE_ENABLED — true to enable durable execution.
DBOS_DATABASE_URL — Full Postgres URL (overrides SQLite).
DBOS_SQLITE_PATH — Path to SQLite file.
DBOS_RECOVERY_ON_STARTUP — false to disable recovery.
from_agent_spec
@classmethod
def from_agent_spec(
cls,
spec_advanced: dict | None,
fallback: "DurableConfig | None" = None) -> "DurableConfig"
Build configuration from an AgentSpec's advanced field.
Parameters
spec_advanced : dict | None
The advanced dict from an AgentSpec.
fallback : DurableConfig | None
Fallback configuration (typically from env vars).