@workplane/dbos
v0.4.1
Published
Optional DBOS durability layer for the workplane server. Wraps store operations in durable DBOS workflows so the control plane survives process crashes and replays in-flight operations.
Downloads
381
Readme
@workplane/dbos
Optional DBOS durability layer for the workplane server. Wraps store operations in durable DBOS workflows so the control plane survives process crashes and replays in-flight operations.
The core server does not import this package unless WORKPLANE_USE_DBOS=true. Without it, workflows run as plain async calls against Postgres (VanillaWorkflows).
Install
npm install @workplane/dbos @workplane/types @dbos-inc/dbos-sdkUsage
Enable by setting WORKPLANE_USE_DBOS=true before starting the workplane server — no code changes needed. The server dynamically imports this package and swaps VanillaWorkflows for DbosWorkflows.
export DATABASE_URL=postgres://... # required by the server either way
export WORKPLANE_USE_DBOS=true
workplane-serverProgrammatic use
import { createDbosWorkflows } from "@workplane/dbos";
const workflows = createDbosWorkflows(store); // store satisfies ServerWorkflows
await workflows.launch({
appName: "my-app",
systemDatabaseUrl: process.env.DATABASE_URL,
});
// workflows now implements ServerWorkflows with DBOS durabilityRequirements
Only when DBOS is enabled:
- Postgres — DBOS system tables (same
DATABASE_URLas the workplane app schema by default) DBOS_APPLICATION_NAMEenv var (optional, defaults toworkplane-server)DBOS_CONDUCTOR_KEY— optional; for DBOS Cloud observability
When DBOS is disabled, none of the above apply beyond the server's normal Postgres requirement for task/run state.
