Steady
Durable, resumable multi-step jobs on the Postgres you already have.
Steady runs multi-step jobs that survive crashes, deploys and time. Write a flow as an async
function; each step result is recorded once and replayed after any interruption, so finished
work is not done again. Flows can sleep for days, wait for a signal from a person, retry with
backoff, and run on a cron schedule. Everything lives in four tables in your Postgres. Any process
that calls tick() every minute is enough: a serverless cron, a container loop, your laptop. No
broker, no extra service, no vendor.
import { createSteady } from "@solustiq/steady"
const steady = createSteady({ db, tenant: "acme" }) // db: pgAdapter(pool), postgresAdapter(sql) or neonAdapter(url)
const onboarding = steady.defineFlow("onboarding", async (f, user: { email: string }) => {
const account = await f.step("create-account", () => createAccount(user.email))
await f.step("send-welcome", () => sendEmail(user.email, "welcome"))
const verified = await f.waitForSignal("email-verified", { timeout: "3d" })
if (!verified) await f.step("send-reminder", () => sendEmail(user.email, "reminder"))
await f.sleep("7d")
await f.step("send-tips", () => sendEmail(user.email, "tips"))
return { accountId: account.id }
})
await steady.start(onboarding, { email: "ada@example.com" }, { key: "user-42" }) // key: an opaque id, never personal data
await steady.tick() // call this every minute: a cron route, a loop, a worker
When the user clicks the verification link, your handler calls
steady.signal({ flow: onboarding, key: "user-42" }, "email-verified") and the next tick
continues the flow. If the process dies anywhere in between, the next tick picks the run up from
the last recorded step. This exact snippet is compiled and run by the test suite
(src/readme-example.test.ts).
When to use it
- Jobs with several steps where a failure halfway must not repeat the first half: provisioning, onboarding, billing runs, report pipelines, sync jobs.
- Work that waits for people or for time: approvals, “remind me in 2 days”, no-show follow-ups, trial expiry.
- Cron jobs that need memory: “send the daily report once per day, even if the cron fires twice or the deploy restarts it”.
- Serverless apps (Vercel, Netlify, Lambda) that have a cron trigger and a Postgres, and no place to run a long-lived worker.
- Teams that want an audit trail of every step attempt, in their own database, queryable with SQL.
When not to use it
- You need sub-second latency between steps. A parked run resumes on the next
tick(), so the resolution is your tick interval (typically one minute). - You need thousands of steps per second or fan-out to a worker fleet. Steady is built for business processes, not stream processing; there is no push delivery and no parallel steps inside one run.
- Your store is not Postgres. Steady ships a Postgres store and an in-memory store for tests; nothing else.
- You need flow versioning beyond “a renamed step is a new step”, or a hosted UI. Steady gives you
history()and SQL; you render it.
How it compares
| Steady | Temporal | Inngest | cron + database | |
|---|---|---|---|---|
| What you run | a library and your Postgres | a cluster (server, history and matching services) plus workers | a hosted service or its self-hosted server | your cron and your tables |
| Resume after a crash | from the last recorded step | from the last recorded event | from the last recorded step | whatever you wrote by hand |
| Sleep for days, wait for a signal | yes | yes | yes | by hand, with state columns |
| Latency of a resume | your tick interval (about a minute) | near real time | near real time | your cron interval |
| Built for | business processes at modest volume | high volume, many services | event-driven apps at high volume | simple periodic jobs |
| Parallel steps inside one run | no | yes | yes | by hand |
| Changing flow code under live runs | no versioning; a mismatch fails the run loudly | versioning APIs | step ids; changes need care | n/a |
| Languages | TypeScript | many | several | any |
| Hosted dashboard | no (history() and SQL) |
yes | yes | no |
| Where state lives | your Postgres | Temporal’s persistence store | Inngest cloud, or its self-hosted server | your tables |
More detail and the reasoning behind each row: docs/comparison.md.
Install
npm install @solustiq/steady
# plus the driver you already use (optional peers):
npm install pg # or: postgres, @neondatabase/serverless
Node 20 or newer. Zero runtime dependencies; the drivers are optional peer dependencies and are never bundled. ESM and CommonJS builds with type definitions.
Quick start
1. Connect and migrate. migrate() creates the four tables if they are missing and is safe to
run on every boot (or apply sql/steady.sql with your migration tool).
import { Pool } from "pg"
import { createSteady } from "@solustiq/steady"
import { pgAdapter } from "@solustiq/steady/pg"
export const steady = createSteady({
db: pgAdapter(new Pool({ connectionString: process.env.DATABASE_URL })),
tenant: "acme",
})
await steady.migrate()
Other drivers: postgresAdapter(sql) from @solustiq/steady/postgres (postgres.js) and
neonAdapter(process.env.DATABASE_URL!) from @solustiq/steady/neon (Neon serverless over HTTP).
2. Define flows. Every process that calls tick() must define every flow it should run;
tick() only claims runs of flows defined on that instance.
export const dailyReport = steady.defineFlow("daily-report", async (f) => {
const rows = await f.step("query", () => loadYesterday())
await f.step("email", () => sendReport(rows), { retry: { maxAttempts: 5, backoffMs: 60_000 } })
})
3. Start runs, or schedule them.
await steady.start(dailyReport, undefined, { key: "report:2026-12-01" }) // idempotent per key
await steady.schedule(dailyReport, "0 7 * * 1-5", { tz: "Europe/Istanbul" }) // weekdays 07:00
4. Tick. Call tick() every minute from whatever you have. On Vercel, a cron route:
// app/api/steady/route.ts, with a Vercel cron on "* * * * *"
export async function GET(request: Request) {
if (request.headers.get("authorization") !== `Bearer ${process.env.CRON_SECRET}`) {
return new Response("unauthorized", { status: 401 })
}
const result = await steady.tick({ concurrency: 4 })
return Response.json({ claimed: result.claimed, completed: result.completed, failed: result.failed })
}
In a container: setInterval(() => steady.tick().catch(console.error), 60_000). Many runners may
tick at the same time; leases make sure each run executes in one place.
5. Look inside. steady.history(runId) returns the run and a timeline of every step attempt,
park, log line and signal. steady.list({ status: "failed" }) finds dead letters;
steady.retryNow(runId) re-opens one at the step that failed.
Guarantees, in plain words
- A recorded step result is never recomputed. Once a step’s result is in the journal, every resume returns that recorded value instead of running the body again.
- A step body runs at least once, and more than once only after a crash. If the process dies after the body finished but before its result was recorded, the body runs again on resume. Make step bodies idempotent (or pass your own idempotency key to the API you call).
- Code between steps runs again on every resume, so it must be deterministic. Do I/O, read the
clock and draw random numbers inside steps. If the flow code changes so that a recorded step no
longer lines up (renamed, reordered, removed), the run fails with a
ReplayMismatchErrorthat names both steps, instead of silently using the wrong result. - One run executes in one place at a time. A runner claims a run with a lease; another runner cannot claim it until the lease expires, and a runner that lost its lease cannot record anything.
- Starting with the same key returns the same run. Enforced by a unique index, safe under concurrency.
- Signals are kept and never misapplied. A signal sent before the flow waits is buffered.
A signal that arrives after a wait timed out is kept (visible in
history()) and flagged late; a later wait with the same name does not consume it unless it passesacceptLate: true. - A missed schedule fires once, not once per missed slot. After an outage, each schedule starts one run and continues from the next future time, computed in its IANA time zone.
The details, with the exact rules: docs/guarantees.md.
Security
Every query filters on the tenant of the instance, and a cross-tenant instance needs an explicit
allowCrossTenant: true. Only flows registered with defineFlow can be started, scheduled or
signalled; names and keys are validated and payloads have hard size limits (64 KB inputs and
results, 16 KB signals) that reject oversize data instead of storing it. Values under secret-looking
property names (password, token, apiKey, …) are redacted before anything is stored or
emitted, errors are stored as Name: message without stack traces, and optional AES-256-GCM
encryption at rest covers inputs, outputs, step results, signal payloads and schedule inputs. An
optional script (sql/rls.sql) adds a least-privilege role, row-level security per
tenant and an append-only step log. Steady has no network surface: your application authenticates
whoever may call start, signal or cancel. Read docs/security.md and
report vulnerabilities as described in SECURITY.md.
Documentation
| Page | What it covers |
|---|---|
| Concepts | Flows, runs, steps, the journal, sleep, signals, schedules, once, tenancy, the tick |
| Guarantees | What “exactly once” means here, failure cases, determinism, late signals, DST |
| API reference | Every public function, option, type and error |
| Recipes | Daily report, approval via an HTTP handler, retry with backoff, no-show handling, migrating from cron, sensitive step results |
| Operations | Tick cadence, leases, many runners, retention, observability SQL, the RLS role |
| Security | Threat model and the controls that address it |
| FAQ | Short answers to common questions |
| Comparison | Steady next to Temporal, Inngest and cron plus a table |
Runnable samples live in examples/: a Vercel cron route, a Node loop, and an approval wait driven by an HTTP handler.
Also: CHANGELOG, CONTRIBUTING, CODE_OF_CONDUCT, SQL files.
License
MIT, Copyright (c) 2026 Solustiq.