Installation
pnpm add octaflow zodzod is a required peer. The heavy dependencies are optional peers — install only
what the layers you import need:
# Postgres store / gate / event sinkpnpm add pg
# pg-boss dispatcher, workers, cron schedulerpnpm add pg-boss
# the AI add-onpnpm add ai @ai-sdk/providerPure in-memory usage (great for tests and single-process apps) needs nothing beyond
zod— the engine,defineStep/buildWorkflow, and the in-memory store are all in the core.
Each layer is a separate subpath export, so importing one never drags in another’s heavy deps:
| Import | Layer | Heavy deps |
|---|---|---|
octaflow |
core — engine, defineStep/buildWorkflow, store/dispatcher/gate interfaces, in-memory store, observability |
none |
octaflow/store-pg |
store-pg — WorkflowStore + StepGate + event sink over Postgres, with DDL |
pg |
octaflow/dispatcher-pgboss |
dispatcher-pgboss — Dispatcher + step/DLQ workers + cron scheduler over pg-boss |
pg-boss |
octaflow/ai |
ai — instrumented model, cost, quota, defineAiStep, hooks factory |
ai, @ai-sdk/provider |
Enforced dependency tree (scripts/check-boundaries.mjs, part of lint):
core → (nothing internal) forbid: ai, @ai-sdk, pg, pg-bossai → core forbid: pg, pg-bossstore-pg → core forbid: ai, @ai-sdk, pg-bossdispatcher-pgboss → core forbid: ai, @ai-sdk, pg