From f319563d99a816529d696bc60308a052d73fd97b Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 30 Mar 2026 11:14:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BAcontent-queue/content-output?= =?UTF-8?q?=20directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nClaw (FKA Moltbot, ClawdBot) AI Agents.md | 0 .../yunce/N8N 内容转化流水线工作流设计.md | 367 ------------------ 2 files changed, 367 deletions(-) rename openclaw/{memory-setup => content-queue}/We Built Persistent Memory for OpenClaw (FKA Moltbot, ClawdBot) AI Agents.md (100%) delete mode 100644 openclaw/yunce/N8N 内容转化流水线工作流设计.md diff --git a/openclaw/memory-setup/We Built Persistent Memory for OpenClaw (FKA Moltbot, ClawdBot) AI Agents.md b/openclaw/content-queue/We Built Persistent Memory for OpenClaw (FKA Moltbot, ClawdBot) AI Agents.md similarity index 100% rename from openclaw/memory-setup/We Built Persistent Memory for OpenClaw (FKA Moltbot, ClawdBot) AI Agents.md rename to openclaw/content-queue/We Built Persistent Memory for OpenClaw (FKA Moltbot, ClawdBot) AI Agents.md diff --git a/openclaw/yunce/N8N 内容转化流水线工作流设计.md b/openclaw/yunce/N8N 内容转化流水线工作流设计.md deleted file mode 100644 index f04318aa..00000000 --- a/openclaw/yunce/N8N 内容转化流水线工作流设计.md +++ /dev/null @@ -1,367 +0,0 @@ -# N8N 内容转化流水线工作流设计 - -> 用于:AI 英文文章 → 中文公众号/X/视频 内容转化 -> 触发方式:OpenClaw 通过 Webhook 调用 -> 管理平台:Mac mini 上的 n8n - ---- - -## 📋 工作流概述 - -``` -OpenClaw (发现文章) - ↓ (保存 Obsidian) - ↓ (触发 Webhook) - -┌─────────────────────────────────────────────────────────────┐ -│ N8N 工作流: content-translation-pipeline │ -│ │ -│ [Webhook] → [Read Obsidian] → [AI 翻译改写] → [配图搜索] │ -│ ↓ │ -│ [写回 Obsidian] → [通知 OpenClaw] │ -└─────────────────────────────────────────────────────────────┘ -``` - ---- - -## 🔌 节点详细设计 - -### 节点 1️⃣:Webhook Trigger(触发器) - -**类型:** Webhook -**名称:** `webhook_trigger` - -**配置:** -- Method: POST -- Path: `/content-translation` -- Authentication: None(内部网络调用) - -**接收数据格式:** -```json -{ - "note_path": "/Users/weishen/Workspace/nexus/openclaw/content-queue/2026-03-29-ai-solopreneur.md", - "source_url": "https://original-article-url", - "action": "translate", - "platforms": ["wechat", "twitter", "video"], - "callback_url": "http://192.168.3.189:18789/webhook/yunce" -} -``` - -**输出:** 向下游节点传递完整 payload - ---- - -### 节点 2️⃣:Read Obsidian Note(读取原文笔记) - -**类型:** HTTP Request(调用 Obsidian Local REST API 插件) -**名称:** `read_obsidian_note` - -**配置:** -- Method: GET -- URL: `http://localhost:27123/vault/{{ $json.note_path }}` -- Headers: - - `Content-Type: application/json` - -**备选方案(如果没有 Obsidian REST API):** -使用 n8n Filesystem 节点直接读取文件路径。 - -**输出变量:** -- `original_title`(原文标题) -- `original_content`(原文内容) -- `source_url`(文章来源) -- `tags`(标签) - ---- - -### 节点 3️⃣:AI 翻译与本土化(核心节点) - -**类型:** AI Agent(n8n 内置) -**名称:** `translate_and_adapt` - -**配置:** -- Provider: OpenAI / Claude(通过环境变量配置) -- Model: gpt-4o 或 claude-3-5-sonnet - -**Prompt 模板:** -``` -你是一个专业的中文内容编辑,擅长将英文文章转化为适合中国读者的高质量内容。 - -## 你的任务 - -将以下英文原文转化为: -1. 公众号风格的深度文章(2000-3000字) -2. X/Twitter 风格的短文案(280字内,带钩子) -3. 视频口播脚本(3-5分钟,适合抖音/YouTube) - -## 内容要求 - -- 语言:地道中文,无翻译腔 -- 风格:专业、有干货、适合中国读者 -- 调性:公众号大V风格,有观点有案例 -- 商业化:可自然植入 AI Agent / 知识管理相关内容(软性,不硬广) - -## 文章主题方向(供校准时参考) -- AI Agent 落地实践与工具推荐 -- AI 赋能商业的最佳实践 -- AI 时代的网络安全与运维 - -## 输出格式(严格按此 JSON 返回) - -{ - "wechat_title": "中文标题", - "wechat_excerpt": "公众号摘要(100字内)", - "wechat_content": "完整公众号文章(Markdown格式)", - "twitter_copy": "X/Twitter文案(280字内,带emoji)", - "video_title": "视频标题", - "video_script": "口播脚本(含时间戳和字幕)", - "cover_keywords": ["关键词1", "关键词2", "关键词3"] -} - -## 原文内容 -{{ $json.original_content }} -``` - -**输出变量:** -- `wechat_title` -- `wechat_excerpt` -- `wechat_content` -- `twitter_copy` -- `video_title` -- `video_script` -- `cover_keywords[]` - ---- - -### 节点 4️⃣:搜索封面图 - -**类型:** HTTP Request -**名称:** `search_cover_image` - -**配置:** -- Method: GET -- URL: `https://api.unsplash.com/search/photos` -- Query Parameters: - - `query`: 第一张封面图关键词(取 cover_keywords[0]) - - `per_page`: 1 - - `orientation`: landscape -- Headers: - - `Authorization`: `Client-ID {{ $env.UNSPLASH_API_KEY }}` - -**备选:** Pexels API(如果用 Pexels) -**备选:** 直接用搜索引擎图片 API - -**输出变量:** -- `cover_image_url` -- `cover_image_credit`(图片来源归因) - ---- - -### 节点 5️⃣:构建 Obsidian 成品笔记 - -**类型:** Code(数据转换) -**名称:** `build_output_note` - -**功能:** 将 AI 输出组装成 Obsidian 笔记的 Markdown 内容 - -**输出内容:** -```markdown ---- -source: {{ source_url }} -title: {{ wechat_title }} -excerpt: {{ wechat_excerpt }} -cover_image: {{ cover_image_url }} -date: {{ current_date }} -tags: [ai-agent, translated, ready-to-publish] -status: ready-to-publish -platforms: - - wechat - - twitter - - video ---- - -# {{ wechat_title }} - -{{ wechat_content }} - ---- - -## X/Twitter 文案 - -{{ twitter_copy }} - ---- - -## 视频信息 - -**标题:** {{ video_title }} - -**口播脚本:** - -{{ video_script }} - ---- - -*封面图来源:{{ cover_image_credit }}* -``` - -**输出变量:** -- `output_note_path`: `原笔记路径` → `output/成品笔记文件名.md` -- `output_content`: Markdown 内容 - ---- - -### 节点 6️⃣:写回 Obsidian(保存成品) - -**类型:** HTTP Request(POST 到 Obsidian REST API) -**名称:** `write_obsidian_note` - -**配置:** -- Method: PUT 或 POST -- URL: `http://localhost:27123/vault/{{ $json.output_note_path }}` -- Body: `{{ $json.output_content }}` -- Headers: - - `Content-Type: text/markdown` - -**备选方案:** Filesystem Write 节点直接写文件 - ---- - -### 节点 7️⃣:通知 OpenClaw(回调) - -**类型:** HTTP Request -**名称:** `notify_openclaw` - -**配置:** -- Method: POST -- URL: `{{ $json.callback_url }}` -- Body: -```json -{ - "status": "completed", - "input_note": "{{ $json.input_note_path }}", - "output_note": "{{ $json.output_note_path }}", - "wechat_title": "{{ $json.wechat_title }}", - "twitter_copy": "{{ $json.twitter_copy }}", - "video_title": "{{ $json.video_title }}", - "cover_image": "{{ $json.cover_image_url }}" -} -``` - ---- - -### 节点 8️⃣:Error Handler(错误处理) - -**类型:** Error Trigger(全局) -**名称:** `error_handler` - -**功能:** -- 捕获任意节点错误 -- 发送错误通知到 OpenClaw -- 记录错误日志 - ---- - -## 🔗 完整节点连接图 - -``` -┌─────────────────┐ -│ Webhook │ (接收 OpenClaw 调用) -│ webhook_trigger│ -└────────┬────────┘ - │ - ▼ -┌─────────────────┐ -│ Read Obsidian │ (读取原始笔记) -│ read_obsidian │ -└────────┬────────┘ - │ - ▼ -┌─────────────────┐ -│ AI Agent │ (翻译+改写+脚本) -│ translate_ │ -│ and_adapt │ -└────────┬────────┘ - │ - ▼ -┌─────────────────┐ -│ Search Image │ (Unsplash API) -│ search_cover │ -└────────┬────────┘ - │ - ▼ -┌─────────────────┐ -│ Code │ (组装 Markdown) -│ build_output │ -└────────┬────────┘ - │ - ▼ -┌─────────────────┐ -│ Write Obsidian │ (保存成品笔记) -│ write_note │ -└────────┬────────┘ - │ - ▼ -┌─────────────────┐ -│ HTTP Request │ (回调 OpenClaw) -│ notify_openclaw│ -└─────────────────┘ -``` - ---- - -## 🔧 环境变量要求 - -```bash -# n8n 所在服务器环境变量 -export OPENAI_API_KEY="sk-..." # AI 翻译用 -export UNSPLASH_API_KEY="..." # 图片搜索用 -export OBSIDIAN_VAULT_PATH="/Users/weishen/Workspace/nexus" -``` - ---- - -## 📁 Obsidian 目录结构 - -``` -nexus/ -├── openclaw/ -│ ├── content-queue/ # 原始文章待处理 -│ │ └── 2026-03-29-ai-solopreneur.md -│ └── content-output/ # 成品输出 -│ └── 2026-03-29-ai-solopreneur-translated.md -``` - ---- - -## 🔄 调用方式(OpenClaw 侧) - -```bash -# 触发 n8n 工作流 -curl -X POST "http://macmini.local:5678/webhook/content-translation" \ - -H "Content-Type: application/json" \ - -d '{ - "note_path": "/Users/weishen/Workspace/nexus/openclaw/content-queue/2026-03-29-ai-solopreneur.md", - "source_url": "https://original-article-url", - "action": "translate", - "platforms": ["wechat", "twitter", "video"], - "callback_url": "http://192.168.3.189:18789/webhook/yunce" - }' -``` - ---- - -## ✅ 验收标准 - -1. Webhook 被调用后,整个流程自动完成 -2. 成品笔记包含所有字段(标题、摘要、正文、推文、脚本、封面图) -3. OpenClaw 收到完成回调 -4. 任意节点失败时,错误被捕获并通知 - ---- - -## 📝 后续扩展方向(Phase 2) - -- 加入人工审核节点(审批后再发布) -- 加入多语言支持(英文 + 中文) -- 加入视频字幕生成(Whisper API) -- 加入定时调度(自动抓取 RSS → 自动翻译)