LeadBot自动驾驶:用于Salesforce自动化的聊天转潜在客户
高级
这是一个Lead Generation, Multimodal AI领域的自动化工作流,包含 21 个节点。主要使用 SlackTool, EmailSendTool, SalesforceTool, Agent, ToolThink 等节点。 基于 GPT-4 的 Salesforce 对话式线索捕获,支持 Slack 和邮件通知
前置要求
- •Slack Bot Token 或 Webhook URL
- •Salesforce OAuth 凭证
- •OpenAI API Key
使用的节点 (21)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "HVThZXxmw59rTi0T",
"meta": {
"instanceId": "9a562c06a632241f66aadd52a495ad98e76b760ef5cfce9c319a4759c47cd94e",
"templateCredsSetupCompleted": true
},
"name": "LeadBot自动驾驶:用于Salesforce自动化的聊天转潜在客户",
"tags": [],
"nodes": [
{
"id": "0e189df7-1be1-4ec7-aca1-0810787c426d",
"name": "当收到聊天消息时",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-940,
-140
],
"webhookId": "67253c51-a3e8-4657-bf6e-e65174788ecb",
"parameters": {
"public": true,
"options": {},
"initialMessages": "Hi! I'm LeadBot. I'll help you submit your interest. Let's start with your full name."
},
"typeVersion": 1.1
},
{
"id": "ca3d5237-58be-48ad-8f22-2c02ce62b882",
"name": "AI 代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-240,
-120
],
"parameters": {
"options": {
"systemMessage": "You are a friendly and efficient chatbot named LeadBot, designed to replace web forms. Your goal is to collect information conversationally: Full Name, Email, Mobile Phone, and Product Interest. Guide the user step-by-step, asking one piece of info at a time. Be polite, confirm inputs, and handle corrections.\nRules:\n\nStart by greeting and explaining: \"Hi! I'm LeadBot. I'll help you submit your interest. Let's start with your full name.\"\nCollect in order: Name → Email (validate format) → Mobile Phone (validate as phone number) → Product Interest ([\"CRM Software\", \"Marketing Automation\"] – present as options).\nAfter Email: Always use the 'check_duplicate_lead' tool to search for existing records by email. If duplicate found, silently proceed to update the existing record (do not ask the user).\nValidate all inputs: If invalid (e.g., bad email or phone format), politely ask again.\nOnce all info collected: Use 'create_lead' or 'update_lead' tool to submit or update the info – If there is an existing record, pass the lead_id to update_lead; otherwise, use create_lead.\nAfter success: Use 'send_notification_internal' to notify the internal team via Slack (e.g., \"New/updated interest: [Name] - [Email] - [Interest]\"), and 'send_notification_client' to send a personalized message to the client based on their product interest (e.g., email with details about the chosen interest).\nEnd conversation: \"Thanks! Your request has been logged. We'll contact you soon.\"\nIf user wants to stop: Politely end and don't submit anything.\nKeep responses concise, under 100 words.\nOnly use tools when necessary; do not hallucinate data.\nUse the 'think' tool for internal reasoning on complex decisions, like ambiguous inputs or name splitting.\n\nAvailable Tools (use function calling format):\n\ncheck_duplicate_lead: Checks for duplicate record by email.\n\nParameters: email (string, required)\nReturns: {exists: boolean, lead_id: string or null, details: {name: string, birthday: string, interest: string} or null}\n\n\nupdate_lead: Updates existing record.\n\nParameters: firstname (string), lastname (string), email (string), mobile (string), interest (string), lead_id (string)\nReturns: {success: boolean, lead_id: string, message: string}\nAlways respond in JSON if calling tools, but output natural text to user.\n\n\ncreate_lead: Creates new record.\n\nParameters: firstname (string), lastname (string), email (string), mobile (string), interest (string)\nReturns: {success: boolean, lead_id: string, message: string}\nAlways respond in JSON if calling tools, but output natural text to user.\n\n\nsend_notification_internal: Sends Slack notification to internal team about the new/updated record.\n\nParameters: lead_id (string), name (string), email (string), interest (string)\nReturns: {success: boolean, message: string}\nAlways respond in JSON if calling tools, but output natural text to user.\n\n\nsend_notification_client: Sends personalized notification to the client based on their product interest.\n\nParameters: email (string), name (string), interest (string)\nReturns: {success: boolean, message: string}\nAlways respond in JSON if calling tools, but output natural text to user.\n\n\nthink: Allows you to reflect and reason step by step before answering. Use for complex queries or decisions.\n\nParameters: none\nReturns: {thought: string} (your reasoned response for internal use)\nAlways respond in JSON if calling tools, but output natural text to user."
}
},
"typeVersion": 2
},
{
"id": "7c22366f-4295-4aee-a91e-89dd17a604a6",
"name": "OpenAI 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-1200,
220
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1",
"cachedResultName": "gpt-4.1"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "ciKVFfcmd36noEnL",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "02f3e832-199a-496e-8379-7ab7689c5855",
"name": "简单记忆",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
-880,
220
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "72ca5cb3-f1e1-4edd-b9fa-7ebfcba0b4ec",
"name": "检查重复潜在客户",
"type": "n8n-nodes-base.salesforceTool",
"position": [
-340,
220
],
"parameters": {
"options": {
"conditionsUi": {
"conditionValues": [
{
"field": "Email",
"value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditionValues0_Value', ``, 'string') }}"
}
]
}
},
"operation": "getAll",
"returnAll": true,
"descriptionType": "manual",
"toolDescription": "Get many leads in Salesforce"
},
"credentials": {
"salesforceOAuth2Api": {
"id": "LDbxyOy7NMH6fin9",
"name": "Salesforce account 2"
}
},
"typeVersion": 1
},
{
"id": "1ea47fba-b284-4bc9-bc02-6d77d2ffd893",
"name": "思考",
"type": "@n8n/n8n-nodes-langchain.toolThink",
"position": [
-600,
220
],
"parameters": {},
"typeVersion": 1
},
{
"id": "9d139e15-a0c6-4be7-a14f-b4249eb1bbaf",
"name": "更新潜在客户",
"type": "n8n-nodes-base.salesforceTool",
"position": [
-80,
240
],
"parameters": {
"leadId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Lead_ID', ``, 'string') }}",
"operation": "update",
"updateFields": {
"email": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Email', ``, 'string') }}",
"lastname": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Last_Name', ``, 'string') }}",
"firstname": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('First_Name', ``, 'string') }}",
"mobilePhone": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Mobile_Phone', ``, 'string') }}",
"customFieldsUi": {
"customFieldsValues": [
{
"value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('customFieldsValues0_Value', ``, 'string') }}",
"fieldId": "ProductInterest__c"
}
]
}
}
},
"credentials": {
"salesforceOAuth2Api": {
"id": "LDbxyOy7NMH6fin9",
"name": "Salesforce account 2"
}
},
"typeVersion": 1
},
{
"id": "d378581f-7736-4f2d-beb7-1b5e7cd5d483",
"name": "创建潜在客户",
"type": "n8n-nodes-base.salesforceTool",
"position": [
180,
240
],
"parameters": {
"company": "={{ $fromAI('Company', ``, 'string') }}",
"lastname": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Last_Name', ``, 'string') }}",
"additionalFields": {
"email": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Email', ``, 'string') }}",
"firstname": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('First_Name', ``, 'string') }}",
"mobilePhone": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Mobile_Phone', ``, 'string') }}",
"customFieldsUi": {
"customFieldsValues": [
{
"value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('customFieldsValues0_Value', ``, 'string') }}",
"fieldId": "ProductInterest__c"
}
]
}
}
},
"credentials": {
"salesforceOAuth2Api": {
"id": "LDbxyOy7NMH6fin9",
"name": "Salesforce account 2"
}
},
"typeVersion": 1
},
{
"id": "12f7e77e-f03f-4163-96be-fa1fd3fcf538",
"name": "发送客户端通知",
"type": "n8n-nodes-base.emailSendTool",
"position": [
720,
220
],
"webhookId": "e415e952-e26b-471c-b8f3-002de9842a74",
"parameters": {
"html": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('HTML', ``, 'string') }}",
"options": {},
"subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}",
"toEmail": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('To_Email', ``, 'string') }}",
"fromEmail": "test@example.com"
},
"credentials": {
"smtp": {
"id": "JNtQ5FosqXaLKi5O",
"name": "SMTP account"
}
},
"typeVersion": 2.1
},
{
"id": "be44e29f-7a46-4eae-8d8c-33d8ec58f998",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2000,
120
],
"parameters": {
"width": 600,
"height": 520,
"content": "## 工作流概览"
},
"typeVersion": 1
},
{
"id": "a0bc70e3-d94f-4a7e-8c69-3922a478be2b",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-960,
340
],
"parameters": {
"color": 3,
"width": 260,
"height": 320,
"content": "## 内存管理"
},
"typeVersion": 1
},
{
"id": "f22cc811-5994-471b-8a2e-6af73c2a2f95",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-680,
340
],
"parameters": {
"color": 4,
"width": 260,
"height": 320,
"content": "## 内部推理"
},
"typeVersion": 1
},
{
"id": "468f2843-0870-4b40-a607-09041e537db7",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1300,
340
],
"parameters": {
"color": 2,
"width": 300,
"height": 220,
"content": "## 语言模型"
},
"typeVersion": 1
},
{
"id": "753b25f0-e81f-42fb-89de-3108b43b9b02",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1420,
-220
],
"parameters": {
"width": 440,
"height": 260,
"content": "## 聊天触发步骤"
},
"typeVersion": 1
},
{
"id": "5741242e-6315-4dc7-a965-c57893f9b379",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
380,
380
],
"parameters": {
"color": 6,
"height": 280,
"content": "## 内部通知"
},
"typeVersion": 1
},
{
"id": "dbe62204-1d71-4f27-8b4d-c548b3ac47ff",
"name": "便签 6",
"type": "n8n-nodes-base.stickyNote",
"position": [
640,
380
],
"parameters": {
"color": 6,
"height": 280,
"content": "## 客户端通知"
},
"typeVersion": 1
},
{
"id": "236a61ef-0c2b-42fb-967f-ee1f6df2ca20",
"name": "便签7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-140,
380
],
"parameters": {
"color": 5,
"height": 280,
"content": "## 更新潜在客户"
},
"typeVersion": 1
},
{
"id": "31de4234-4233-45d7-89ba-53d43db7542d",
"name": "便签8",
"type": "n8n-nodes-base.stickyNote",
"position": [
-400,
380
],
"parameters": {
"color": 5,
"height": 280,
"content": "## 重复检查"
},
"typeVersion": 1
},
{
"id": "d0ceab0d-a4bf-4020-b55b-57433716fdb3",
"name": "便签9",
"type": "n8n-nodes-base.stickyNote",
"position": [
120,
380
],
"parameters": {
"color": 5,
"height": 280,
"content": "## 创建潜在客户"
},
"typeVersion": 1
},
{
"id": "cb4396b7-f375-485f-bdf4-bcc8b1b31bb4",
"name": "发送内部通知",
"type": "n8n-nodes-base.slackTool",
"position": [
440,
220
],
"webhookId": "d9d3dc88-ffaf-4469-8736-805be0ff8f81",
"parameters": {
"text": "={{ $fromAI('Message_Text', ``, 'string') }}",
"user": {
"__rl": true,
"mode": "list",
"value": "U08QYRBEE3V",
"cachedResultName": "ai_agent"
},
"select": "user",
"otherOptions": {}
},
"credentials": {
"slackApi": {
"id": "RS6fmPwwNPKGfeZC",
"name": "Slack account"
}
},
"typeVersion": 2.3
},
{
"id": "d0752cee-6fc3-4cc6-9ec6-087105fb6952",
"name": "便签10",
"type": "n8n-nodes-base.stickyNote",
"position": [
-320,
-400
],
"parameters": {
"width": 440,
"height": 260,
"content": "## 核心AI代理"
},
"typeVersion": 1
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "b1a21499-089f-4390-a9ba-e0d715c3d104",
"connections": {
"Think": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[]
]
},
"create_lead": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"update_lead": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"check_duplicate_lead": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"send_notification_client": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"send_notification_internal": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 潜在客户开发, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
LeadBot 自动驾驶 — Salesforce 聊天转线索
基于 Salesforce 和 GPT 的对话式线索捕获与日程安排
Slack Tool
Email Send Tool
Salesforce Tool
+7
25 节点Le Nguyen
AI 聊天机器人
AI网站聊天机器人 - GPT与Google表格CRM线索收集
集成GPT和Google表格的AI网站聊天机器人 - CRM线索收集系统
Code
Google Sheets
Agent
+7
14 节点Robert Breen
潜在客户开发
构建基于Supabase和GPT-5的高级多查询RAG系统
构建基于Supabase和GPT-5的高级多查询RAG系统
If
Set
Filter
+13
22 节点Guillaume Duvernay
AI RAG 检索增强
💥 使用ChatGPT-5构建您的第一个AI代理
使用GPT-5、Google日历和表格创建知识库与日程安排AI助手
Gmail Tool
Agent
Google Sheets Tool
+6
14 节点Dr. Firas
杂项
✨🩷自动化社交媒体内容发布工厂 + 系统提示组合
基于动态系统提示和GPT-4o的AI驱动多平台社交媒体内容工厂
If
Set
Code
+20
100 节点Amit Mehta
内容创作
ServiceNow L1支持代理
基于GPT-4的ServiceNow聊天分流——事件与请求路由
Service Now
Http Request
Agent
+7
15 节点Tushar Mishra
AI 聊天机器人
工作流信息
难度等级
高级
节点数量21
分类2
节点类型9
作者
Le Nguyen
@leeseiferSalesforce Architect with 10+ years of experience in CRM, integrations, and automation. Skilled in Apex, LWC, REST APIs, and full-stack dev (JavaScript, .NET). I build secure, scalable workflows in n8n—connecting Salesforce, Stripe, and more. Passionate about lead scoring, data sync, and secure field masking. Certified Application Architect with deep expertise in platform, integration, and data architecture.
外部链接
在 n8n.io 查看 →
分享此工作流