@wfgraph/core
v0.3.0
Published
Workflow Graph's backend: the run engine, the authoring vocabulary and the app a host mounts
Maintainers
Readme
@wfgraph/core
The backend half of Workflow Graph, a self-hosted
workflow engine you embed in your own application. This package holds the run engine, the
authoring vocabulary your code declares its domain in, and createWfGraphApp, which returns a
fetch handler you mount in a server you own.
npm install @wfgraph/coreimport { createServer } from "node:http";
import { createRequestListener, createWfGraphApp } from "@wfgraph/core";
import { wfPostgres } from "@wfgraph/core/postgres";
const wfgraph = await createWfGraphApp({
persistence: wfPostgres({
url: process.env.DATABASE_URL!,
migrations: { runOnStartup: true },
}),
encryption: { key: process.env.INTEGRATION_ENCRYPTION_KEY },
auth: (request) => hasValidSession(request),
inngest: { id: "my-wfgraph-app", connect: true },
extensions: { events: [], actions: [], integrations: [] },
});
createServer(createRequestListener(wfgraph)).listen(3000);For SQLite, wfSqlite() is in memory and wfSqlite({ filename: "./wfgraph.db" })
persists to a file:
import { wfSqlite } from "@wfgraph/core/sqlite";Runs on Node 24 with PostgreSQL 15 or newer or native SQLite, and Inngest. Add
@wfgraph/client for the visual editor and
@wfgraph/plugins for the built-in
integrations; the three are released together and always share a version.
Docs
- Embedding, which covers mounting, the database, options, and every package export
- Events for
defineEvent - Integrations for
defineIntegration - Domain vocabulary
Apache-2.0.
