用 Claude AI 自动生成并发布 SEO 文章到 Webflow
定时从 Google Sheets 读取选题 → 抓取竞品文章并分析结构 → Claude 重写 SEO 内容 → 自动配图 → 质量评估后发布到 Webflow
- 给谁
- 需要批量生产 SEO 内容并自动发布到 Webflow 的内容团队
- 你会得到
- 每日自动产出完整 SEO 文章(含配图)并发布到 CMS,减少人工干预
- 你需要
- n8n · google-sheets · replicate · webflow · slack
硬约束
前置条件:n8n 实例;配置 OAuth2 凭证(Google Sheets、Slack、Webflow)与 API Key(OpenAI、Anthropic、Replicate);Google Sheets 需有 Blogs (ideas) 工作表,含 URL、Top keyword、Completed 等列;Webflow 需有对应 siteId 与 collectionId。流程每 2 小时触发一次。注意:SEO 评估子流程(Execute Workflow)为外部私有工作流,模板未公开;Replicate 调用需替换 Bearer token;Slack 通知节点默认禁用。
他们做了什么
作者 perspectalog 在 n8n 上发布了一个 30 节点的公开模板,用于每日自动生成 SEO 文章并发布到 Webflow。流程从 Google Sheets 读取未完成的博客选题,抓取竞品文章后先用 Claude Haiku 3.5 分析页面结构,再用 Claude Sonnet 4 重写为带内链的 SEO 文章,经外部 SEO 评估子流程打分达标后,由 o4-mini 生成配图提示词,调用 Replicate FLUX 1.1 Pro 生图,最终发布到 Webflow CMS 并回写 Sheets 标记完成。
效果如何
作者描述该流程为「每日自动发布新鲜 SEO 文章的内容引擎」(author_report)。模板在 n8n.io 获得 14,225 次浏览。Slack 节点提供可选人工审核,但默认禁用。
值得知道
1)SEO 评估子流程(workflowId: 7FHTcSuCIjHvvBfe)为作者私有,模板未公开其实现,复现时需自行搭建或替换评估逻辑;2)Replicate token、Webflow siteId/collectionId 为占位符,必须替换为实际值;3)Content writer 提示词包含特定品牌(ProductAI)与固定 CTA 链接(create.productai.photo),复现前需根据实际业务修改;4)Auto-fixing Output Parser 的 prompt 字段包含未闭合模板变量 {{completed}} 与 {error},为 LangChain 自动填充设计;5)本站未实际运行该工作流,reproduction=not_tested。
n8n 工作流模板
结构已检查 · 未实际运行下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。
配置与测试清单
需要绑定的凭证
- Google Sheets 节点:绑定Google Sheets OAuth2 凭证。
- Slack 节点:绑定Slack OAuth2 凭证。
- Google Sheets1 节点:绑定Google Sheets OAuth2 凭证。
- Webflow 节点:绑定webflowOAuth2Api 凭证。
- OpenAI Mini model 节点:绑定OpenAI API 凭证。
- Send error 节点:绑定Slack OAuth2 凭证。
- Haiku 节点:绑定Anthropic API 凭证。
- Thinking Claude 节点:绑定Anthropic API 凭证。
- Get Articles 节点:绑定webflowOAuth2Api 凭证。
- 将 __UKH_BEARER_6__ 替换为实际密钥/令牌(原路径 /nodes/6/parameters/headerParameters/parameters/0/value;literal auth header)。
需要替换的配置
- 源模板来自 n8n 公开库 #5374(约 30 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
- Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。
测试输入与预期结果
- 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
- 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。
模板处理说明
- 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
- 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。 另将 1 处字面量密钥替换为 __UKH_…__ 占位符。
模板获取日期: 2026-10-24
步骤
配置定时触发器
在 n8n 中添加 Schedule Trigger 节点,设置每 2 小时执行一次(rule.interval.hoursInterval = 2)。保存并激活工作流。
从 Google Sheets 读取未完成的选题
添加 Google Sheets 节点,连接 googleSheetsOAuth2Api 凭证。选择文档 Example SEO research(documentId)与工作表 Blogs (ideas)(sheetName)。在 filtersUI 中设置 lookupColumn=Completed、lookupValue=false,仅读取未完成的行。输出字段包括 URL、Top keyword、row_number 等。
抓取并清洗来源文章
添加 HTTP Request 节点,URL 设为 {{ $('Google Sheets').item.json.URL }},抓取竞品文章原始 HTML。随后添加 Code 节点,运行以下 JavaScript 清洗:截取 <body> 内容,移除 <header>、<script>、<iframe> 标签,保留正文供后续分析。
运行提示词 · 来源原文。Code 节点的 JS Code 字段
const items = $input.all(); const updatedItems = items.map((item) => { let html = item?.json?.data; // Trim to body let bodyStart = html.indexOf("<body>"); let bodyEnd = html.indexOf("</body>") + 7; html = html.slice(bodyStart, bodyEnd); // Remove header html = html.replace(/<header>[\s\S]*?<\/header>/g, ""); // Remove scripts html = html.replace(/<script>[\s\S]*?<\/script>/g, ""); // Remove iframes html = html.replace(/<iframe[\s\S]*?<\/iframe>/g, ""); item.json.data = html; return item; }); return updatedItems;AI 分析页面结构
添加 AI Agent 节点(Page structure analiser),模型连接 Haiku(claude-3-5-haiku-20241022)。该节点接收清洗后的 HTML,输出页面结构要点(如 content、faq、testimonials 等区块及各区块 SEO 关键点),供内容重写参考。
运行提示词 · 来源原文。Page structure analiser AI Agent 的 Text 字段
=You are an expert SEO writer. You will get page data return me bulltpoints for what sections are being used in this webpage. for example: - content - faq - testimonials {{ $json.data }} For each section also give me what is the key point for SEOClaude 重写 SEO 文章
添加 AI Agent 节点(Content writer),模型连接 Thinking Claude(claude-sonnet-4-20250514,maxTokensToSample=4096)。该节点同时连接 Get Articles(webflowTool,获取现有文章 URL 作为内链素材)与 Auto-fixing Output Parser。输入包括:来源文章 URL(Google Sheets)、页面结构(上一步输出)、主关键词(Top keyword)。输出必须为 JSON,含 article(HTML Markdown)与 summary 字段。
运行提示词 · 来源原文。Content writer AI Agent 的 Text 字段
=You are an expert SEO writer working for www.productai.photo. Rewrite the following article directly and return the full SEO-optimized version **in one complete response**, in **JSON** format with the following structure: { "article": "HTML Markdown-formatted article goes here", "summary": "1–2 sentence summary of the article here" } Return only the requested output with no explanations, commentary, or additional text. ## Guidelines: - Use the primary keyword:{{ $('Google Sheets').item.json['Top keyword'] }} throughout the article, naturally and repeatedly. - Follow this exact structure based on the original HTML: 1. Header Navigation (SEO context) 2. Hero Section (main headline + paragraph) 3. Main Content Sections (H2s, H3s, internal links <a> tags) 4. Use Case Explanations 5. Step-by-Step Tutorial (numbered list with headings) 6. Call-to-Action Section (use link: create.productai.photo) 8. Technical SEO elements (image alt text, responsive, semantic) ## Markdown Formatting: - Don't use H1 for the article title, start with H2. - Use H2 html tag for main sections and H3 html tag for subsections. - Short paragraphs, clear headings, internal links where relevant. - All CTA buttons or links use <a> tag must point to: **create.productai.photo** - Add **bold**, *italic*, and lists <li> where helpful. - User rich text elements HTML: * Paragraphs * Heading tags (H1-H6) * Images * Image captions * Image alt attributes * Custom code * Block quotes * Unordered lists (bulleted) * Ordered lists (numbered) * Videos (Youtube, Vimeo) * Rich media (Google maps, SoundCloud, Imgur, Giphy, Codepen, and more) ## Output Rules: - DO NOT say “I will now rewrite...” or "I'll rewrite the article based on your requirements. " explain anything, just return the article. - DO NOT include planning or step-by-step generation. - Just return the **fully rewritten markdown article** in the required JSON structure. - Include a brief SEO-friendly summary. - Instead of a competition company name like (PixelCut, pixelcut, CreatorKit, Soona, Pebblely), ALWAYS use "ProductAI" ## Source Article: Rewrite the following article: {{ $('Google Sheets').item.json.URL }} ## Content Structure: {{ $json.output }} ## Take internal links from webflow tool检查文章是否成功生成
添加 If 节点(Article written?),条件为 output.article 非空。若为空,走错误分支到 Slack 发送通知;若有内容,进入 SEO 评估。
执行外部 SEO 质量评估
添加 Execute Workflow 节点,调用外部子流程 Shape workflows — SEO Content evaluator(workflowId: 7FHTcSuCIjHvvBfe)。输入 article 与 summary,返回多维度评分数组。注意:该子流程为作者私有,模板未提供实现细节。
判断质量是否达标
添加 If 节点(Is it good enough?),检查三个维度评分:output[1].percent_ok > 60、output[5].percent_ok > 60、output[8].percent_ok > 50。全部满足则进入配图与发布;否则返回 Content writer 重新生成。
生成配图提示词
添加 AI Agent 节点(Prompt engineer),模型连接 OpenAI Mini model(o4-mini)。输入为 Content writer 生成的 article 全文,输出为适合 Midjourney/DALL-E/FLUX 的详细视觉提示词。
运行提示词 · 来源原文。Prompt engineer AI Agent 的 Text 字段
=You are an expert at generating detailed prompts for AI image generators (like Midjourney or DALL-E) to create eye-catching, clickable thumbnail images. Your Task: Given the full text of an article, analyze and identify its main topic and tone. Based on your analysis, create a clear, visually descriptive prompt suitable for generating a thumbnail image that will attract viewers and convey the essence of the article. Guidelines: Highlight the article’s key theme, main characters or elements, and any emotions you want the image to evoke. Suggest specific visuals, colors, moods, and, if suitable, stylish text overlays. Keep the prompt concise but rich in visual detail so the resulting image will be engaging and informative. Avoid vague terms—be as specific as possible. Example Input: (Article about the rise of electric vehicles and their impact on the auto industry.) Example Output: "Create a bold, modern thumbnail depicting a sleek electric car zooming down a futuristic highway with city skyscrapers in the background. Use vibrant blues and greens to symbolize innovation and eco-friendliness. Add stylized lightning bolts and a glowing 'EV Revolution' text overlay. Convey excitement and progress." Article: {{ $('Content writer').item.json.output.article }}调用 Replicate 生成配图
添加 HTTP Request 节点,POST 到 https://api.replicate.com/v1/models/black-forest-labs/flux-1.1-pro/predictions。Header 包含 Authorization: Bearer <token>(需替换为实际 token)与 Prefer: wait。Body 为 JSON,包含 prompt(上一步输出,需去除引号与换行)、aspect_ratio=16:9、output_format=png 等参数。
等待并获取图片 URL
添加 Wait 节点,等待 30 秒(Replicate 异步生成)。随后添加 get_image_url HTTP Request 节点,URL 为 {{ $json.urls.get }},Header 携带 Authorization: Bearer <token>,获取最终图片地址。
可选:Slack 通知人工审核
添加 Slack 节点(默认 disabled=true),发送文章标题与缩略图到指定频道,支持 sendAndWait 人工确认。如需启用,连接 slackOAuth2Api 并设置 channelId。
发布到 Webflow 并标记完成
添加 Webflow 节点,operation=create,选择 siteId 与 collectionId。字段映射:cover-image 与 first-post-image 来自 get_image_url 输出;name 提取 article 中第一个 <h2>;article-body-text 为 article 内容(移除 <h1>);short-paragraph 为 summary;read-time 固定为 5 min。同时添加 Google Sheets1 节点,更新对应 row_number 的 Completed=true。
可复制提示词
搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限
这一段是提示词,页面不会在这里插入广告。
请根据以下材料在 n8n 中复现该工作流:1)导入 workflow.json 或按步骤手动搭建;2)配置全部 OAuth2/API Key 凭证;3)替换 Google Sheets documentId、Webflow siteId/collectionId、Replicate token 等占位符;4)先测试单次运行,确认 Content writer 输出合法 JSON 后再激活定时触发。
搭建前请确认已拥有 Anthropic、OpenAI、Replicate 的 API 权限,以及 Google Sheets、Slack、Webflow 的 OAuth 授权。
来源
Generate & publish SEO articles with Claude AI, Webflow & image generation · perspectalog · n8n.io · 2025-06-26
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。