使用 OpenAI 进行潜在客户分析与个性化邮件生成
高级
这是一个自动化工作流,包含 16 个节点。主要使用 If, Code, Gmail, JotFormTrigger, Agent 等节点。 使用 Jotform、GPT 和 Gmail 自动进行潜在客户资格认定与个性化触达
前置要求
- •Google 账号和 Gmail API 凭证
- •OpenAI API Key
分类
-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "ymalyY9DUuChbG1t",
"meta": {
"instanceId": "277842713620d9f5554de3b1518b865a152c8c4db680008bd8aec536fc18b4a8",
"templateCredsSetupCompleted": true
},
"name": "使用 OpenAI 进行潜在客户分析与个性化邮件生成",
"tags": [
{
"id": "CWardZYJBmejoyC4",
"name": "under review",
"createdAt": "2025-10-09T18:43:37.031Z",
"updatedAt": "2025-10-09T18:43:37.031Z"
}
],
"nodes": [
{
"id": "09a1ecea-b67c-4a79-a6e1-6d2adf1a4e87",
"name": "提取域名",
"type": "n8n-nodes-base.code",
"position": [
-1392,
320
],
"parameters": {
"jsCode": "const items = $input.all();\nreturn items.map(item => {\n const email = item.json['E-mail'];\n const domain = email ? email.split('@')[1] : null;\n \n return {\n json: {\n websiteDomain: domain ? 'https:' + '//' + domain : null // Break up the protocol\n }\n };\n});"
},
"typeVersion": 2
},
{
"id": "a0748ec0-121e-4b8d-8a4b-1644fb70c6ad",
"name": "标记个人电子邮件地址",
"type": "n8n-nodes-base.code",
"position": [
-1216,
320
],
"parameters": {
"mode": "runOnceForEachItem",
"jsCode": "// Flag items based on common email providers\nconst commonProviders = [\n 'gmail', 'yahoo', 'ymail', 'rocketmail',\n 'outlook', 'hotmail', 'live', 'msn',\n 'icloud', 'me', 'mac', 'aol',\n 'zoho', 'protonmail', 'mail', 'gmx'\n];\n\nconst websiteDomain = $input.item.json.websiteDomain;\nconst protocol = 'https:' + '//'; // Break up the protocol\nconst domain = websiteDomain ? websiteDomain.replace(protocol, '') : '';\nconst domainParts = domain.split('.');\nconst mainDomain = domainParts[0].toLowerCase();\nconst isCommonProvider = commonProviders.includes(mainDomain);\n\nreturn {\n json: {\n ...$input.item.json,\n isPersonalEmail: isCommonProvider\n }\n};"
},
"typeVersion": 2
},
{
"id": "34e7976f-12d6-4aab-a706-6210e91c3f81",
"name": "是否为个人电子邮件?",
"type": "n8n-nodes-base.if",
"position": [
-1008,
320
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "d7f56829-f0e9-4271-b981-0800d8faad1e",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.isPersonalEmail }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "4c87424a-e345-4dd9-a208-4b860266385d",
"name": "AI 销售代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
400,
368
],
"parameters": {
"text": "=We have a new inbound lead as someone left their email address on our landing page. We already scraped their website, find it below, and I now need you to analyze this prospect and help me write an initial outreach email.\n\nUse Github-flavored-markdown for interest, ICP and personalization reasoning.\nThe email draft needs to be in html format though! should we well formatted,concise and have pointers instead of paragraphs.\n\nAlso fetch previous positive examples to use as a reference of what is a good analysis and email draft.\n\n<Lead Info>\nEmail: {{ $('JotForm Trigger').item.json['E-mail'] }}\nWebsite: {{ $('Extract Domain').item.json.websiteDomain }}\n</Lead Info>\n\n<Website Summary>\n{{ $json.message.content }}\n</Website Summary>\n\nToday is {{ $today }}.\n\n---\n\n## ABOUT OUR COMPANY & OFFERINGS\n\n**Company:** ClareVoice\n\n**What We Do:**\nClareVoice provides enterprise-grade Voice AI Agent solutions that automate phone conversations and customer interactions. Our AI agents handle inbound and outbound calls with human-like conversation quality, helping businesses scale their customer communications without scaling headcount.\n\n**Core Solutions:**\n\n1. **Inbound AI Agents**\n - 24/7 customer support and inquiry handling\n - Appointment scheduling and booking\n - Order status and tracking\n - Lead qualification and routing\n - FAQ handling and information delivery\n\n2. **Outbound AI Agents**\n - Lead follow-up and nurturing\n - Appointment confirmations and reminders\n - Customer satisfaction surveys\n - Payment reminders and collections\n - Re-engagement campaigns\n\n3. **Integration Capabilities**\n - Seamless CRM integration (Salesforce, HubSpot, etc.)\n - Calendar systems (Google Calendar, Outlook, etc.)\n - Ticketing systems (Zendesk, Freshdesk, etc.)\n - Custom API integrations\n - Real-time data synchronization\n\n**Key Benefits:**\n- Reduce response times from hours to seconds\n- Handle unlimited concurrent calls\n- Lower operational costs by 60-80%\n- Improve customer satisfaction with instant responses\n- Scale during peak periods without additional staffing\n- Capture every lead - no missed calls\n- Multilingual support capabilities\n- Detailed analytics and conversation insights\n\n**Ideal Customer Profile (ICP):**\n- **Industries:** Healthcare, Real Estate, Home Services, E-commerce, Financial Services, SaaS, Automotive, Legal Services\n- **Company Size:** 10-500 employees\n- **Pain Points:** High call volumes, missed calls, slow response times, expensive customer support teams, after-hours inquiries, lead follow-up delays\n- **Use Cases:** Businesses with repetitive phone tasks, appointment-based services, high inbound inquiry volume, or struggling with lead response times\n\n**Differentiators:**\n- Natural, conversational AI (not robotic)\n- Custom training on your business processes\n- White-glove onboarding and setup\n- Enterprise-level security and compliance\n- Real human escalation when needed\n- Continuous learning and improvement\n\n**Pricing Model:**\n- Flexible plans based on call volume and features\n- Custom enterprise solutions available\n- ROI typically achieved within 3 months\n\n---\n\n## YOUR TASK\n\n1. **Analyze the prospect** based on their website summary:\n - Industry and business model\n - Potential pain points that ClareVoice could solve\n - ICP fit score (High/Medium/Low) with reasoning\n - Specific use cases that would resonate\n\n2. **Identify personalization opportunities:**\n - Specific services they offer that could benefit from Voice AI\n - Business challenges visible on their website\n - Growth indicators or scaling signals\n - Recent changes or initiatives mentioned\n\n3. **Draft an outreach email:**\n - Subject line (compelling and personalized)\n - Email body (conversational, value-focused, not salesy)\n - Clear call-to-action\n - Keep it under 150 words\n - Reference something specific from their website\n - Focus on ONE specific use case that's most relevant to them",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2.2
},
{
"id": "382a768d-ff17-4994-9f7e-eda054e90f0a",
"name": "OpenAI 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
336,
624
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8IkhtT3EbXygnvcr",
"name": "Klinsman OpenAI"
}
},
"typeVersion": 1.2
},
{
"id": "1a825199-e929-4472-a0d6-a6e68c38ef46",
"name": "结构化输出解析器",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
624,
624
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n\t\"type\": \"object\",\n \"required\": [\n \"industry\",\n \"reasoningForInterestInOurProduct_markdown\",\n \"reasoningIfIdealCustomerProfile_markdown\",\n \"personalizationHook_markdown\",\n \"companyBudgetAssessment\",\n \"priorityRating\",\n \"emailDraftSubject\",\n \"emailDraftBodyHtml\"\n ],\n\t\"properties\": {\n \"industry\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n \"reasoningForInterestInOurProduct_markdown\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n \"reasoningIfIdealCustomerProfile_markdown\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"reasoningPersonalizationHook_markdown\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"companyBudgetAssessment\": {\n\t\t\t\"enum\": [\"high\", \"medium\", \"low\"]\n\t\t},\n\t\t\"priorityRating\": {\n\t\t\t\"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 10\n\t\t},\n\t\t\"emailDraftSubject\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"emailDraftBodyHtml\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
},
"typeVersion": 1.3
},
{
"id": "c9f577dc-f5ca-416e-879b-83d55f5c58e7",
"name": "总结网站",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
-256,
528
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini",
"cachedResultName": "GPT-4.1-MINI"
},
"options": {},
"messages": {
"values": [
{
"content": "=We scraped a website. Please summarize the content in markdown (gfm) in 2-3 paragraphs highlighting their industry, positioning, service or product offerings and any hints on recent activities and strategic moves.\n\n<ScrapingResult>\n{{ $json.html }}\n</ScrapingResult>"
}
]
}
},
"credentials": {
"openAiApi": {
"id": "8IkhtT3EbXygnvcr",
"name": "Klinsman OpenAI"
}
},
"typeVersion": 1.8
},
{
"id": "c5ccdf39-e499-4dc1-8b3a-3d70e34ab623",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-544,
112
],
"parameters": {
"color": 4,
"width": 624,
"height": 656,
"content": "## 🕷️ 抓取并总结公司网站"
},
"typeVersion": 1
},
{
"id": "4ecbeb24-7237-4d17-a5bf-6c700a375dab",
"name": "JotForm触发器",
"type": "n8n-nodes-base.jotFormTrigger",
"position": [
-1616,
320
],
"webhookId": "08ad777f-71ae-43a7-bae4-12b584899467",
"parameters": {
"form": "252815075257460"
},
"credentials": {
"jotFormApi": {
"id": "cOSh16Q5l4e0EB1A",
"name": "Jotform jitesh@mediajade.com"
}
},
"typeVersion": 1
},
{
"id": "f62c4c09-6952-4090-8ea5-e0b13f31ed48",
"name": "抓取网站",
"type": "n8n-nodes-url-to-html.urlToHtml",
"position": [
-480,
528
],
"parameters": {
"url": "={{ $json.websiteDomain }}"
},
"credentials": {
"urlToHtmlApi": {
"id": "0wD33X0UF8lvyVM8",
"name": "URL to HTML account"
}
},
"typeVersion": 1
},
{
"id": "eba67aae-a5a5-4335-9448-cb43792b2b31",
"name": "等待批准",
"type": "n8n-nodes-base.gmail",
"position": [
752,
368
],
"webhookId": "7633d532-d9df-4788-95bf-6a612bda1956",
"parameters": {
"sendTo": "jitesh@mediajade.com",
"message": "=Hi there,\n\nAn email has been drafted for a new lead and is ready to be sent out. \n\nEmail Subject: {{ $json.output.emailDraftSubject }}\n\nEmail Body: {{ $json.output.emailDraftBodyHtml }}\n\nNeed your approval. ",
"options": {},
"subject": "=Email Ready for New Lead - {{ $('JotForm Trigger').item.json['E-mail'] }}",
"operation": "sendAndWait"
},
"credentials": {
"gmailOAuth2": {
"id": "PIMDNhXNj8Zyiz3G",
"name": "Gmail account - Deepanshi"
}
},
"typeVersion": 2.1
},
{
"id": "66388dba-ff63-46a1-af4c-0a6ef9960c9b",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1664,
-64
],
"parameters": {
"color": 5,
"width": 832,
"height": 688,
"content": "## 📧 潜在客户接收与电子邮件资格认证"
},
"typeVersion": 1
},
{
"id": "04cc25db-45c5-49ec-adf3-c0818adc0fa3",
"name": "发送遗憾邮件",
"type": "n8n-nodes-base.gmail",
"position": [
-464,
-304
],
"webhookId": "48608edc-7d54-47f6-94eb-9b92031eeb37",
"parameters": {
"sendTo": "={{ $('JotForm Trigger').item.json['E-mail'] }}",
"message": "=Hi {{ $('JotForm Trigger').item.json['Full Name'].first }},\n\nThanks so much for your interest in ClareVoice and taking the time to fill out our demo request form.\n\nAfter reviewing your information, it looks like our Voice AI Agent solutions might not be the best fit for your current needs at this time. We typically work with businesses that handle high volumes of phone calls or have appointment-based services where automation can deliver significant ROI.\n\nThat said, if your communication needs change or your call volume increases in the future, we'd love to reconnect. Feel free to reach out anytime at [your email].\n\nI appreciate you considering ClareVoice, and I wish you all the best with [their company name]!\n\nBest,\nJitesh Dugar\nFounder - ClareVoice",
"options": {
"appendAttribution": false
},
"subject": "Re: Your ClareVoice Demo Request",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"id": "PIMDNhXNj8Zyiz3G",
"name": "Gmail account - Deepanshi"
}
},
"typeVersion": 2.1
},
{
"id": "b0756128-2965-4339-94b0-46ed7edcacb6",
"name": "发送欢迎邮件",
"type": "n8n-nodes-base.gmail",
"position": [
976,
368
],
"webhookId": "4b4f4878-4dee-47de-8306-146bd4224efc",
"parameters": {
"sendTo": "={{ $('JotForm Trigger').item.json['E-mail'] }}",
"message": "={{ $('AI Sales Agent').item.json.output.emailDraftBodyHtml }}",
"options": {
"appendAttribution": false
},
"subject": "={{ $('AI Sales Agent').item.json.output.emailDraftSubject }}"
},
"credentials": {
"gmailOAuth2": {
"id": "PIMDNhXNj8Zyiz3G",
"name": "Gmail account - Deepanshi"
}
},
"typeVersion": 2.1
},
{
"id": "7ed6820d-bf53-4983-9767-f7aac0b9af55",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-608,
-576
],
"parameters": {
"color": 3,
"width": 544,
"height": 480,
"content": "## ❌ 发送遗憾邮件"
},
"typeVersion": 1
},
{
"id": "545c8608-55c4-4127-a415-5613881e9a28",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
256,
-112
],
"parameters": {
"color": 6,
"width": 960,
"height": 912,
"content": "## 🤖 个性化电子邮件"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "c48712f2-3289-4049-8c80-36a9715804f7",
"connections": {
"AI Sales Agent": {
"main": [
[
{
"node": "Wait for Approval",
"type": "main",
"index": 0
}
]
]
},
"Extract Domain": {
"main": [
[
{
"node": "Flag personal email addresses",
"type": "main",
"index": 0
}
]
]
},
"Scrape Website": {
"main": [
[
{
"node": "Summarize website",
"type": "main",
"index": 0
}
]
]
},
"JotForm Trigger": {
"main": [
[
{
"node": "Extract Domain",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Sales Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Summarize website": {
"main": [
[
{
"node": "AI Sales Agent",
"type": "main",
"index": 0
}
]
]
},
"Wait for Approval": {
"main": [
[
{
"node": "Send Welcome Email",
"type": "main",
"index": 0
}
]
]
},
"Is Personal Email?": {
"main": [
[
{
"node": "Send Regret Email",
"type": "main",
"index": 0
}
],
[
{
"node": "Scrape Website",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "AI Sales Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Flag personal email addresses": {
"main": [
[
{
"node": "Is Personal Email?",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
有发票附件?
使用 GPT-4o 欺诈检测和 QuickBooks 自动提取并审批发票
If
Code
Gmail
+9
22 节点Jitesh Dugar
AI 驱动的招聘:使用 Jotform 进行简历筛选和候选人路由
简历筛选与候选人路由,使用GPT-4o-mini、Jotform和Google Sheets
If
Set
Code
+10
20 节点Jitesh Dugar
AI招生审核:论文分析、综合评分与候选人排名
GPT-4o驱动的招生审核:论文分析、综合评分与候选人排名
If
Set
Gmail
+8
22 节点Jitesh Dugar
AI医疗分诊:智能分诊、医生简报和紧急情况检测
基于GPT-4和JotForm的医疗分诊与预约自动化
If
Set
Code
+8
22 节点Jitesh Dugar
使用 GPT-4 分析和 JotForm 离职面谈自动化员工离职流程
使用 GPT-4 分析和 JotForm 离职面谈实现员工离职流程自动化
If
Set
Code
+6
20 节点Jitesh Dugar
使用 JotForm、GPT-4o-mini 和 Google Workspace 自动化员工入职
使用 JotForm、GPT-4o-mini 和 Google Workspace 实现员工入职自动化
If
Set
Code
+6
14 节点Jitesh Dugar
工作流信息
难度等级
高级
节点数量16
分类-
节点类型10
作者
Jitesh Dugar
@jiteshdugarAI Automation Specialist - OpenAI, CRM & Automation Expert with a solid understanding of various tools that include Zapier, Make, Zoho CRM, Hubspot, Google Sheets, Airtable, Pipedrive, Google Analytics, and more.
外部链接
在 n8n.io 查看 →
分享此工作流