What is it
Stannis is a finite state machine workflow engine built for serverless Node.js. It lets you define multi-step flows that survive process restarts, scale across distributed workers, and resume from any point — without vendor lock-in or runtime dependencies.
Think AWS Step Functions, but as a plain JavaScript library you own and run anywhere. State persists through a two-method storage adapter — Redis, DynamoDB, in-memory, or anything you wire up.
Node types
- Task A sequential work unit. Imports and runs an external module.
- Sequence Runs child nodes one after another, in order.
- Parallel Fans out to all branches concurrently. Waits for every branch to complete before continuing.
- Race Fans out to all branches. The first to complete wins; the rest are abandoned.
- Decision Evaluates a condition and routes execution 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, JSDoc-typed
- Node.js 20+