Skip to main content
CNStrav3 · MIT

Typed orchestration for TypeScript

Every flow is a graph.
Every run is visible.

Wire your app as neurons and typed signals. The compiler checks the wiring, the engine runs it deterministically, and devtools show every hop of every run as it happens.

npm i @cnstra/core
registration.ts
const userCreated = cnsCollateral<{ id: string; name: string }>();
const userRegistered = cnsCollateral<{ userId: string }>();

const registration = cnsNeuron({ userRegistered }).dendrite({
collateral: userCreated,
response: async (user, axon) => {
await users.insert(user);
return axon.userRegistered.createSignal({ userId: user.id });
},
});

const cns = new CNS([registration, welcomeMail, analytics]);
const run = cns.stimulate(userCreated.createSignal(newUser));
await run.waitUntilComplete();

Live

The real devtools, watching a real engine in your browser.

A shop flow of six neurons runs here every couple of seconds, and every fifth card is declined. This is the actual devtools panel, connected to it without a server: open a failed run and press Retry, and it resumes from the neuron that failed.

cnstra devtools · demo

Resume

Fail it mid-run. It continues from where it stopped.

The run fails inside payment. Its frontier is the work still outstanding, and activating it runs only that branch: the stock is not reserved a second time. Checkpoint the same frontier and it survives a process restart too.

01

Isolated units

Each neuron owns one responsibility. Change one and the compiler and the graph show exactly what it affects.

02

Typed and exhaustive

Signals are typed collaterals, and the compiler makes you handle every one you subscribe to. An incomplete flow does not build.

03

Traceable and resumable

Every hop lands in devtools. A running flow persists its frontier and resumes after a restart.

Where it fits

Backend jobs

Workers and queue-triggered flows: fan-out, fan-in, concurrency gates.

Integrations

Webhooks and third-party APIs as explicit, testable steps.

Pipelines

Step-by-step transforms with retries, backoff and clear boundaries.

Sagas

Deterministic retries, cancellation and compensation.

Wire it once. Watch it run.

Install @cnstra/core, declare a neuron, and stimulate it.

Recommended together with

OIMDB

CNStra decides what happens and in what order. OIMDB holds the data and reacts to it. One line connects them, and every turn of the orchestrator lands in one frame:

cns.addDrainListener(() => db.flush());Using CNStra with OIMDB →