bunqueue v2.7.2
Loop control flow, forEach iteration, map transform, schema validation and more.
To install bunqueue v2.7.2
Section titled “To install bunqueue v2.7.2”bun add bunqueue@2.7.2npm install bunqueue@2.7.2To upgrade bunqueue
Section titled “To upgrade bunqueue”bun add bunqueue@latestLoop control flow
Section titled “Loop control flow”New .doUntil(condition, builder, opts?) and .doWhile(condition, builder, opts?) DSL methods for conditional iteration. doUntil runs steps then checks condition (do…until), doWhile checks condition first (while…do). Both support maxIterations safety limit (default: 100).
forEach iteration
Section titled “forEach iteration”New .forEach(items, name, handler, opts?) iterates over a dynamic item list. Results stored with indexed names (step:0, step:1, …). Each iteration receives ctx.steps.__item and ctx.steps.__index. Supports maxIterations (default: 1000).
Map transform
Section titled “Map transform”New .map(name, transformFn) for synchronous data transforms between steps. No retry, no timeout, pure computation node.
Schema validation
Section titled “Schema validation”New inputSchema and outputSchema options on .step(). Duck-typed .parse() method, works with Zod, ArkType, Valibot, or any custom schema. Input validated before handler, output validated after.
Per-execution subscribe
Section titled “Per-execution subscribe”New engine.subscribe(executionId, callback) returns an unsubscribe function. Filters events for a specific execution only.
More additions
Section titled “More additions”- New
src/client/workflow/loops.ts, Dedicated execution logic for doUntil, doWhile, forEach, and map nodes.
Documentation
Section titled “Documentation”- Workflow guide: 6 new Core Concepts sections (Loops, forEach, Map, Schema Validation, Subscribe), 5 new comparison table rows, subscribe added to API table, architecture diagram updated, 2 new real-world examples
- Blog post: 2 new sections (Loops/forEach/Map, Schema/Subscribe), test count updated
- Examples: 3 new examples (forEach+Map aggregation, doUntil polling, Schema+Subscribe)
- FAQ: Feature list expanded (+5 bullets), comparison table (+3 rows), JSON-LD updated
- Homepage/Introduction/README/CLAUDE.md: All updated with new features
- 11 new unit tests in
workflow-loops.test.ts(doUntil, doWhile, forEach, map, subscribe, schema validation) - 6 new embedded integration tests (tests 14-19)
- 6 new TCP integration tests (tests 14-19)
- Fixed flaky
workflow-realistic.test.ts(addedretry: 1to failing step) - All 5,305 existing tests continue to pass
Thanks to 1 contributor!
Section titled “Thanks to 1 contributor!”← bunqueue v2.7.1 · Release on GitHub · Commits since v2.7.1 · Full changelog · All posts