← Projects

Stannis

Durable workflows for serverless Node.js

Details

What it does

Stannis runs multi-step workflows on serverless Node.js. They survive restarts, scale across workers and resume from any point.

Think AWS Step Functions, but as a plain JavaScript library you own and can run anywhere. State persists through a two-method storage adapter: Redis, DynamoDB, in-memory, or anything you wire up.

The scene above

A live workflow. Each amber packet is a unit of work travelling through the graph: it splits into parallel sequences, merges, hits a decision, and in the race branch three competitors start and only the first to finish carries on.

Node types

TaskA unit of work. Imports and runs an external module.
SequenceRuns child nodes one after another, in order.
ParallelFans out to every branch and waits for all of them to finish.
RaceFans out to every branch. The first to finish wins; the rest are abandoned.
DecisionEvaluates a condition and routes to exactly one branch.

Key traits

  • Durable across serverless cold starts and process restarts
  • Storage-agnostic: bring your own adapter
  • Resumable via continuation tokens, for human-in-the-loop flows
  • Zero runtime dependencies. Plain JavaScript, typed with JSDoc
  • Node.js 20+