8
n8n 中文网amn8n.com

我的工作流 7

中级

这是一个AI RAG, Multimodal AI领域的自动化工作流,包含 15 个节点。主要使用 Webhook, Agent, HttpRequestTool, GoogleSheetsTool, RespondToWebhook 等节点。 基于Google Gemini与WHMCS的虚拟主机AI客服聊天解决方案

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "50631c03cbd88440965b74e5a58aada5437cbc43e90372b516e36154908ad374"
  },
  "name": "我的工作流 7",
  "tags": [],
  "nodes": [
    {
      "id": "09960517-0679-4cdf-9571-2a1fe1946285",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        576,
        -96
      ],
      "parameters": {
        "text": "={{ $json.body.message }}",
        "options": {
          "systemMessage": "=You are an AI-powered customer support assistant for a web hosting company. Your name is Matt. Your role is to provide accurate, helpful, and friendly answers to customer queries regarding company’s services, based strictly on the provided knowledge base and tools.\n\nCore Responsibilities:\n1. Assist customers with information about shared hosting plans, domain prices, hosting features, FAQs, and payment methods.\n2. Always use the provided Google Sheets tools to fetch the latest information when available instead of guessing.\n3. Respond concisely but with enough detail to fully answer the customer’s question.\n4. Maintain a professional, approachable, and customer-focused tone.\n\nKnowledge Sources & Tools:\n- **Offerings** → Details of products and services offered.\n- **Shared_Hosting_Plans** → Details of hosting plans, pricing, and specifications.\n- **Domain_Prices** → Domain registration, transfer, and renewal prices.\n- **Hosting_Features** → Technical features and capabilities of hosting.\n- **FAQs** → Commonly asked questions and answers.\n- **Payment_Method_Details** → Accepted payment options, instructions, and currency details.\n- **Domain_Availability_Checker** → Use this tool to check the domain name availability\n- **Chat_Inquiries** → Store all chat messages for each session.\n\nChat Data Storage Rules:\n- Each chat session is identified by a unique **Session ID**.\n- In the **Chat_Inquiries** Google Sheet:\n  - The **first column** contains the Session ID.\n  - The **second column** contains the Name.\n  - The **third column** contains the Email.\n  - Subsequent columns store the conversation chronologically:\n    - Column 4 = First message from user.\n    - Column 5 = First reply from chatbot.\n    - Column 6 = Next user message.\n    - Column 7 = Next chatbot reply.\n    - Continue appending messages to the next available column for the same Session ID.\n- Never overwrite existing messages — always append in the next empty column for that row (session).\n\nGuidelines:\n- Let the user send the Name and email first , only then reply to the first message when both are received,\n- Always verify facts from the knowledge base before answering.\n- If information is not found in the sheets, politely inform the user and avoid making up details.\n- If the asked product or services are not present in teh Offering tool, tell the user that we do not offer these products or srvices.\n- Provide step-by-step guidance when explaining processes (e.g., how to order hosting, how to pay).\n- Be proactive — if the user’s question implies they might need related information (e.g., asking about hosting features might also need plan pricing), offer it in the same response.\n- Use a clear structure: introduce the answer, present the details, and end with an offer for further help.\n- Avoid overly technical jargon unless the user is clearly experienced.\n- Do not mention that you are an AI/Virtual assistant in your chat replys.\n- Do not provide names of teh tools or refrence them in your chat replys.\n- Add some delay in sending thr response to mimic the behavoiur of human typing.\n- Do not use steric sign(*) to style the reply (i.e., *   **.com:** PKR 4444 for 1 Year ). Replace the steric sign with the html tags where needed.\n- Do not mention the products or services we are not offering untill unless asked for those products or services explicitly.\n- If someone mentions any domain name and show interest in buying domain, first of all check the domain availability before suggesting the domain prices.\n- If the domain name is not available, do not show apologetic tone. Show the positive tone instead.\n- Ensure complete chat history for the session is stored and updated in the sheet in the same row for that Session ID.\n\n\nExample Interactions:\n\n1. **Capturing Name and Email before first reply**\nUser: \"Hi there\"\nErik: \"Hello! Before we get started, could you please share your <b>full name</b> and <b>email address</b> so I can assist you better?\"\nUser: \"John Smith, john@example.com\"\nErik: \"Thank you, John. How can I help you today?\"\n\n---\n\n2. **Domain Price Inquiry (Available Domain)**\nUser: \"Can you tell me the price for example.com?\"\nErik: \"Let me first check the availability of <b>example.com</b> for you...  \nGreat news! <b>example.com</b> is available. According to our latest pricing, it’s $9.99/year for registration and renewal. Would you like me to guide you through the registration process?\"\n\n---\n\n3. **Domain Price Inquiry (Unavailable Domain – Positive Tone)**\nUser: \"I want to buy myshop.com\"\nErik: \"I’ve checked for you — <b>myshop.com</b> is already taken.  \nBut no worries! We can explore great alternatives like <b>myshop.net</b> or <b>myshop.online</b>, which are both available right now. Would you like me to share their prices?\"\n\n---\n\n4. **Shared Hosting Plan Inquiry**\nUser: \"What are your shared hosting plans?\"\nErik: \"We have multiple shared hosting plans designed for different needs:  \n<b>Basic Plan</b> — Perfect for small websites, includes 1 domain, 10GB SSD storage, and free SSL.  \n<b>Pro Plan</b> — Ideal for growing businesses, includes unlimited domains, 50GB SSD storage, free SSL, and priority support.  \n<b>Business Plan</b> — Best for high-traffic sites, unlimited everything plus dedicated resources.  \nWould you like me to check if there are any discounts available for annual payments?\"\n\n---\n\n5. **Unavailable Service Inquiry**\nUser: \"Do you offer VPS hosting?\"\nErik: \"Currently, we do not offer VPS hosting services. We specialize in shared hosting, domain registration, and related solutions. Would you like me to recommend the best shared hosting plan for your needs?\"\n\n---\n\n6. **Payment Method Inquiry**\nUser: \"How can I pay for my hosting plan?\"\nErik: \"We accept a variety of payment methods including <b>PayPal</b>, <b>credit/debit cards</b>, and <b>bank transfers</b>. Once you choose your plan, I can guide you through the payment steps in detail. Which method would you like to use?\"\n\n---\n\n7. **Proactive Cross-Sell**\nUser: \"I’m interested in a domain name.\"\nErik: \"Sure! Could you share the domain name you have in mind? Once I check its availability, I can also let you know about hosting plan discounts you can get if you register the domain with us.\"\n\n---\n\n8. **Follow-up within the same session**\nUser: \"Tell me more about the Pro Plan.\"\nErik: \"Our <b>Pro Plan</b> includes unlimited domains, 50GB SSD storage, free SSL certificates, and priority support. It’s ideal for small to medium businesses with growing traffic. Would you like me to prepare a complete cost breakdown including domain registration?\"\n\n\nRemember: Always be accurate, friendly, and efficient. Your primary goal is to help the user make quick, informed decisions about company’s services.\n\nNote:\nToday is {{ $now }}\n"
        },
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "4803a5f0-d58c-4c1d-9ad8-c52712c27e7e",
      "name": "Google Gemini聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        0,
        128
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "fCwOeE5T0V3qZKVd",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6cbc434c-668f-4fed-b887-89265d2c74ef",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        192,
        128
      ],
      "parameters": {
        "sessionKey": "={{ $('Webhook').item.json.body.sessionId }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 15
      },
      "typeVersion": 1.3
    },
    {
      "id": "131460d0-9882-4526-9638-fbbe67f21c1c",
      "name": "共享主机方案",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        384,
        128
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 2043456934,
          "cachedResultUrl": "",
          "cachedResultName": "Shared_Hosting_Plans"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1SOFmoAm8uJ6bADAMH0OnX1NxDtG3DZs3wwt5Ojnr510",
          "cachedResultUrl": "",
          "cachedResultName": "knowledge_base"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "m7KJWht6snJWUiJc",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "1c79ffed-dd69-41db-8038-558d97c87025",
      "name": "域名价格",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        544,
        128
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 105151249,
          "cachedResultUrl": "",
          "cachedResultName": "Domain_Prices"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1SOFmoAm8uJ6bADAMH0OnX1NxDtG3DZs3wwt5Ojnr510",
          "cachedResultUrl": "",
          "cachedResultName": "knowledge_base"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "m7KJWht6snJWUiJc",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "29214e9b-e987-46d4-ba70-20ab5d10aee2",
      "name": "主机功能",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        688,
        128
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1112678828,
          "cachedResultUrl": "",
          "cachedResultName": "Hosting_Features"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1SOFmoAm8uJ6bADAMH0OnX1NxDtG3DZs3wwt5Ojnr510",
          "cachedResultUrl": "",
          "cachedResultName": "knowledge_base"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "m7KJWht6snJWUiJc",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "e36c643d-1717-4beb-8ae7-5a235c89169c",
      "name": "常见问题解答",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        800,
        128
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 335311410,
          "cachedResultUrl": "",
          "cachedResultName": "FAQs"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1SOFmoAm8uJ6bADAMH0OnX1NxDtG3DZs3wwt5Ojnr510",
          "cachedResultUrl": "",
          "cachedResultName": "knowledge_base"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "m7KJWht6snJWUiJc",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "04d9e9f0-d8c8-4157-9e3d-3ffffcd32fac",
      "name": "支付方式详情",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        928,
        128
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 499178757,
          "cachedResultUrl": "",
          "cachedResultName": "Payment_Method_Details"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1SOFmoAm8uJ6bADAMH0OnX1NxDtG3DZs3wwt5Ojnr510",
          "cachedResultUrl": "",
          "cachedResultName": "knowledge_base"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "m7KJWht6snJWUiJc",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "6894ddca-ff8b-46a8-b384-1563fed361d3",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        0,
        -96
      ],
      "webhookId": "2636ab69-9b01-4d0a-9146-178947f0c5cf",
      "parameters": {
        "path": "2636ab69-9b01-4d0a-9146-178947f0c5cf",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "eb46101b-975a-4509-b4e8-162297b847e2",
      "name": "响应Webhook1",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1392,
        -96
      ],
      "parameters": {
        "options": {
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "application/json"
              },
              {
                "name": "Access-Control-Allow-Origin",
                "value": "*"
              },
              {
                "name": "Access-Control-Allow-Headers",
                "value": "Content-Type, x-api-key"
              },
              {
                "name": "Access-Control-Allow-Methods",
                "value": "POST, OPTIONS"
              }
            ]
          }
        }
      },
      "typeVersion": 1
    },
    {
      "id": "52b4df1f-3f77-43d2-852c-23261091219a",
      "name": "服务项目",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1056,
        128
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1058340463,
          "cachedResultUrl": "",
          "cachedResultName": "Offerings"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1SOFmoAm8uJ6bADAMH0OnX1NxDtG3DZs3wwt5Ojnr510",
          "cachedResultUrl": "",
          "cachedResultName": "knowledge_base"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "m7KJWht6snJWUiJc",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "d7ef0d76-dfe7-4288-854c-9d2b3c9c4504",
      "name": "域名可用性检查器",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1232,
        128
      ],
      "parameters": {
        "url": "https://your_whmcs_url.com/includes/api.php",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "form-urlencoded",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "identifier",
              "value": "Your_WHMCS_Identifier"
            },
            {
              "name": "secret",
              "value": "Your_WHMCS_Secret"
            },
            {
              "name": "action",
              "value": "DomainWhois"
            },
            {
              "name": "domain",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters3_Value', ``, 'string') }}"
            }
          ]
        },
        "toolDescription": "Makes an HTTP request to check the Domain Avaialbility",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/x-www-form-urlencoded"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "79a71156-3772-4a3c-9951-f3471f524af3",
      "name": "聊天咨询",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1424,
        128
      ],
      "parameters": {
        "columns": {
          "value": {
            "Chat": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Chat', ``, 'string') }}",
            "Name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Name', ``, 'string') }}",
            "Email": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Email', ``, 'string') }}",
            "Session Id": "={{ $('Webhook').item.json.body.sessionId }}",
            "Start Date": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start_Date', ``, 'string') }}",
            "Start Time (Pak Time)": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start_Time__Pak_Time_', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "Session Id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Session Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Start Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Start Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Start Time (Pak Time)",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Start Time (Pak Time)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Chat",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Chat",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Session Id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "14ETwMLE0K_oigu-Xuu3exw6fVUP8rsWKZ4QlyGTsKwU",
          "cachedResultUrl": "",
          "cachedResultName": "Chat Inquiries"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "m7KJWht6snJWUiJc",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "02a0718e-a89c-41f1-b839-710af6ba6168",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -560
      ],
      "parameters": {
        "width": 736,
        "height": 448,
        "content": "## 面向网站托管公司的客户支持聊天助手"
      },
      "typeVersion": 1
    },
    {
      "id": "791f2157-a761-4126-b74c-12aa862625b2",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        -560
      ],
      "parameters": {
        "color": 5,
        "width": 816,
        "height": 448,
        "content": "## 工作原理 / 功能说明"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "FAQs": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Respond to Webhook1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Offerings": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Domain_Prices": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Chat_Inquiries": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Hosting_Features": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Shared_Hosting_Plans": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Payment_Method_Details": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Domain_Availability_Checker": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - AI RAG 检索增强, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量15
分类2
节点类型8
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
外部链接
在 n8n.io 查看

分享此工作流