基于AI的WhatsApp销售机器人,带Google Sheets查询功能
中级
这是一个Lead Nurturing, AI Chatbot领域的自动化工作流,包含 10 个节点。主要使用 If, Webhook, GmailTool, Agent, GoogleSheetsTool 等节点。 使用DeepSeek AI、Google Sheets和Gmail通知自动化WhatsApp销售
前置要求
- •HTTP Webhook 端点(n8n 会自动生成)
- •Google 账号和 Gmail API 凭证
- •Google Sheets API 凭证
- •PostgreSQL 数据库连接信息
使用的节点 (10)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "cNNZ3M4oqFQhVgJc",
"meta": {
"instanceId": "ea2b41532677d34614d95d13d7d2ccb694657be482144baf71e7140df3b2a853",
"templateCredsSetupCompleted": true
},
"name": "基于 AI 的 WhatsApp 销售机器人,带 Google Sheets 查询功能",
"tags": [],
"nodes": [
{
"id": "e584cd33-a6da-483f-9de4-4f9e186eb538",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
336,
-96
],
"parameters": {
"text": "={{ $json.body.data.message.conversation }}",
"options": {
"systemMessage": "You represent X company, Your name is Ahmed. Please answer customer inquiries using the information provided in the Google Sheet. Please send an email to the customer service representative only if the customer requests to purchase an item. Before sending the email, ask the customer for their name and phone number, delivery or pickup date, and send them to the customer service representative via Email.\nPhone number format is 10 digits starts with 05 (05XXXXXXXX).\nSpeak with Customers in Saudi dialect.\nYou should welcome the user firstly with (هلا وغلا).\nDon't give any answers outside the provided Google Sheet."
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "62c4d503-ad9e-4b3e-903a-db7392771020",
"name": "在 Gmail 中发送消息",
"type": "n8n-nodes-base.gmailTool",
"position": [
784,
160
],
"webhookId": "9fe4c701-9d99-4ae3-9b39-52a978171f4b",
"parameters": {
"sendTo": "Customer Service Email",
"message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
"options": {
"appendAttribution": false
},
"subject": "New Purchase Request ",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"id": "h3RnkjQjRABg68QN",
"name": "GmailAuthentication"
}
},
"typeVersion": 2.1
},
{
"id": "58f5ed7f-5508-4802-add9-e732ed02ab70",
"name": "在Google Sheets中获取行",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
592,
240
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "Your Google Sheet URL",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1m1Do9umLUVyCzqpCS75zvCBSddtwWw4lAok2QHHKWKg",
"cachedResultUrl": "Your Google Sheet URL",
"cachedResultName": "Your Company Items"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "KJ3WD4ZJZo6YMqm3",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "fa4accc6-b622-4fd3-8b2b-eba606ce8cb2",
"name": "DeepSeek 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
"position": [
176,
208
],
"parameters": {
"options": {}
},
"credentials": {
"deepSeekApi": {
"id": "hyKdJBiLLtHwOZ4h",
"name": "DeepSeek API Account"
}
},
"typeVersion": 1
},
{
"id": "33806930-5fb1-4ee1-afeb-f0741a6691c7",
"name": "如果消息不是来自群组且不是外发消息",
"type": "n8n-nodes-base.if",
"position": [
176,
-256
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "419382f9-3a23-40ba-afa1-33d71252d2e7",
"operator": {
"type": "boolean",
"operation": "equals"
},
"leftValue": "={{ $json.body.data.key.fromMe }}",
"rightValue": "={{false}}"
},
{
"id": "df484897-bdd3-490f-9902-0b2b51906bd1",
"operator": {
"type": "boolean",
"operation": "equals"
},
"leftValue": "={{ $json.body.data.key.remoteJid.includes('@g.us') }}",
"rightValue": "={{false}}"
},
{
"id": "6d2be59c-30bd-4de3-a36b-720adaa5cbcf",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "4251d06b-1440-410b-a351-7d1f1033e8e8",
"name": "无操作,不执行任何操作",
"type": "n8n-nodes-base.noOp",
"position": [
464,
-240
],
"parameters": {},
"typeVersion": 1
},
{
"id": "42fafb47-7405-4c0e-8d14-f4012f9e5d01",
"name": "发送文本",
"type": "n8n-nodes-evolution-api.evolutionApi",
"position": [
704,
-96
],
"parameters": {
"resource": "messages-api",
"remoteJid": "={{ $('Webhook: WhatsApp Message Trigger').item.json.body.data.key.remoteJid }}",
"messageText": "={{ $json.output }}",
"instanceName": "Your Instance Name",
"options_message": {}
},
"credentials": {
"evolutionApi": {
"id": "OfCJPxnswdkJBefM",
"name": "Evolution account"
}
},
"typeVersion": 1
},
{
"id": "85a788eb-f660-4537-b9e3-d195ff309f2d",
"name": "Webhook:WhatsApp 消息触发器",
"type": "n8n-nodes-base.webhook",
"position": [
-16,
-256
],
"webhookId": "da45cd88-1b08-45b5-bb70-a11688365804",
"parameters": {
"path": "whatsAppListen",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 2
},
{
"id": "36cd632d-e0fb-490f-b821-ab96d8cf255b",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-608,
-112
],
"parameters": {
"width": 544,
"height": 384,
"content": "## 🚀 基于 AI 的 WhatsApp 销售机器人,带 Google Sheets 查询功能"
},
"typeVersion": 1
},
{
"id": "858bc82c-a986-4805-be88-85570918c90e",
"name": "使用 Postgres 的聊天记忆",
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
"position": [
352,
112
],
"parameters": {
"sessionKey": "={{ $('Webhook: WhatsApp Message Trigger').item.json.body.data.key.remoteJid }}",
"sessionIdType": "customKey",
"contextWindowLength": 1000
},
"credentials": {
"postgres": {
"id": "S1VWsGUdIS78Fgpy",
"name": "Postgres account"
}
},
"typeVersion": 1.3
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "1d94995f-5416-42a7-87ef-893c9d7a44df",
"connections": {
"AI Agent": {
"main": [
[
{
"node": "Enviar texto",
"type": "main",
"index": 0
}
]
]
},
"DeepSeek Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Send a message in Gmail": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Chat Memory with Postgres": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Webhook: WhatsApp Message Trigger": {
"main": [
[
{
"node": "If message not from group and not outbound",
"type": "main",
"index": 0
}
]
]
},
"Get row(s) in sheet in Google Sheets": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"If message not from group and not outbound": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 客户培育, AI 聊天机器人
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
宠物店 4
🐶 宠物店预约 AI 代理
If
Set
Code
+41
187 节点Bruno Dias
人工智能
HelpDesk 工作流
基于AI的Slack内部帮助台,集成GPT-4o和邮件升级
If
Slack
Webhook
+8
25 节点Karam Ghazzi
内部知识库
自动向新Vtiger潜在客户发送欢迎WhatsApp消息
通过Evolution API WhatsApp自动向Vtiger CRM潜在客户发送欢迎消息
If
Schedule Trigger
Vtiger Node
+3
7 节点Ahmed Saadawi
客户培育
适用于CRM集成企业的完整客户支持WhatsApp AI机器人
构建集成LangChain、OpenAI和CRM的WhatsApp客户支持机器人
Set
Switch
Webhook
+7
26 节点Ahmed Saadawi
客服机器人
在可视化参考库中探索n8n节点
在可视化参考库中探索n8n节点
If
Ftp
Set
+93
113 节点I versus AI
其他
构建用于Slack候选人评估的AI驱动聊天机器人
AI简历分析与候选人评估:Slack和Google表格集成
If
Code
Slack
+12
29 节点Trung Tran
AI 聊天机器人
工作流信息
难度等级
中级
节点数量10
分类2
节点类型10
作者
Ahmed Saadawi
@ahmedsaadawiCRM consultant and automation expert with 15+ years of experience building AI-powered, no-code workflows for sales, support, and operations. Open to collaboration or custom solutions — let’s connect!
外部链接
在 n8n.io 查看 →
分享此工作流