smrt
Open the smrt source on GitHub Switch to dark color scheme
← All packages
Agents & runtime v0.62.10 New

@happyvertical/smrt-workflows

Durable workflow runs: ordered host steps over registered prompts, with tracked calls, checkpoints, repair, approval, and budgets.

Source ↗

What it gives you

Durable workflow runs: ordered host steps over registered prompts, with tracked calls, checkpoints, repair, approval, and budgets.

  1. 01A step names a registered prompt, a JSON Schema for its output, and an optional check
  2. 02Output that fails the schema is repaired up to the budget, then the run fails
  3. 03A budget limit leaves the run stopped and resumable; a cancel ends it
  4. 04A job handler works each run with claim fencing

Runs live in core

The package has no models and creates no tables. Runs, events, and checkpoints live in the system tables of smrt-core. The package replaces the design runs of smrt-inference.

Every step call is tracked

A step resolves its prompt through resolvePrompt and calls the tracked client inside the run. The budget reserves each call. A call event and a usage row record the step, the attempt, and the prompt hash.

Checks, approval, and retry

The host check can reject output, ask for the step again, finish the run early, or pause it for a person’s approval. A failed run can restart from its last accepted step as a new run.

Background execution

createWorkflowRunJobs registers a named job handler and admits one job for each run. Create the host at startup, before any runner claims work. Steps and checks must be safe to repeat after a crash.