Developers

Compose stateful apps from typed bricks.

The Quatrain SDK is fully typed and tree-shakeable. Pick the bricks you need; the runtime stays small.

1 — Install
# pnpm
pnpm add @quatrain/core @quatrain/flow @quatrain/state

# bun
bun add @quatrain/core @quatrain/flow @quatrain/state
2 — Define a workflow
import { Workflow } from '@quatrain/flow';

export const purchaseOrder = new Workflow({
  id: 'purchase-order',
  states: ['draft', 'review', 'approved', 'closed'],
  transitions: [
    { from: 'draft', to: 'review', on: 'submit' },
    { from: 'review', to: 'approved', on: 'approve', guard: 'isManager' },
    { from: 'approved', to: 'closed', on: 'fulfill' },
  ],
});
3 — Deploy anywhere
import { deploy } from '@quatrain/core';
import { purchaseOrder } from './workflows/purchase-order';

await deploy({
  target: 'kubernetes',  // 'serverless' | 'bare-metal' | 'kubernetes'
  workflows: [purchaseOrder],
  bricks: ['auth', 'data', 'notify'],
});
Highlights

Built for serious systems.

TypeScript-first

Strict types across every brick — no any, no leaks.

Pluggable runtime

Same code, multiple deploy targets.

Observability

OpenTelemetry traces and structured logs by default.

Read the monorepo