hatchet
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "hatchet":https://skillpi.com/zh/skills/deepskill-acf5a552690ffabd62a025092adb0e83b448e815012f31e8ec1f9b7730e5b009。安装前核对上游来源和版本:https://skillhub.cn/skills/user_3c6cb52e/run-durable-agent-tasks-and-event-driven-workflows-with-hatchet。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
skillhub.cn
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
用于排队、重试、暂停、恢复、观察和扩展长时间运行的代理任务与后台工作流。
介绍来源: third_party · user_3c6cb52e · 1.0.0 参考来源
SkillPi 解读
- 适合谁
- 翻译待完成,请参阅来源文档。
- 软件、账号及付费要求
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: hatchet
description: >-
Orchestrate background jobs and workflows with Hatchet — open-source
distributed task queue with DAG workflows. Use when someone asks to "run
background jobs", "Hatchet", "workflow orchestration", "distributed task
queue", "durable execution", "replace Celery/Bull", or "DAG workflow engine".
Covers workflow definition, step functions, retries, concurrency control,
and event-driven triggers.
license: Apache-2.0
compatibility: "TypeScript/Python/Go. Self-hostable or Hatchet Cloud."
metadata:
author: terminal-skills
version: "1.0.0"
category: development
tags: ["workflows", "background-jobs", "hatchet", "queue", "orchestration"]Hatchet
Overview
Hatchet is an open-source distributed task queue and workflow engine. Define workflows as DAGs (directed acyclic graphs), run steps with automatic retries and timeouts, control concurrency, and trigger workflows from events or schedules. Like Temporal but lighter, like BullMQ but with workflow orchestration. Built for background jobs that need reliability: payment processing, data pipelines, AI agent orchestration.
When to Use
- Background jobs that need reliability (retries, timeouts, idempotency)
- Multi-step workflows (onboarding, order processing, data pipelines)
- Fan-out/fan-in patterns (process items in parallel, aggregate results)
- Rate-limited API calls (concurrency control per workflow)
- Replacing BullMQ/Celery with something more structured
Instructions
Setup
npm install @hatchet-dev/typescript-sdk
# Self-host
docker compose up -d # From hatchet-dev/hatchet repo
Define a Workflow
// workflows/onboarding.ts — Multi-step user onboarding
import Hatchet from "@hatchet-dev/typescript-sdk";
const hatchet = Hatchet.init();
const onboardingWorkflow = hatchet.workflow({
name: "user-onboarding",
on: { event: "user:created" },
timeout: "10m",
});
// Step 1: Send welcome email
onboardingWorkflow.step("send-welcome-email", async (ctx) => {
const { userId, email } = ctx.input();
await sendEmail(email, {
subject: "Welcome!",
template: "welcome",
});
return { emailSent: true };
}, { retries: 3, timeout: "30s" });
// Step 2: Set up default workspace (runs after step 1)
onboardingWorkflow.step("create-workspace", async (ctx) => {
const { userId } = ctx.input();
const workspace = await createWorkspace(userId, "My Workspace");
return { workspaceId: workspace.id };
}, {
parents: ["send-welcome-email"],
retries: 2,
timeout: "1m",
});
// Step 3: Generate sample data (runs after workspace created)
onboardingWorkflow.step("seed-data", async (ctx) => {
const { workspaceId } = ctx.stepOutput("create-workspace");
await seedSampleData(workspaceId);
return { seeded: true };
}, {
parents: ["create-workspace"],
timeout: "2m",
});
// Step 4: Send getting-started guide (runs after email + workspace)
onboardingWorkflow.step("send-guide", async (ctx) => {
const { email } = ctx.input();
await sendEmail(email, {
subject: "Getting Started Guide",
template: "getting-started",
});
}, {
parents: ["send-welcome-email", "create-workspace"],
retries: 3,
});
Trigger Workflows
// src/api/users.ts — Trigger from your application
import Hatchet from "@hatchet-dev/typescript-sdk";
const hatchet = Hatchet.init();
// Event-based trigger
await hatchet.event.push("user:created", {
userId: "user_123",
email: "kai@example.com",
plan: "pro",
});
// Direct trigger
const run = await hatchet.workflow.run("user-onboarding", {
userId: "user_123",
email: "kai@example.com",
});
// Wait for result
const result = await run.result();
console.log(result); // { emailSent: true, workspaceId: "ws_xxx", seeded: true }
Concurrency Control
// workflows/api-sync.ts — Rate-limited external API calls
const syncWorkflow = hatchet.workflow({
name: "api-sync",
concurrency: {
maxRuns: 5, // Max 5 concurrent workflow runs
limitStrategy: "QUEUE", // Queue excess, don't drop
},
});
syncWorkflow.step("fetch-data", async (ctx) => {
const { apiEndpoint } = ctx.input();
const data = await fetch(apiEndpoint).then(r => r.json());
return { records: data.length };
}, {
retries: 3,
backoff: { type: "exponential", base: 2 },
timeout: "30s",
concurrency: { key: "api-provider", maxRuns: 10 }, // Per-key limit
});
Scheduled Workflows
// workflows/daily-report.ts — Cron-triggered workflow
const reportWorkflow = hatchet.workflow({
name: "daily-report",
on: { cron: "0 9 * * *" }, // 9 AM daily
});
reportWorkflow.step("generate", async (ctx) => {
const stats = await generateDailyStats();
return stats;
});
reportWorkflow.step("send", async (ctx) => {
const stats = ctx.stepOutput("generate");
await sendSlackReport(stats);
}, { parents: ["generate"] });
Examples
Example 1: Order processing pipeline
User prompt: "Build a reliable order processing workflow — validate, charge, fulfill, notify."
The agent will create a Hatchet workflow with sequential steps, payment retry logic, and parallel notification to customer + warehouse.
Example 2: AI agent orchestration
User prompt: "Run an AI pipeline: scrape data → process → generate report → email."
The agent will create a DAG workflow with fan-out scraping, aggregation step, LLM generation, and email delivery with retries.
Guidelines
- Workflows are DAGs — define step dependencies with
parents - Retries are per-step — each step can have its own retry policy
- Timeouts prevent hung jobs — always set per-step and per-workflow timeouts
- Concurrency control — limit parallel runs globally or per-key
- Events for decoupling — trigger workflows from events, not direct calls
ctx.stepOutput()passes data between steps — typed step results- Idempotency — design steps to be safely retried
- Self-hostable — Postgres + Hatchet engine
- Dashboard for monitoring — see running workflows, failed steps, retry history
- Backoff strategies — exponential, linear, or constant for retries
当前收录版本
1.0.0
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- Hatchet 提供高价值的分布式任务队列与 DAG 工作流编排能力,适用于支付处理、数据管道、AI 代理编排等核心业务场景,显著提升后台任务可靠性与效率。
亮点
- 触发词精准完整,覆盖 'background jobs'、'Hatchet'、'workflow orchestration' 等多种变体,边界清晰,便于用户准确触发。
亮点
- 文档结构清晰完整,包含端到端代码示例、使用场景说明与最佳实践指南,frontmatter 信息齐全,易于理解与执行。
亮点
- 提供可靠的错误处理机制(重试、超时、退避策略)、并发控制与事件驱动触发,工具来源明确,覆盖主要异常场景。
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 38 行
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
翻译待完成,请参阅来源文档。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。