用 n8n + OpenAI 通过聊天生成冷邮件与销售信
聊天输入 → AI 代理路由到专用文案工具 → 输出到 Google 文档
- 给谁
- 需要在 n8n 中搭建 AI 文案工作流、并将产出自动写入 Google Docs 的运营或销售人员
- 你会得到
- 通过聊天触发,让 AI 代理根据意图调用冷邮件或销售信工具,生成文案并写入指定文档
- 你需要
- n8n · google-docs
硬约束
前置条件:n8n 实例(云端或自托管)、OpenAI API 密钥、Google Docs OAuth2 凭证。模板引用两个外部子工作流(Cold Email Copywriter / Sales Letter Agent),需确保其可访问。
他们做了什么
模板作者 yar 在 n8n 中搭建了一个名为 "Team of AI Copywriters" 的工作流,包含 7 个节点。用户通过 Chat Trigger 发送消息,Copy Assistant(AI Agent 节点)利用 OpenAI Chat Model(gpt-4.1-mini)和 Simple Memory 解析意图,并调用两个 Tool Workflow 节点(Cold Email Writer Tool / Sales Letter Tool)之一生成文案,最终通过 Google Docs 节点将结果写入指定文档。
效果如何
来源未提供定量效果数据。模板页面显示浏览量 4520 次,状态为 published。作者自述该工作流可按用户意图自动生成冷邮件或销售信并保存到文档(author_report)。
值得知道
1) 两个文案工具(Cold Email Writer Tool / Sales Letter Tool)引用的是外部子工作流(workflowId 分别为 ZtScEU9B5PNPnIcP 与 HQuj3iBV1PlI0HY1),snapshot 未包含其内部实现;使用前需确认这些子工作流在环境中可访问或自行替换。2) 系统提示词中提到了 Ad Copy Agent、VSL Script Agent、Ad Script Agent,但当前模板实际只连接了 Sales Letter Agent 和 Cold Email Copywriter 两个工具;其余为提示词内保留的路由说明,未在节点连接中体现。3) 输出目标当前硬编码为一个示例 Google Doc URL,需替换为自己的文档地址。4) 来源建议用 sticky-note 做标注,但此为操作建议,非自动配置。5) 本站未实测该工作流,reproduction=not_tested。
n8n 工作流模板
结构已检查 · 未实际运行下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。
配置与测试清单
需要绑定的凭证
- OpenAI Chat Model 节点:绑定OpenAI API 凭证。
- Update a document 节点:绑定googleDocsOAuth2Api 凭证。
需要替换的配置
- 源模板来自 n8n 公开库 #5828(约 7 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
- Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。
测试输入与预期结果
- 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
- 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。
模板处理说明
- 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
- 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。
模板获取日期: 2026-10-24
步骤
准备凭证
在 n8n 中配置三类凭证,不使用硬编码密钥: 1) OpenAI Chat Model(openAiApi)— 用于 AI 代理的聊天模型; 2) Simple Memory — 用于在多条消息间保留上下文; 3) Google Docs(googleDocsOAuth2Api)或 Microsoft Word — 用于 Update a document 节点写入产出。
导入工作流模板
将 workflow.json 导入 n8n。导入后应看到 7 个节点:When chat message received、Copy Assistant、OpenAI Chat Model、Simple Memory、Update a document、Cold Email Writer Tool、Sales Letter Tool。
配置聊天触发器
打开 When chat message received 节点,确保 webhook 或表单端点指向你的接收地址。测试时可通过该端点发送消息触发工作流。
配置 Copy Assistant 系统提示词
在 Copy Assistant 节点的 options.systemMessage 中粘贴模板提供的系统提示词(见下方提示词块)。该提示词定义了 AI 代理的角色:解析用户意图,将请求路由到 Sales Letter Agent 或 Cold Email Copywriter 工具,并在生成后把最终文案写入 Google Doc。 来源建议在节点上添加 sticky-note 标注,说明 API 密钥位置、Assistant ID 填写处及提示词调整方法。
运行提示词 · 来源原文。Copy Assistant 节点的 options.systemMessage 字段
#Overview You are a Copy Assistant Agent responsible for managing and routing user requests to the appropriate specialized copywriting agents based on input. You are the control coordinator for generating and delivering high‑quality platform‑ready marketing copy. ## Context You are connected to multiple specialized copywriting tools: Sales Letter Agent Cold Email Copywriter You also interact with an OpenAI chat model and a memory system to retain conversational context Once copy is generated, your role is to deliver it clearly and accurately to the user and update the connected Google Doc with the final version. ## Instrcutions When a user request is received, determine its intent and route it to the correct agent: Ad Copy Agent → punchy headlines, descriptions & CTAs for display/search/social ads VSL Script Agent → full‑length video sales letters with hook, problem/solution, proof, CTA Ad Script Agent → short (15–60 sec) video ad scripts for TikTok, Instagram, YouTube Sales Letter Agent → long‑form email or web sales letters with storytelling, proof, bullets Cold Email Copywriter → concise, personalized outreach sequences (subjects, intros, value props, follow‑ups) ## Tools Ad Copy Agent: punchy headlines, descriptions & CTAs for social/display/search ads VSL Script Agent: longer video‑sales‑letter scripts with hook, problem/solution, proof, CTA Ad Script Agent: short video ad scripts (15–60 sec) for TikTok, Instagram, YouTube Sales Letter Agent: long‑form email or web sales letters with story, proof, bullets Cold Email Copywriter: concise outreach sequences—subject lines, intros, value props, follow‑ups ## Examples “Need a Facebook ad for our new fitness app.” → route to Ad Copy Agent “Write a 3‑minute VSL script pitching our automation tool.” → route to VSL Script Agent “30‑second TikTok spot for our gourmet coffee.” → route to Ad Script Agent “Long‑form sales letter for B2B software.” → route to Sales Letter Agent “5‑step cold email sequence to logistics managers.” → route to Cold Email Copywriter ## SOPs Interpret intent: read the user’s brief, spot format and goal Select agent: map to the tool that matches (ad, VSL, email, etc.) Prompt agent: pass along the brief plus brand voice or any notes Review output: check tone, formatting, brand compliance Deliver: send clean, formatted copy back to the user Document: paste final approved copy into the shared Google Doc ## Final Notes Keep things concise, conversational, user‑focused Always ask if you need more brand details or style guidelines Stay friendly and collaborative Store context so follow‑up tweaks are seamless
运行测试
向 Chat trigger 发送测试消息,例如: “Write me a cold email for a B2B SaaS offering.” Copy Assistant 会根据意图选择 Cold Email Writer Tool 或 Sales Letter Tool,生成文案后通过 Update a document 节点写入你指定的 Google Doc。检查文档是否出现生成内容。
可复制提示词
搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限
这一段是提示词,页面不会在这里插入广告。
你正在搭建一个 n8n AI 文案工作流。请先确认已完成以下准备: 1) n8n 实例可访问; 2) OpenAI API 密钥已添加为 openAiApi 凭证; 3) Google Docs OAuth2 凭证已授权; 4) 已导入 workflow.json 并看到 7 个节点。 然后按步骤配置触发器、粘贴 Copy Assistant 的系统提示词、发送测试消息验证输出是否写入文档。
先检查凭证,再导入模板,最后测试触发
来源
Generate cold emails & sales letters with OpenAI GPT & Google Docs via Chat · yar · n8n.io · 2025-07-09
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。