@zeqqat/workflow-engine
v0.2.0
Published
Storage-free workflow executor: retries, polling, branching, parallelism, saga compensation, approval gates.
Readme
@zeqqat/workflow-engine
The executor for workflow definitions: templating, retries, polling, branching, parallelism, saga compensation, approval gates and redaction of sensitive outputs.
It performs no I/O of its own. It does not know what a database is, or an
HTTP client. Step types are supplied by you through a HandlerRegistry, and
everything the run emits travels through an injected ExecutorEmitter. That
seam is why the same executor writes Postgres rows in a server and SQLite rows
in a CLI without being modified.
Part of Zeqqat, which exposes declared
workflows as MCP tools. Published separately so the
@zeqqat/mcp CLI can depend on it directly.
Install
npm install @zeqqat/workflow-engineUse
import { WorkflowExecutor, HandlerRegistry } from "@zeqqat/workflow-engine";
const registry = new HandlerRegistry();
registry.register("http", myHttpHandler);
const executor = new WorkflowExecutor(registry, emitter);
const result = await executor.execute(workflow, inputs, callerContext);A handler receives a step's resolved inputs and returns its declared outputs. The executor owns everything around that: what runs next, what retries, what gets rolled back.
Compensation
When a step fails, completed steps are compensated in reverse order, and the result says whether the world was left clean. That distinction — "this failed and nothing happened" versus "this failed and something is half done" — is the point of the saga support, because it is what tells a caller whether retrying is safe.
License
Apache-2.0
