Skip to content

Repository files navigation

YieldStar 🤘

JavaScript-native distributed workflows.

Write workflows as async generator functions that yield steps. First-class primitives for retries, delays, polling, and durable stores.

Install

bun add yieldstar

Runtime packages:

  • Local execution: @yieldstar/worker-invoker, @yieldstar/sqlite-runtime
  • HTTP server: @yieldstar/http-server, @yieldstar/worker-invoker

Select @yieldstar/sqlite-runtime/bun for bun:sqlite or @yieldstar/sqlite-runtime/node for node:sqlite.

Quick Look

Define a workflow that composes steps:

import{workflow}from"yieldstar";exportconstsimple=workflow(asyncfunction*(step){constn=yield*step.run(()=>1);yield*step.delay(1000);returnyield*step.run(()=>n*2);});

Retries are explicit and structured:

import{RetryableError}from"yieldstar";yield*step.run(async()=>{// e.g. flaky fetchthrownewRetryableError("temporary",{maxAttempts: 4,retryInterval: 1000});});

Learn More

Contributing

  • Please open an issue to discuss significant changes before submitting a PR.
  • See CONTRIBUTING.md for repo layout, dev workflow, testing, and release details.

License

MIT

Author

Daniel Grant

About

JavaScript-native distributed workflows that can be orchestrated by any backend

Resources

Contributing

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages