Skip to content
Get started
Get started
bunqueue v2.7.2
View Markdown
blog · release

bunqueue v2.7.2

Loop control flow, forEach iteration, map transform, schema validation and more.

bun add bunqueue@2.7.2
npm install bunqueue@2.7.2
bun add bunqueue@latest

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).

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).

New .map(name, transformFn) for synchronous data transforms between steps. No retry, no timeout, pure computation node.

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.

New engine.subscribe(executionId, callback) returns an unsubscribe function. Filters events for a specific execution only.

  • New src/client/workflow/loops.ts, Dedicated execution logic for doUntil, doWhile, forEach, and map nodes.
  • 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 (added retry: 1 to failing step)
  • All 5,305 existing tests continue to pass

← bunqueue v2.7.1 · Release on GitHub · Commits since v2.7.1 · Full changelog · All posts