Introduction

Yieldstar is a workflow engine that provides a durable runtime for JavaScript generator functions.

Version 0.5 ships a resident-process runtime backed by SQLite. It runs on Bun or Node using the host's native SQLite driver and does not require a particular cloud platform.

Workflows are checkpointed with primitives such as yield* step.run() and yield* step.delay(). The runtime persists step results and resumes delayed, retried, or state-waiting workflows across process restarts.

import { workflow } from "yieldstar";

const checkout = workflow(async function* (step) {
  const order = yield* step.run(() => createOrder());
  yield* step.delay(30_000);
  const payment = yield* step.run(() => chargeCard(order.id));
  return yield* step.run(() => confirmOrder(order.id, payment.id));
});

How it compares

YieldstarTemporalInngestCloudflare Workflows
State persistenceSQLite fileTemporal Server clusterInngest Cloud (SaaS)Cloudflare Durable Objects
InfrastructureProcess plus a fileMulti-service clusterSaaS platformCloudflare Workers platform
Self-hostableYes, single serviceYes, but complexNoNo
EmbeddableYesNoNoNo
PortabilityRuns anywhere JS runsNeeds Temporal ServerNeeds Inngest platformNeeds Cloudflare
Deployment safetyOut-of-order step detectionManual versioningManual versioningManual versioning

Execution model

The execution model works by replaying the generator. When a step completes, the runtime snapshots its return value to a persistent heap and either advances to the next step or yields control back to the orchestrator. When the orchestrator later resumes the workflow, the runtime feeds each previously completed step its stored result instead of re-executing it, so the generator picks up exactly where it stopped.

This differs from await step.run() engines such as Inngest and Cloudflare Workflows, which intercept Promises through platform-specific wrappers.

Yieldstar uses yield*, JavaScript's native generator delegation, as a bi-directional protocol between the workflow and the runtime.

Packages

Yieldstar is a monorepo of composable packages:

PackageRole
yieldstarCore SDK with workflow, createWorkflowRouter, RetryableError, and the local and HTTP SDKs
@yieldstar/coreBase types and the WorkflowRunner execution engine
@yieldstar/sqlite-runtimeDriver-agnostic SQLite heap, store, scheduler, task queue, timers, and event loop
@yieldstar/worker-invokerSubprocess invoker and worker process
@yieldstar/http-serverRuntime-neutral HTTP routes and middleware using standard Request and Response
@yieldstar/test-runtimeIn-memory runtime components used by Yieldstar's test tooling
@yieldstar/test-invokerIn-process invoker used by Yieldstar's test tooling
@yieldstar/test-utilsTest SDK and schema helpers used internally by this repository
@yieldstar/store-conformanceVitest qualification suite for third-party store connectors

The resident-process runtime splits into five subsystems.

  • A heap stores step results so they survive restarts.
  • A scheduler tracks timers and wake-ups.
  • A task queue orders pending work.
  • A store holds schema-validated shared state and workflow waiters.
  • An event loop polls the queue and dispatches executions.