n8n 自动化 LinkedIn 线索生成与 AI 个性化外联(Apollo + Instantly)
通过 n8n 表单提交 → Apollo URL 生成 → Apify 抓取 → OpenAI 清洗 → Google Sheets 存储 → Tavily 公司研究 → AI 生成冷邮件 → Instantly.ai 投放
- 给谁
- 需要自动化 B2B 线索获取与个性化外联的代理创始人、SaaS 创始人、B2B 营销人员或 SDR 团队
- 你会得到
- 提交一次表单即可自动完成从线索抓取、 enrichment、公司研究到个性化邮件生成和投放的完整销售漏斗
- 你需要
- n8n · google-sheets · apify · tavily · instantly.ai · apollo
硬约束
前置条件:n8n 实例(自托管或云版);Apify、OpenAI、Instantly.ai、Tavily 的 API key;Google Sheets OAuth 凭证及可写入的电子表格。费用参考:Instantly $38/月,Apify $39/月,Tavily 前 100 条免费后 $0.08/条,Apollo $1.20/千条(从 Apify 额度扣除),GPT API 约 <$0.10/百条。注意:workflow.json 中的 Google Sheets documentId 为示例,需替换为自有文档。
他们做了什么
来源模板作者 n8nwizard 在 n8n 中构建了一个 23 节点的自动化工作流。用户通过 n8n 表单提交目标线索条件(职位、公司规模、关键词、地区、Instantly Campaign ID),工作流依次调用 LLM 生成 Apollo 搜索 URL、通过 Apify Actor 抓取 Apollo 数据、使用 OpenAI 解析并结构化线索、写入 Google Sheets、利用 Tavily AI Agent 研究公司背景、再用 OpenAI 生成个性化冷邮件正文,最终通过 Instantly.ai API 将线索与邮件加入外联 campaign,并自动循环处理全部线索。
效果如何
作者声称该工作流可移除 100% 手动抓取,实现规模化高质量个性化外联,每条线索包含验证邮箱、公司洞察与个性化信息,从而提高回复率(来源作者自述,未经本站实测)。模板在 n8n.io 上公开,views=311。
值得知道
1. 发件人背景硬编码为 ChaseAI AI 咨询;若用于其他业务,需修改 Generate Outreach Message 节点中的公司名与价值主张。 2. 提示词中 LinkedIn 字段存在语法瑕疵(Parse Lead Data 的 JSON schema 中 "LinkedIn" 后缺逗号),实际运行需验证 Structured Output Parser 的 schema 兼容性。 3. Limit1 节点默认 maxItems=10,如需更多线索请调整;Loop Over Items 实现分批循环。 4. Google Sheets 节点使用 appendOrUpdate 与匹配列(Full Name / Email),需确保表头与 schema 一致。 5. 成本为作者估算,实际费用随用量与 API 定价变动;Tavily 免费额度后按条计费。 6. 本站未执行该工作流,reproduction=not_tested;搭建前建议在隔离环境用少量数据验证。
n8n 工作流模板
结构已检查 · 未实际运行下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。
配置与测试清单
需要绑定的凭证
- 将 __UKH_BEARER_4__ 替换为实际密钥/令牌(原路径 /nodes/4/parameters/headerParameters/parameters/1/value;literal auth header)。
- 将 __UKH_BEARER_18__ 替换为实际密钥/令牌(原路径 /nodes/18/parameters/headerParameters/parameters/0/value;literal auth header)。
需要替换的配置
- 源模板来自 n8n 公开库 #11647(约 23 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
- Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。
测试输入与预期结果
- 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
- 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。
模板处理说明
- 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
- 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。 另将 2 处字面量密钥替换为 __UKH_…__ 占位符。
模板获取日期: 2026-10-24
步骤
配置表单触发器与 Apollo URL 生成
在 n8n 中导入模板后,确认「On form submission」节点表单字段:Job Title(文本)、Company Size(下拉:1-10 至 10001-100000)、Keywords、Location、Instantly Campaign ID。随后配置「Apollo URL Generator」LLM Chain 节点,连接 OpenAI Chat Model(gpt-4.1)。该节点接收表单数据,由 LLM 生成结构化的 Apollo 搜索 URL。
运行提示词 · 来源原文。Apollo URL Generator 节点的 Text 输入字段
=Job Title: {{ $json['Job Title'] }} Company Size: {{ $json['Company Size'] }} Keywords: {{ $json.Keywords }} Location: {{ $json.Location }}运行提示词 · 来源原文。Apollo URL Generator 节点的 Messages 系统提示词字段
=You are an expert Apollo.io search URL generator. Your task is to convert form data into a precise Apollo search URL. **CRITICAL INSTRUCTIONS:** 1. **Handle Multiple Values**: Fields like 'Job Title', 'Keywords', and 'Location' can contain multiple items separated by a comma. When you see a comma-separated list, you **MUST** create a separate URL parameter for **EACH** item in the list. * _Example for Titles:_ `personTitles[]=Founder&personTitles[]=CEO` * _Example for Locations:_ `personLocations[]=United%20States&personLocations[]=Austin` 2. **Supported Fields & URL Parameters**: * **Location**: Maps to `personLocations[]`. Create one for each location in the list. * **Job Title**: Maps to `personTitles[]`. Create one for each title in the list. * **Company Size**: Maps to `organizationNumEmployeesRanges[]`. This is a single value and should use a hyphen (e.g., `1-10`). * **Keywords**: Maps to `qOrganizationKeywordTags[]`. Create one for each keyword in the list. 3. **URL Encoding**: Ensure all values are properly URL-encoded (e.g., spaces become `%20`, and commas within a single location value like "Austin, Texas" become `%2C`). --- **EXAMPLE:** **Input Data:** Job Title: Founder, CEO, President Company Size: 1-10 Keywords: Fintech, SaaS Location: United States, Austin, Texas, Boston **Your Output (must be this exact format):** https://app.apollo.io/#/people?personTitles[]=Founder&personTitles[]=CEO&personTitles[]=President&organizationNumEmployeesRanges[]=1-10&qOrganizationKeywordTags[]=Fintech&qOrganizationKeywordTags[]=SaaS&personLocations[]=United%20States&personLocations[]=Austin%2C%20Texas&personLocations[]=Boston执行 Apify Apollo 抓取
配置「Run Apify」HTTP Request 节点:方法 POST,URL 为 https://api.apify.com/v2/acts/jljBwyyQakqrL1wae/run-sync-get-dataset-items,Header 中 Authorization 填入 Bearer YOUR_APIFY_TOKEN。JSON Body 包含 getPersonalEmails=true、getWorkEmails=true、totalRecords=500,以及上一步生成的 url。执行后获取原始线索数据集。
OpenAI 解析线索并写入 Google Sheets
「Parse Lead Data」节点(Basic LLM Chain,模型 gpt-4.1-mini,带 Structured Output Parser)接收 Apify 返回的原始 JSON。配置提示词让 LLM 提取 fullName、firstName、lastName、email、title、LinkedIn、companyName、companyWebsite、companyLinkedIn,并生成 2-3 句专业摘要。输出经「If1」检查无 error 且 email 非空后,由「Filter」过滤,最终「Add to Google Sheet」以 Full Name 为匹配列 appendOrUpdate 到指定 Google Sheets。
运行提示词 · 来源原文。Parse Lead Data 节点的 Text 输入字段
=Full Name: {{ $json.name }} First Name: {{ $json.first_name }} Last Name: {{ $json.last_name }} Title: {{ $json.title }} Email: {{ $json.email }} LinkedIn: {{ $json.linkedin_url }} Org Name: {{ $json.organization_name }} Org Website: {{ $json.organization_website_url }} Org LinkedIn: {{ $json.organization_linkedin_url }}运行提示词 · 来源原文。Parse Lead Data 节点的 Messages 系统提示词字段
=You are a sophisticated AI data-processing engine. Your task is to receive a raw JSON object for a single business prospect, perform two critical actions, and then provide your response in a specific JSON format. **Your Instructions:** 1. **EXTRACT KEY DATA:** You must parse the raw JSON input to find and extract the following specific data points. If a field is not present, use a value of `null`. * **Full Name:** Look for `name`. * **First Name** Look for 'first_name' * **Last Name** Look for 'last_name' * **Email:** Find the first available email address. Look in fields like `emails` or `personal_emails`. * **LinkedIn** Look for the 'linkedin_url' * **Title:** Look for the `title` field. * **Company Name:** Look for the `organization_name` field. * **Company Website:** Look for the `organization_website` field. * **Company LinkedIn:** Combine `organization_linkedin. 2. **SYNTHESIZE A SUMMARY:** After extracting the data, write a concise, 2-3 sentence professional summary suitable for a sales team. 3. **FORMAT THE OUTPUT:** You MUST structure your entire response as a single, clean JSON object. The object should contain exactly the keys listed below. Do not include any other text, explanations, or greetings in your response—ONLY the final JSON object. **Required Output Format:** { "fullName": "...", "firstName": "...", "lastName": "...", "email": "...", "title": "...", "LinkedIn" "companyName": "...", "companyWebsite": "...", "companyLinkedIn": "...", "summary": "..." }Tavily 公司研究与信息合成
「Loop Over Items」分批处理线索。每条线索进入「Company Research」AI Agent 节点(模型 gpt-4.1-mini,连接 Tavily Tool 与 Structured Output Parser)。节点接收 Company Name、Company Website、Company LinkedIn,调用 Tavily 搜索官网信息、近期新闻、产品服务及第三方评价(G2/Reddit),输出 JSON 包含 companyOverview、recentWebsiteNews、keyOfferings、thirdPartySentiment、comprehensiveSummary。
运行提示词 · 来源原文。Company Research 节点的 Text 输入字段
=company: {{ $json["Company Name"] }} company website: {{ $json["Company Website"] }} company linkedin: {{ $json["Company LinkedIn"] }}运行提示词 · 来源原文。Company Research 节点的 Options → System Message 字段
=You are a Company Information Synthesizer. Your primary goal is to extract key information about a target company by leveraging the `tavilysearch` tool, prioritizing content likely originating from the company's official website. Your secondary goals are checking third-party sources for customer sentiment and recent news about the comapny. You will be given the company name, company website, and company linkedin. **CORE DIRECTIVES:** 1. **TOOL USAGE:** You MUST ONLY use the `tavilysearch` tool for information gathering. 2. **PRIMARY SOURCE FOCUS (Website):** Prioritize finding and summarizing information directly presented on the company's official website (e.g., About Us, News/Blog/Press sections, Product/Service pages, Contact Us page). Use Tavily to locate these pages or relevant summaries. 3. **SECONDARY SOURCE (Sentiment ONLY):** Use Tavily to search third-party review sites (G2, Capterra, etc.) or forums (Reddit) ONLY for customer sentiment. 4. **RECENCY:** For news and highlights, focus on information from the last 12-18 months. 5. **CONCISENESS:** Keep summaries brief and factual. 6. **ACCURACY:** Do not invent information. **RESEARCH FOCUS (Guide for using Tavily):** * **Core Business:** Search for "[Company Name] About Us", "[Company Name] Mission", or what the company does, aiming for results likely linking to or summarizing their main website content. * **Recent Website News:** Search for "[Company Name] news", "[Company Name] press release", "[Company Name] blog", looking for recent announcements likely hosted on their domain. * **Products/Services:** Search for "[Company Name] products", "[Company Name] services", aiming for results describing their core offerings, likely from their website. * **Third-Party Sentiment:** Search `"[Company Name] review site:g2.com"`, `"[Company Name] reddit discussion"`, etc. **OUTPUT FORMAT:** Your final response MUST be a single JSON object containing the following keys. Provide concise, bulleted string values where appropriate: { "companyOverview": "[1-2 sentence description of what the company does, its mission, or value proposition, based on information likely found on their website.] (Source: Primarily Company Website via Tavily Search Results)", "recentWebsiteNews": "[Bullet point about a specific recent announcement, update, or blog post likely found on the company's website.] (Source: Link to specific page/article if found by Tavily, otherwise 'Company Website News/Blog')\n- [Optional second bullet point.] (Source: Link or 'Company Website News/Blog')", "keyOfferings": "[Bullet point listing a key product or service.] (Source: Company Website via Tavily Search Results)\n- [Optional second bullet point listing another offering.] (Source: Company Website via Tavily Search Results)", "thirdPartySentiment": "[Bullet point summarizing specific praise/criticism from a third-party review site/forum. Quote if concise.] (Source: [Specific URL/Site Name])\n- [Optional second bullet point.] (Source: [Specific URL/Site Name])", "comprehensiveSummary": "[1-2 sentence write up that synthesizes and ties the companyOverview, recentWebsiteNews, keyOfferings, and thirdPartySentiment all together]" } **HANDLING NO RESULTS:** If `tavilysearch` finds no relevant information, the value MUST be a string stating: "No relevant [Category Name, e.g., recent website news] found via Tavily search." Source citation for website content (overview, news, offerings) can be general ('Company Website via Tavily') unless a specific article/page URL is readily available in the search results. Source citation for `thirdPartySentiment` MUST be specific.生成个性化外联邮件并投放至 Instantly.ai
「Generate Outreach Message」节点(Basic LLM Chain,模型 gpt-4.1-mini)接收 Loop Over Items 中的 Full Name、Personal Summary、Company Name,以及 Company Research 的 comprehensiveSummary,按提示词撰写 100-150 词个性化冷邮件正文(以 ChaseAI AI 咨询为发件背景)。输出经「Add Company Info to Google Sheet」以 Email 为匹配列追加公司信息、邮件正文等字段,最后「Add Lead to Instantly AI」HTTP Request 节点 POST 到 https://api.instantly.ai/api/v2/leads,Header Authorization: Bearer YOUR_INSTANTLY_TOKEN,Body 包含 campaign ID、email、姓名字段及 custom_variables.custom_body 为生成的邮件正文。流程通过 Loop Over Items 自动循环直至全部线索处理完毕。
运行提示词 · 来源原文。Generate Outreach Message 节点的 Text 输入字段
=name: {{ $('Loop Over Items').item.json["Full Name"] }} personal background: {{ $('Loop Over Items').item.json["Personal Summary"] }} company name: {{ $('Loop Over Items').item.json["Company Name"] }} company background: {{ $json.output.comprehensiveSummary }}运行提示词 · 来源原文。Generate Outreach Message 节点的 Messages 系统提示词字段
=You are an Expert B2B Cold Outreach Email Drafter. Your objective is to compose a concise, professional, and highly personalized email body (target 100-150 words) to introduce ChaseAI's AI consulting services to a business prospect. **Your Company:** ChaseAI **Your Offering:** AI consulting focused on helping businesses leverage AI for benefits like operational efficiency, enhanced customer engagement, data-driven decision making, and strategic growth. **Input Data Provided:** You will receive the following information about the prospect and their company: * `name`: The prospect's name * `personal background`: A summary of the prospect's background * `company name`: The name of the prospect's company. * `company background`: A summary of the company's background. **Drafting Instructions:** 1. **Identify the Strongest Hook:** * Carefully analyze BOTH the `personal background` and the `company background` inputs. * Look for the *single most compelling and relevant piece of information* to use as a personalized opening. Prioritize items like: * Specific achievements, projects, or unique connectors mentioned. * Recent, significant company news (funding, major launch, partnership) from `company background`. * A key offering or aspect of the `companyOverview` that strongly aligns with potential AI applications. * A specific technical specialization or outreach angle * Choose the hook that allows the most natural and logical transition to the value of AI consulting for *this specific prospect* in *their specific company*. 2. **Structure & Content:** * **Opening (Personalized Hook):** Start by briefly acknowledging the prospect (using their name extracted from the `name` field) and referencing the specific hook you selected (1 sentence). Make it clear you've done some research. * **Introduction:** Briefly introduce ChaseAI and that you offer AI consulting (1 sentence). * **Value Proposition (Connecting the Dots):** Explain *why* AI consulting might be relevant *specifically* to them, given the hook point, their role ({{ $('Limit1').item.json.Title }}), and their `company`. Focus on potential benefits like efficiency, growth, tackling challenges related to their recent news, etc. (1-2 sentences). * **Call to Action (Soft):** Suggest a brief, low-pressure next step (e.g., "Would exploring how AI could apply to [Specific Area Mentioned] be valuable?", "Open to a quick chat sometime next week?"). 3. **Tone:** Professional, concise, respectful, knowledgeable (demonstrated by the hook), and focused on potential value. Avoid jargon where possible. 4. **Constraints:** * Strict word count: Aim for 100-150 words for the email body. * Use only the information provided in the input fields. Do not invent details. * If both `personal background` and `company background` lack strong, specific hooks, create the most relevant message possible focusing on their role and the `company Overview`, connecting AI's general benefits. * Return ONLY the drafted email body as a single string. Do not include a subject line, greeting ("Hi [Name],"), sign-off ("Best,"), or begin the draft by mention their first name (the opener will have already been written with their first name) **Output Format:** Return ONLY the drafted email body as a single string. Do not include a subject line, greeting ("Hi [Name],"), sign-off ("Best,"), or begin the draft by mention their first name (the opener will have already been written with their first name) **Example Output** I noticed Synchro Social’s focus on videography and strategic content creation, which presents great opportunities to harness AI for enhancing content personalization and streamlining production workflows. At ChaseAI, we specialize in helping businesses like yours leverage AI technologies to boost operational efficiency and sharpen customer engagement. Given your leadership role and Synchro Social’s creative service model, integrating AI can support data-driven insights to tailor content strategies and accelerate delivery without compromising quality. Would exploring how AI could enhance your content creation process and audience targeting be valuable? I’d be glad to discuss how tailored AI solutions might fit your goals in a brief chat.
可复制提示词
搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限,再按步骤导入模板并替换凭证
这一段是提示词,页面不会在这里插入广告。
请根据以下 n8n 模板搭建自动化线索生成与外联工作流。先确认你拥有 n8n 实例、Apify/OpenAI/Instantly.ai/Tavily API key、Google Sheets OAuth 权限,以及 Instantly.ai 中的有效 campaign ID。然后按步骤导入 workflow JSON、替换凭证与文档 ID、测试表单提交并验证各节点输出。
导入模板后,务必替换 workflow.json 中的 YOUR_TOKEN_HERE 与示例 Google Sheets documentId;建议先用少量 totalRecords(如 10)测试 Apify 节点,确认 URL 生成与数据解析正常后再全量运行。
来源
Automated LinkedIn lead generation & AI personalized outreach with Apollo & Instantly · n8nwizard · n8n.io · 2025-12-10
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。