n8n 模板:Apify + GPT-4 深度多行破冰邮件生成器
从 Apollo 搜索获取线索 → 多页网站抓取与摘要 → GPT-4.1 生成个性化冷邮件开场白 → 输出至 Google Sheets
- 给谁
- 有 n8n 经验的 B2B 销售、营销代理或自动化工程师,需要批量生成高个性化冷邮件开场白
- 你会得到
- 将 Apollo.io 搜索线索自动转为带有多行深度个性化破冰语的 Google Sheets 列表,可直接导入冷邮件平台
- 你需要
- n8n · apify · google-sheets
硬约束
前置条件:n8n 实例;Apollo.io 搜索 URL;Apify 账号与 API Key;OpenAI API Key;Google Sheets OAuth 凭证。需按模板要求创建含 "Search URLs" 和 "Leads" 两个工作表的 Google Sheet,并在所有 Google Sheets 节点更新 document ID。作者估计搭建时间 3–4 小时,月运营成本约 $150(Apollo + Apify + OpenAI + 邮件平台)。
他们做了什么
作者 nicksaraev 在 n8n 官方模板库发布了该工作流模板。模板展示了一个从 Apollo.io 获取 B2B 线索、通过 Apify 爬虫批量提取联系人、对每个目标网站进行多页深度抓取、使用 GPT-4.1 生成页面摘要、再经 GPT-4.1 生成多行个性化冷邮件破冰语、最终输出到 Google Sheets 的完整自动化流程。模板内含 23 个节点,包含 HTML 提取、Markdown 转换、去重、限制、聚合等数据处理节点,以及两个 OpenAI 节点分别负责摘要和破冰生成。
效果如何
作者报告称该系统可实现 5-10% 的冷邮件回复率(对比常规 1-2%),并声称该方法论支撑了 $72K/月的代理业务收入。这些效果为作者自述(author_report),本站未实测验证。
值得知道
1. 本站未实测,reproduction=not_tested;实际效果取决于 Apollo 搜索质量、网站可抓取性及 OpenAI 输出稳定性。2. 模板中 Generate Multiline Icebreaker 的 user prompt 包含特定业务场景示例(为网站开发外包服务寻找客户),若用于其他行业需修改提示词中的产品/服务描述。3. Limit 节点默认限制每个网站抓取 3 个页面,可在 n8n 中调整以平衡深度与成本。4. 作者估计月运营成本约 $150(Apollo + Apify + OpenAI + 邮件平台),实际费用随线索量波动。5. 需遵守网站 robots.txt 及抓取伦理,内置延迟和错误处理可降低被封禁风险。6. Google Sheets 节点中缓存了作者的文档 ID,必须替换为自己的文档 ID 和凭证。
n8n 工作流模板
结构已检查 · 未实际运行下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。
配置与测试清单
需要绑定的凭证
- 将 __UKH_BEARER_17__ 替换为实际密钥/令牌(原路径 /nodes/17/parameters/headerParameters/parameters/1/value;literal auth header)。
需要替换的配置
- 源模板来自 n8n 公开库 #5388(约 23 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
- Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。
测试输入与预期结果
- 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
- 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。
模板处理说明
- 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
- 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。 另将 1 处字面量密钥替换为 __UKH_…__ 占位符。
模板获取日期: 2026-10-24
步骤
从 Apollo 获取线索
在 n8n 中配置工作流起点:手动触发(When clicking 'Test workflow')后,Get Search URL 节点从 Google Sheets 的 Search URLs 工作表读取 Apollo 搜索 URL;Call Apify Scraper 节点以 POST 请求调用 Apify Apollo 爬虫(https://api.apify.com/v2/acts/jljBwyyQakqrL1wae/run-sync-get-dataset-items),传入 url、getPersonalEmails、getWorkEmails、totalRecords 等参数,Header 中需填入 Bearer <your-apify-api-key-here>;随后 Only Websites & Emails 过滤节点仅保留同时具有 organization.website_url 和 email 的线索。
多页网站抓取与清洗
Scrape Home 节点请求每个线索的首页({{ $json.organization.website_url }});HTML 节点提取页面中所有 a 标签的 href 属性(links 数组);Edit Fields 节点整理线索字段(first_name, last_name, email, website_url, headline, location, phone_number, links);Loop Over Items 逐条处理每个线索;Split Out 将 links 数组展开为独立项;Filter 仅保留以 / 开头的相对路径内链;Code 节点执行 JavaScript 将绝对 URL 转为相对路径并去除尾部斜杠,无法解析则保留原值;Remove Duplicate URLs 去重;Limit 限制每个线索最多抓取 3 个页面,防止过量请求。
运行提示词 · 来源原文。n8n Code 节点(node: Code)的 jsCode 字段
const items = $input.all(); const updatedItems = items.map((item) => { const link = item?.json?.links; if (typeof link === "string") { // Case: starts with "/" → already relative if (link.startsWith("/")) { item.json.links = link; } // Case: absolute URL (http or https) else if (link.startsWith("http://") || link.startsWith("https://")) { try { const url = new URL(link); let path = url.pathname; // Strip trailing slash unless root "/" if (path !== "/" && path.endsWith("/")) { path = path.slice(0, -1); } item.json.links = path || "/"; } catch (e) { // On parse error, keep original item.json.links = link; } } // Fallback: not relative or absolute, leave as-is else { item.json.links = link; } } return item; }); return updatedItems;AI 摘要多页内容
Request web page for URL 节点拼接 website_url 与相对路径,批量请求每个内页;Markdown 节点将 HTML 转为 Markdown(空内容时输出 <div>empty</div>);Summarize Website Page 节点调用 GPT-4.1,以 system + user 提示词将每页 Markdown 内容转为两段式摘要;Aggregate 节点将同一线索的多页摘要聚合为 comprehensive profile。
运行提示词 · 来源原文。Summarize Website Page 节点的 messages[0].content(system role)
You're a helpful, intelligent website scraping assistant.
运行提示词 · 来源原文。Summarize Website Page 节点的 messages[1].content(user role)
You're provided a Markdown scrape of a website page. Your task is to provide a two-paragraph abstract of what this page is about. Return in this JSON format: {"abstract":"your abstract goes here"} Rules: - Your extract should be comprehensive—similar level of detail as an abstract to a published paper. - Use a straightforward, spartan tone of voice. - If it's empty, just say "no content".运行提示词 · 来源原文。Summarize Website Page 节点的 messages[2].content(动态注入当前页 Markdown)
={{ $json.data }}生成破冰语并输出到 Google Sheets
Generate Multiline Icebreaker 节点调用 GPT-4.1(temperature=0.5),以 system 提示词设定销售助手角色,再以包含格式规则、示例(few-shot)的 user 提示词聚合摘要生成多行个性化破冰语;输出为 JSON 格式 {"icebreaker":"..."}。Add Row 节点将线索字段与 multiline_icebreaker 追加写入 Google Sheets 的 Leads 工作表,字段包括 first_name, last_name, email, website_url, location, phone_number, multiline_icebreaker。
运行提示词 · 来源原文。Generate Multiline Icebreaker 节点的 messages[0].content(system role)
You're a helpful, intelligent sales assistant.
运行提示词 · 来源原文。Generate Multiline Icebreaker 节点的 messages[1].content(user role,含格式规则与 few-shot 示例)
=We just scraped a series of web pages for a business called . Your task is to take their summaries and turn them into catchy, personalized openers for a cold email campaign to imply that the rest of the campaign is personalized. You'll return your icebreakers in the following JSON format: {"icebreaker":"Hey {name}. Love {thing}—also doing/like/a fan of {otherThing}. Wanted to run something by you.\n\nI hope you'll forgive me, but I creeped you/your site quite a bit, and know that {anotherThing} is important to you guys (or at least I'm assuming this given the focus on {fourthThing}). I put something together a few months ago that I think could help. To make a long story short, it's an outreach system that uses AI to find people hiring website devs. Then pitches them with templates (actually makes them a demo website). Costs just a few cents to run, very high converting, and I think it's in line with {someImpliedBeliefTheyHave}"} Rules: - Write in a spartan/laconic tone of voice. - Make sure to use the above format when constructing your icebreakers. We wrote it this way on purpose. - Shorten the company name wherever possible (say, "XYZ" instead of "XYZ Agency"). More examples: "Love AMS" instead of "Love AMS Professional Services", "Love Mayo" instead of "Love Mayo Inc.", etc. - Do the same with locations. "San Fran" instead of "San Francisco", "BC" instead of "British Columbia", etc. - For your variables, focus on small, non-obvious things to paraphrase. The idea is to make people think we *really* dove deep into their website, so don't use something obvious. Do not say cookie-cutter stuff like "Love your website!" or "Love your take on marketing!".运行提示词 · 来源原文。Generate Multiline Icebreaker 节点的 messages[2].content(user role,few-shot 输入示例)
=Profile: Aina Rakotoarinaly, CEO founder - Maki Agency / Ti'bouffe, Maki agency, outsourcing/offshoring, Antananarivo, Madagascar Website: This webpage presents Maki Agency, a professional digital outsourcing company based in Madagascar that specializes in tailored web development, integration, design, SEO, content creation, community management, and more. The agency offers a range of white-label and dedicated resource solutions, targeting businesses that wish to outsource various digital projects. Maki Agency emphasizes its team's versatile technical expertise across major web technologies, including CSS, HTML, JQuery, WordPress, PHP, WooCommerce, Laravel, and Odoo. The company positions itself as an ideal partner for comprehensive digital support, ensuring that client's digital and branding needs are met through experienced personnel and rigorous project management.\n\nThe website details the specific services provided, such as graphic and web design (logos, banners, retouching), web integration (landing pages, newsletters, site layouts), development (showcase sites, e-commerce, intranets, bespoke applications, maintenance), content writing (SEO-optimized texts, articles, product sheets, social media posts), search engine optimization (audits, optimizations, submissions), and social media management. The agency highlights its strengths in quality of work, experience, and discretion, especially in white-label arrangements. Visitors are encouraged to contact Maki Agency for new or existing projects, and convenient contact options (phone, QR codes, social media, chat) are provided for initiating discussions. This page presents Maki Agency, a Madagascar-based digital agency specializing in web outsourcing and subcontracting services. The agency emphasizes its experience and dedicated team capable of handling diverse digital tasks such as web development, design, SEO, content writing, integration, community management, and maintenance. Maki Agency offers both white-label and dedicated resource solutions for clients seeking to externalize parts of their workflow to a specialized offshore partner. The descriptions highlight the agency's proficiency in popular web technologies, frameworks, and CMS platforms (such as HTML, CSS, PHP, WordPress, Laravel, WooCommerce, and Odoo), as well as its ability to execute projects ranging from landing pages, e-commerce platforms, and intranets to detailed graphic design and content creation.\n\nThe site underscores Maki Agency's core values and competitive advantages, such as meticulous attention to detail, experienced professionals, creativity, discretion, and a client-focused approach. It provides detailed breakdowns of service offerings, ranging from graphic materials (logos, flyers, banners), technical integration, app and website development, staff outsourcing (developers, designers, writers), SEO strategies, community management, and digital content production. Contact details and multiple avenues for communication (phone, WhatsApp, Skype, QR codes) are prominently featured, along with encouragements for clients to reach out for consultations or ongoing projects requiring outsourcing. The agency also highlights its longevity and adaptability in the digital sector, supporting clients across various industries and digital competencies
运行提示词 · 来源原文。Generate Multiline Icebreaker 节点的 messages[3].content(assistant role,few-shot 输出示例)
{"icebreaker":"Hey Aina,\n\nLove what you're doing at Maki. Also doing some outsourcing right now, wanted to run something by you.\n\nSo I hope you'll forgive me, but I creeped you/Maki quite a bit. I know that discretion is important to you guys (or at least I'm assuming this given the part on your website about white-labelling your services) and I put something together a few months ago that I think could help. To make a long story short, it's an outreach system that uses AI to find people hiring website devs. Then pitches them with templates (actually makes them a white-labelled demo website). Costs just a few cents to run, very high converting, and I think it's in line with Maki's emphasis on scalability."}运行提示词 · 来源原文。Generate Multiline Icebreaker 节点的 messages[4].content(user role,运行时动态注入当前线索摘要)
=Profile: {{ $('Loop Over Items').item.json.first_name }} {{ $('Loop Over Items').item.json.last_name }} {{ $('Loop Over Items').item.json.headline }} Website: {{ $json.abstract.join("/n") }}
可复制提示词
搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限
这一段是提示词,页面不会在这里插入广告。
本模板为 n8n 工作流搭建助手启动词。请按以下顺序复现:1) 创建 Google Sheets(Search URLs + Leads 两表);2) 在 n8n 导入模板或按 workflow.json 手动搭建;3) 配置 Google Sheets OAuth、Apify API Key、OpenAI API Key;4) 更新所有 Google Sheets 节点的 documentId;5) 在 Search URLs 表填入 Apollo 搜索 URL;6) 测试运行并检查 Leads 表输出。
搭建前请确认已持有 Apify、OpenAI、Google Sheets 的 API 凭证,并在 n8n Credentials 中完成配置。
来源
Cold email icebreaker generator with Apify, GPT-4 & website scraping · nicksaraev · n8n.io · 2025-06-26
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。