Bun 队列 是 AI Skill Hub 本期精选Agent工作流之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
高性能作业队列,支持 SQLite 持久化、DLQ、定时任务和 S3 备份
Bun 队列 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
高性能作业队列,支持 SQLite 持久化、DLQ、定时任务和 S3 备份
Bun 队列 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:npm 全局安装 npm install -g bunqueue # 方式二:npx 直接运行(无需安装) npx bunqueue --help # 方式三:项目依赖安装 npm install bunqueue # 方式四:从源码运行 git clone https://github.com/egeominotti/bunqueue cd bunqueue npm install npm start
# 命令行使用
bunqueue --help
# 基本用法
bunqueue [options] <input>
# Node.js 代码中使用
const bunqueue = require('bunqueue');
const result = await bunqueue.run(options);
console.log(result);
# bunqueue 配置说明 # 查看配置选项 bunqueue --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export BUNQUEUE_CONFIG="/path/to/config.yml"
<p align="center"> <a href="https://bunqueue.dev/"> <img src=".github/banner.svg" alt="bunqueue" width="400" /> </a> </p>
<p align="center"> <a href="https://www.npmjs.com/package/bunqueue"><img src="https://img.shields.io/npm/v/bunqueue?style=flat-square" alt="npm version"></a> <a href="https://www.npmjs.com/package/bunqueue"><img src="https://img.shields.io/npm/dm/bunqueue?style=flat-square" alt="npm downloads"></a> <a href="https://github.com/egeominotti/bunqueue/actions"><img src="https://img.shields.io/github/actions/workflow/status/egeominotti/bunqueue/ci.yml?style=flat-square&label=CI" alt="CI"></a> <a href="https://github.com/egeominotti/bunqueue/stargazers"><img src="https://img.shields.io/github/stars/egeominotti/bunqueue?style=flat-square" alt="GitHub Stars"></a> <a href="https://github.com/egeominotti/bunqueue/blob/main/LICENSE"><img src="https://img.shields.io/github/license/egeominotti/bunqueue?style=flat-square" alt="License"></a> </p>
<p align="center"> High-performance job queue for Bun. Built for AI agents and automation.<br/> Zero external dependencies. MCP-native. TypeScript-first. </p>
<p align="center"> <a href="https://bunqueue.dev/">Documentation</a> · <a href="https://bunqueue.dev/guide/benchmarks/">Benchmarks</a> · <a href="https://www.npmjs.com/package/bunqueue">npm</a> </p>
---
bun add bunqueue
Requires Bun runtime. Node.js is not supported.
bun add bunqueue
import { Bunqueue } from 'bunqueue/client';
const app = new Bunqueue('emails', {
embedded: true,
processor: async (job) => {
console.log(`Sending to ${job.data.to}`);
return { sent: true };
},
});
await app.add('send', { to: 'alice@example.com' });
That's it. Queue + Worker in one object. No Redis, no config, no setup.
---
import { Bunqueue, shutdownManager } from 'bunqueue/client';
const app = new Bunqueue<{ payload: string }>('my-app', {
embedded: true,
routes: {
'process': async (job) => ({ id: job.data.payload, status: 'done' }),
'notify': async (job) => ({ sent: true }),
'alert': async (job) => ({ alerted: true }),
},
concurrency: 10,
retry: { maxAttempts: 3, delay: 1000, strategy: 'jitter' },
circuitBreaker: { threshold: 5, resetTimeout: 30000 },
ttl: { defaultTtl: 600000, perName: { 'verify-otp': 60000 } },
priorityAging: { interval: 60000, minAge: 300000, boost: 1 },
deduplication: { ttl: 5000 },
rateLimit: { max: 100, duration: 1000 },
dlq: { autoRetry: true, maxAge: 604800000 },
});
app.use(async (job, next) => {
const start = Date.now();
const result = await next();
console.log(`${job.name}: ${Date.now() - start}ms`);
return result;
});
app
.trigger({ on: 'process', create: 'notify', data: (r) => ({ payload: r.id }) })
.trigger({ on: 'process', event: 'failed', create: 'alert', data: (_, j) => j.data });
await app.cron('cleanup', '0 2 * * *', { payload: 'nightly' });
await app.add('process', { payload: 'ORD-001' });
process.on('SIGINT', async () => {
await app.close();
shutdownManager();
});
---
Orchestrate multi-step business processes with branching, saga compensation, and human-in-the-loop signals. Built on top of bunqueue — no new infrastructure.
import { Workflow, Engine } from 'bunqueue/workflow';
const orderFlow = new Workflow('order-pipeline')
.step('validate', async (ctx) => {
const { orderId, amount } = ctx.input as { orderId: string; amount: number };
if (amount <= 0) throw new Error('Invalid amount');
return { orderId };
})
.step('reserve-stock', async () => {
await inventory.reserve();
return { reserved: true };
}, {
compensate: async () => await inventory.release(), // Auto-rollback on failure
})
.step('charge', async () => {
return { txId: await payments.charge() };
}, {
compensate: async () => await payments.refund(),
})
.step('confirm', async (ctx) => {
const { txId } = ctx.steps['charge'] as { txId: string };
return { emailSent: true, txId };
});
const engine = new Engine({ embedded: true });
engine.register(orderFlow);
await engine.start('order-pipeline', { orderId: 'ORD-1', amount: 99.99 });
Features:
.parallel()waitFor('event') pauses execution, engine.signal() resumes itwaitFor('event', { timeout }) fails if signal doesn't arrive in time.subWorkflow(), child results passed backdoUntil() and doWhile() for conditional iteration with safety limitsstep:0, step:1, ...).map().parse() schemaengine.subscribe(id, callback) to monitor a specific execution's eventsengine.on/onAny)engine.cleanup() / engine.archive() for execution history managementvs Competitors:
| **bunqueue** | **Temporal** | **Inngest** | **Trigger.dev** | |
|---|---|---|---|---|
| **Infrastructure** | None (embedded) | PostgreSQL + 7 services | Cloud-only | Redis + PostgreSQL |
| **Saga compensation** | Built-in | Manual | Manual | Manual |
| **Human-in-the-loop** | .waitFor() | Signals API | step.waitForEvent() | Waitpoint tokens |
| **Self-hosted** | Zero-config | Complex | No | Complex |
| **Pricing** | Free (MIT) | Free / Cloud $$ | Per-execution | Free tier, then $50/mo+ |
// Branching
const flow = new Workflow('tiered')
.step('classify', async (ctx) => {
const { amount } = ctx.input as { amount: number };
return { tier: amount > 1000 ? 'vip' : 'basic' };
})
.branch((ctx) => (ctx.steps['classify'] as { tier: string }).tier)
.path('vip', (w) => w.step('vip-handler', async () => ({ discount: 20 })))
.path('basic', (w) => w.step('basic-handler', async () => ({ discount: 0 })))
.step('done', async () => ({ processed: true }));
// Human-in-the-loop
const approvalFlow = new Workflow('expense')
.step('submit', async (ctx) => {
const { amount } = ctx.input as { amount: number };
return { amount };
})
.waitFor('manager-approval')
.step('reimburse', async (ctx) => {
const decision = ctx.signals['manager-approval'] as { approved: boolean };
return { status: decision.approved ? 'paid' : 'rejected' };
});
// Signal a waiting workflow
await engine.signal(run.id, 'manager-approval', { approved: true });
---
<p align="center"> <strong>bunqueue Dashboard</strong><br/> <sub>A visual interface for managing queues, jobs, workers and monitoring in real time. Currently in beta.</sub> </p>
https://github.com/user-attachments/assets/e8a8d38e-b4a6-4dc8-8360-876c0f24d116
<p align="center"> <sub>Want early access? Reach out at <b>egeominotti@gmail.com</b></sub> </p>
---
高性能作业队列,支持多种持久化和备份方式
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,Bun 队列 在Agent工作流赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | bunqueue |
| 原始描述 | 开源AI工作流:⚡ High-performance job queue for Bun. SQLite persistence, DLQ, cron jobs, S3 bac。⭐473 · TypeScript |
| Topics | aiai-agentsai-schedulerbackground-jobstypescript |
| GitHub | https://github.com/egeominotti/bunqueue |
| License | MIT |
| 语言 | TypeScript |
收录时间:2026-05-30 · 更新时间:2026-05-30 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端