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. Memory or one-file SQLite; PostgreSQL 15–18 multi-broker when you scale.<br/> DLQ, cron, SQLite S3 backups, and native MCP. Built for AI agents and automation. No Redis. </p>
<p align="center"> <a href="https://bunqueue.dev/">Documentation</a> · <a href="https://bunqueue.dev/guide/quickstart/">Quick Start</a> · <a href="https://bunqueue.dev/academy/">Video course</a> · <a href="https://bunqueue.dev/guide/benchmarks/">Benchmarks</a> · <a href="https://www.npmjs.com/package/bunqueue">npm</a> </p>
---
All four images run the same bunqueue server with the same queue features, protocols, and persistence options. The difference is the Linux base and the tools available inside the container.
Starting with 2.9.5, completed releases publish to both Docker Hub (egeominotti/bunqueue) and GHCR (ghcr.io/egeominotti/bunqueue), with matching version, latest, and variant tags. Build references are kept on GHCR only. Each image supports linux/amd64 and linux/arm64; Docker selects the matching architecture automatically. You choose the distribution, not the CPU tag. Pin a version or digest for reproducible deployments. Confirm a tag exists with docker buildx imagetools inspect egeominotti/bunqueue:<tag> before using it.
Choose a Linux distribution with the same tags on either registry:
| Variant | Version tag | Moving tag | Runtime base |
|---|---|---|---|
| Alpine (default) | 2.9.20-alpine | alpine, latest | Alpine 3.22, musl |
| Debian | 2.9.20-debian | debian | Debian 13 |
| Debian slim | 2.9.20-slim | slim | Debian 13 slim |
| Distroless | 2.9.20-distroless | distroless | Debian 13, no shell or package manager |
Which variant should I use?
- Alpine is the default for a compact deployment. It uses musl and includes a shell and the apk package manager. Choose it when you do not need Debian tooling or glibc compatibility for additional software. - Debian uses glibc and the standard Debian base, with a shell and apt. Choose it when familiar Debian tools and a fuller base matter more than image size. Additional troubleshooting tools may still need to be installed. - Debian slim keeps glibc, a shell, and apt in a reduced Debian base. Choose it when you want Debian compatibility with fewer bundled utilities. - Distroless contains the compiled server and its required runtime libraries, without a shell or package manager. Choose it when you operate through logs, health checks, and external debugging tools; docker exec ... sh is unavailable.
The distribution does not select a faster queue engine or unlock extra features. All images run as a non-root user; having a package manager does not grant that user permission to install packages at runtime.
Try a specific variant by changing only the image tag:
docker run -d --name bunqueue --restart unless-stopped \
-p 127.0.0.1:6789:6789 -p 127.0.0.1:6790:6790 \
-v bunqueue-data:/app/data \
egeominotti/bunqueue:2.9.20-alpine
curl --fail http://127.0.0.1:6790/health
This example exposes the APIs only on your machine. Replace 2.9.20-alpine with 2.9.20-debian, 2.9.20-slim, or 2.9.20-distroless to choose another base. Moving tags such as alpine follow newer releases; version tags identify a release, while a digest pins the exact image even across base-image rebuilds.
Every variant supports both architectures, runs as UID/GID 1001:1001, and stores SQLite data in /app/data. Unsuffixed tags such as 2.9.20 stay on Alpine. Production images contain the compiled server and required system libraries; development dependencies and a separate Bun installation stay out of the image. The built-in health check uses /app/bunqueue healthcheck, including on distroless. See the deployment guide for custom probes.
Your first job in about a minute. On Bun the queue runs inside your app, with no server to start:
bun add bunqueue
// jobs.ts
import { Queue, Worker } from 'bunqueue/client';
const queue = new Queue<{ to: string }>('emails', { embedded: true });
const worker = new Worker<{ to: string }>(
'emails',
async (job) => {
console.log('Processing:', job.data.to);
return { sent: true };
},
{ embedded: true }
);
worker.on('error', (error) => console.error(error));
await queue.add('welcome', { to: 'hello@example.com' });
```bash bun jobs.ts
```
That's it: no Redis, no config, no setup. The worker keeps waiting for more jobs until you stop it with Ctrl+C. The example keeps jobs in memory; pass dataPath: './jobs.db' to the queue and the worker to persist them in one SQLite file. msgpackr is the only runtime dependency; cron, SQLite, S3, HTTP and WebSocket use Bun's built-ins.
Deno, Python, PHP, Go, Rust and Elixir take the same three steps: see the
[Quick Start](https://bunqueue.dev/guide/quickstart/) for each language.
For multiple active brokers, the repository includes a topology pinned to
PostgreSQL 18.6:
bash POSTGRES_PASSWORD='replace-me' \ BUNQUEUE_POSTGRES_URL='postgres://bunqueue:replace-me@postgres:5432/bunqueue' \ docker compose -f docker-compose.postgres.yml up --build -d ```
It starts two brokers against one database/namespace. PostgreSQL is server-only; embedded mode keeps using memory/SQLite. Supply both Compose values when the password changes, percent-encoding reserved characters in the URL only. MySQL is not supported. CI validates PostgreSQL 15, 16, 17, and the pinned/recommended 18.6 release. See the storage guide.
The server does all the heavy lifting. Official client SDKs share the protocol-conformant core Queue, Worker, and Flow surface, so producers and workers can live anywhere in your stack — add a job from TypeScript, process it from Python. Language-specific capabilities are tracked in the SDK guide.
| Where your code runs | Install |
|---|---|
| **Node.js ≥ 20, Deno ≥ 2, Bun, Cloudflare Workers** | [npm install bunqueue-client](https://www.npmjs.com/package/bunqueue-client) |
| **Python ≥ 3.9** | [pip install bunqueue-client](https://pypi.org/project/bunqueue-client/) |
| **PHP ≥ 8.1** | [composer require bunqueue/client](https://packagist.org/packages/bunqueue/client) |
| **Go ≥ 1.26.5** | go get github.com/egeominotti/bunqueue/sdk/go |
| **Rust ≥ 1.85** | [cargo add bunqueue-client](https://crates.io/crates/bunqueue-client) |
| **Elixir ≥ 1.15** | Hex coming soon — today: use [sdk/elixir](./sdk/elixir) as a path dependency |
// Node.js / Deno / Cloudflare Workers
import { Queue, Worker } from 'bunqueue-client';
const queue = new Queue('emails', { connection: { host: 'localhost', port: 6789 } });
await queue.add('welcome', { to: 'user@example.com' });
new Worker('emails', async (job) => ({ sent: true }), { concurrency: 10 });
```python
Every official FlowProducer resolves all job IDs and reciprocal dependency edges locally, then sends one PUSHF command. The broker validates the complete graph and commits it atomically, so a worker cannot observe a leaf from a partially-created flow.
import { FlowProducer } from 'bunqueue-client';
const flows = new FlowProducer({ connection: { host: 'localhost', port: 6789 } });
const root = await flows.add({
name: 'publish-release',
queueName: 'release',
data: { version: 'candidate-42' },
children: [
{ name: 'unit-tests', queueName: 'checks', data: { suite: 'unit' } },
{ name: 'sdk-tests', queueName: 'checks', data: { suite: 'sdk' } },
],
});
console.log(
root.job.id,
root.children?.map(({ job }) => job.id)
);
await flows.close();
The repository records the contracts and the test strategy beside each implementation:
| SDK | Runtime invariants | Generated tests | Mutation engine |
|---|---|---|---|
| [TypeScript](./sdk/typescript/README.md) | [contract](./sdk/typescript/INVARIANTS.md) | fast-check | none¹ |
| [Python](./sdk/python/README.md) | [contract](./sdk/python/INVARIANTS.md) | Hypothesis | mutmut |
| [PHP](./sdk/php/README.md) | [contract](./sdk/php/INVARIANTS.md) | Eris | Infection |
| [Go](./sdk/go/README.md) | [contract](./sdk/go/INVARIANTS.md) | Rapid | Gremlins |
| [Rust](./sdk/rust/README.md) | [contract](./sdk/rust/INVARIANTS.md) | proptest | cargo-mutants |
| [Elixir](./sdk/elixir/README.md) | [contract](./sdk/elixir/INVARIANTS.md) | StreamData | Muex |
¹ The TypeScript SDK has no mutation engine. StrykerJS was removed because its dependency graph produced every advisory the weekly audit had to answer for, none of it reachable from the published client; the planners keep their fast-check coverage.
Property campaigns run in the ordinary SDK gate with deterministic replay seeds. Mutation campaigns run separately against the pure planners and snapshot validators. Contributors can reproduce the complete isolated SDK gate with bun run test:sandbox:sdk; language-specific commands live in each SDK README and AGENTS.md.
Multi-step orchestration with saga compensation, branching, parallel steps and human-in-the-loop signals — built on bunqueue, no new infrastructure:
import { Workflow, Engine } from 'bunqueue/workflow';
const orderFlow = new Workflow('order-pipeline')
.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(),
}
)
.waitFor('manager-approval', { timeout: 86_400_000 }) // human-in-the-loop
.step('confirm', async (ctx) => {
return { txId: (ctx.steps['charge'] as { txId: string }).txId };
});
const engine = new Engine({ embedded: true });
engine.register(orderFlow);
const run = await engine.start('order-pipeline', { orderId: 'ORD-1' });
await engine.signal(run.id, 'manager-approval', { approved: true });
| **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+ |
Also included: nested workflows, doUntil/doWhile loops, forEach over dynamic lists, schema validation (Zod, ArkType, Valibot or any .parse()), step timeouts, typed events, SQLite-persisted execution state.
高性能作业队列,支持多种持久化和备份方式
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 类型,复制安装指令后粘贴到对应客户端