Workflow Studio requires PostgreSQL. Use a PostgreSQL server on the same computer for local testing or a managed PostgreSQL service such as Aiven for deployment. The local companion does not connect to the database and never receives database credentials.
Create a database and login with PostgreSQL tooling or pgAdmin, then add these values to .env.local:
PGHOST=127.0.0.1
PGPORT=5432
PGUSER=workflow_studio
PGPASSWORD=replace-me
PGDATABASE=workflow_studio
PGSSL_MODE=disableThe database login must be allowed to connect and create objects in the database. Workflow Studio creates its workflow_studio schema and versioned tables during startup.
Download the Aiven CA certificate into certs/aiven-ca.pem. Keep the password in the deployment secret store, then configure:
PGHOST=your-service.aivencloud.com
PGPORT=16251
PGUSER=avnadmin
PGPASSWORD=replace-me
PGDATABASE=defaultdb
PGSSL_MODE=verify-ca
PGSSL_CA_FILE=./certs/aiven-ca.pemYou may set DATABASE_URL instead of the five connection fields. TLS settings still come from PGSSL_MODE; use verify-ca with PGSSL_CA_FILE for Aiven certificate verification.
npm install
npm run db:check
npm run devdb:check prints the PostgreSQL server version when the connection succeeds. Start Workflow Studio once so it applies its schema, stop it, and then run:
npm run db:verifyThis checks required tables, indexes, migration records, and the immutable audit trigger. The application health endpoint reports PostgreSQL readiness and migration status.
Install PostgreSQL client tools and put pg_dump and pg_restore on PATH, or set PG_BIN_DIR to their directory. Create a custom-format backup with npm run db:backup. Restore only into a disposable target database:
For a disposable scale rehearsal, seed between 10 and 10,000 users only after explicitly enabling fixture seeding:
$env:WORKFLOW_STUDIO_ALLOW_FIXTURE_SEED='true'
$env:WORKFLOW_STUDIO_FIXTURE_USERS='1000'
npm run db:seed-scale-fixtureThe command refuses databases whose name does not contain test, validation, or fixture unless WORKFLOW_STUDIO_CONFIRM_FIXTURE_DATABASE exactly matches PGDATABASE.
npm run db:restore -- --file .\backups\workflow-studio-TIMESTAMP.dump --confirm
npm run db:verifyAfter restoring into a separate database, compare every table by row count and deterministic content fingerprint:
$env:PGSOURCE_DATABASE='workflow_studio_validation'
$env:PGRESTORE_DATABASE='workflow_studio_restore_validation'
npm run db:compareThe restore command requires the explicit --confirm flag. Keep production backups encrypted and retained through the database provider's approved backup policy.
The deployed website stores accounts, sessions, workflows, runs, approvals, pairing records, audit events, assignments, and skill metadata in PostgreSQL. Each user's companion keeps Codex authentication and local workspace access on that user's computer. Changing the website database does not change how the companion starts or runs. If pairing records are moved or reset, generate a new one-time pairing code and reconnect.