海流 是 AI Skill Hub 本期精选n8n工作流之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
海流 是一款基于 TypeScript 开发的开源工具,专注于 n8n、ai、agent 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
海流 是一款基于 TypeScript 开发的开源工具,专注于 n8n、ai、agent 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:npm 全局安装 npm install -g haiflow # 方式二:npx 直接运行(无需安装) npx haiflow --help # 方式三:项目依赖安装 npm install haiflow # 方式四:从源码运行 git clone https://github.com/andersonaguiar/haiflow cd haiflow npm install npm start
# 命令行使用
haiflow --help
# 基本用法
haiflow [options] <input>
# Node.js 代码中使用
const haiflow = require('haiflow');
const result = await haiflow.run(options);
console.log(result);
// n8n 工作流配置步骤 // 1. 在 n8n 中点击 "Import Workflow" // 2. 粘贴 JSON 文件内容或上传文件 // 3. 配置必要的 Credentials: // - Settings → Credentials → New // - 选择对应服务类型填写 API Key // 4. 激活工作流 (Toggle ON) // 5. 通过 Webhook 或定时触发器运行
hooks · ai · flow
Run Claude Code as a headless AI agent over HTTP — no API key costs, no SDK, just your existing Claude Code subscription.
Haiflow wraps Claude Code in tmux sessions and exposes a REST API to trigger prompts, queue work, and capture responses. Automate anything you can do in Claude Code — code generation, refactoring, bug triage, daily reports — from any HTTP client.
Why not the Claude API? Claude Code includes tool use, file access, git integration, and your custom skills out of the box. Haiflow lets you automate all of that via HTTP without paying per-token API costs. Use n8n, cron, webhooks, or any automation tool to drive it.

POST /trigger ───┐
│ ┌────────────────┐
┌───▼───┐ │ tmux session │
│ Queue ├───>│ (claude) │
│ (FIFO)│ └───────┬────────┘
└───────┘ │
hooks fire on
session events
│
┌───────▼────────┐
│ Responses │
└───────┬────────┘
│
GET /responses/:id <──────────────┤
│
GET /responses/:id/stream <───────┘ (SSE)
docker run -d -p 6379:6379 redis.bun install
Haiflow uses Claude Code hooks to track session state. The setup command merges hook config into ~/.claude/settings.json:
bun run setup
The hooks are thin HTTP forwarders — they POST Claude Code events to the haiflow server. If the server isn't running, they silently no-op. They won't interfere with non-orchestrated Claude sessions (the server ignores unknown session IDs).
pipeline.json in your HAIFLOW_DATA_DIR (default /tmp/haiflow):{
"topics": {
"design.ready": {
"description": "Design agent completed its analysis",
"subscribers": [
{
"session": "developer",
"promptTemplate": "Implement this design:\n\n{{message}}"
}
]
},
"code.ready": {
"subscribers": [
{
"session": "code-reviewer",
"promptTemplate": "Review these changes:\n\n{{message}}"
}
]
}
},
"emitters": {
"design-agent": ["design.ready"],
"developer": ["code.ready"]
}
}
```bash
Haiflow works with any tool that can make HTTP requests. Here are a few examples:
Import the chained calc workflow from examples/chained-calc/: - chained-calc-step1.json — Step 1: calculate 2+2 - chained-calc-step2.json — Step 2: multiply result by 5 - chained-calc-step3.json — Step 3: multiply result by 10 - pipeline-calc-chain.json — Pipeline configuration that wires them together
bun run dev # starts server with hot reload ```
cp .env.example .env
| Variable | Default | Description |
|---|---|---|
PORT | 3333 | HTTP server port |
HAIFLOW_DATA_DIR | /tmp/haiflow | Directory for session state, queues, and responses |
HAIFLOW_PORT | 3333 | Port used by hook scripts (set if different from PORT) |
HAIFLOW_API_KEY | — | **Required.** Any string you choose — this is your own secret, not a paid key |
HAIFLOW_CWD | — | When set, every session is forced to use this cwd. The cwd field in /session/start request bodies is ignored (a warning is logged if it differs). |
HAIFLOW_ALLOW_REQUEST_CWD | true | When false, /session/start rejects requests that try to set their own cwd — HAIFLOW_CWD must be set on the server instead. |
HAIFLOW_GUARDRAILS | true | Installs ~/.claude/skills/haiflow-guardrails/SKILL.md on server boot and injects /haiflow-guardrails into each new tmux session. The skill instructs Claude to refuse paths outside cwd, refuse to read secrets, and refuse network exfiltration. |
REDIS_URL | redis://localhost:6379 | **Required.** Redis URL for event persistence and delivery tracking |
N8N_API_KEY | — | n8n API key for workflow integration |
HAIFLOW_USAGE_ALERT_TOKENS | — | When set, GET /usage/window flags alert: true once the rolling 5h token total crosses it (alert-only, never throttles) |
HAIFLOW_TASK_TIMEOUT_SEC | 0 | Optional hard per-task timeout. 0 disables it. The watchdog flags tasks that exceed it |
HAIFLOW_WAITING_GRACE_SEC | 120 | How long a session flagged waiting by Claude's Notification hook may stay blocked before the watchdog acts |
HAIFLOW_WATCHDOG_RECOVER | false | When true, the watchdog auto-recovers a wedged session (Escape, mark timed_out, drain). Default alert-only |
HAIFLOW_MAP_MAX_ITEMS | 200 | Max items one POST /map call may fan across a pool |
HAIFLOW_MAP_TIMEOUT_SEC | 1800 | How long a map run waits for stragglers before the reducer fires with partial results |
curl -s -H "Authorization: Bearer $HAIFLOW_API_KEY" \ http://localhost:3333/pipeline | jq .
See API.md for the full API reference — all endpoints, parameters, and examples.
Chain agents together with event-driven pub/sub. Each agent subscribes to topics it cares about and emits events when done — no hardcoded dependencies between agents.
Design Agent ──emit──▶ design.ready ──subscribe──▶ Developer Agent
Developer ──emit──▶ code.ready ──subscribe──▶ Code Reviewer
Reviewer ──emit──▶ review.done ──subscribe──▶ QA Agent
See Pipeline for setup.
The pipeline system lets you chain agents together using pub/sub topics. When an agent finishes a task, haiflow automatically emits its output to configured topics. Other agents subscribed to those topics receive the output as their next prompt.
curl -X POST http://localhost:3333/trigger \ -H "Authorization: Bearer $HAIFLOW_API_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt": "Analyse the Figma design at ...", "session": "design-agent"}' ```
高质量的开源n8n工作流项目
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,海流 在n8n工作流赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | haiflow |
| Topics | n8naiagentai-automation |
| GitHub | https://github.com/andersonaguiar/haiflow |
| License | MIT |
| 语言 | TypeScript |
收录时间:2026-06-24 · 更新时间:2026-06-24 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端