8
n8n 中文网amn8n.com

网站聊天机器人代理

中级

这是一个Support Chatbot, AI Chatbot领域的自动化工作流,包含 8 个节点。主要使用 Agent, ChatTrigger, LmChatOpenAi, ToolWorkflow, MemoryBufferWindow 等节点。 集成OpenAI GPT和RAG知识库的多智能体网站聊天机器人

前置要求
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "wnDz3dZ455lkg5la",
  "meta": {
    "instanceId": "a88d54d0dc140647df8f628579b3d5aae0dedb13c983a1f5c11ee14f54f18774",
    "templateCredsSetupCompleted": true
  },
  "name": "网站聊天机器人代理",
  "tags": [
    {
      "id": "VjxhWkY5mLmByR16",
      "name": "Active",
      "createdAt": "2025-06-19T23:49:38.399Z",
      "updatedAt": "2025-06-19T23:49:55.312Z"
    }
  ],
  "nodes": [
    {
      "id": "564d5030-4338-433f-91aa-fb01b376f888",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        60,
        80
      ],
      "webhookId": "8f61c22c-0a61-4153-99e6-8f11c336c70d",
      "parameters": {
        "mode": "webhook",
        "public": true,
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "c720eaaf-0fb0-402d-a9c1-c503bd4a919d",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        200,
        460
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "E9waf1c33TsN4RCh",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b8992569-06c1-4ebb-8fbe-e3f5ea91c00b",
      "name": "calendarAgent",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        1140,
        500
      ],
      "parameters": {
        "name": "calendarAgent",
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "LpmYLHWdvevdwt5e",
          "cachedResultName": "Calendar Agent"
        },
        "description": "调用此工具执行任何日历操作。",
        "workflowInputs": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e5f6d811-75ac-48ef-b891-a94732f01f01",
      "name": "RAGagent",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        940,
        580
      ],
      "parameters": {
        "name": "RAGagent",
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "IkEdDr98G9p54XDT",
          "cachedResultName": "RAG Agent"
        },
        "description": "=调用此工具获取有关 Kamexa 的常见问题解答。",
        "workflowInputs": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2
    },
    {
      "id": "5a3275cb-0953-4ea5-ae23-557edd26f9d4",
      "name": "ticketAgent",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        680,
        620
      ],
      "parameters": {
        "name": "ticketAgent",
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "tMyGGwgRHFuqYKg3",
          "cachedResultName": "Ticket Agent"
        },
        "description": "调用此工具创建支持工单,供人工代理通过电子邮件跟进。",
        "workflowInputs": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2
    },
    {
      "id": "d2044a89-2823-4590-93b5-d4913b20c571",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        440,
        540
      ],
      "parameters": {
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "a80e06be-cbe1-42c0-a293-772859044956",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -360
      ],
      "parameters": {
        "width": 660,
        "height": 1480,
        "content": "# 采用模块化子代理架构的网站聊天机器人代理"
      },
      "typeVersion": 1
    },
    {
      "id": "b74b0e7f-91c5-4b9f-97e3-1180c97a1c30",
      "name": "终极网站聊天机器人代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        560,
        80
      ],
      "parameters": {
        "options": {
          "systemMessage": "=You are Dan Bot, the helpful, friendly chatbot assistant for Marketing Ladder, a marketing agency. You don’t answer questions yourself, you send every request to the right tool. \n\nAvailable Tools\nRAGagent – Use to answer FAQs and anything about Marketing Ladder.\ncalendarAgent – Use to check availability and book consultations.\nticketAgent – Use when the user wants a human, you don’t have enough info, or you can’t complete the request.\n\n\nCore Capabilities\n1. Answer FAQs\nIf a user asks a question, immediately query the RAGagent.\nNever guess, improvise, or answer on your own.\nNo tool call = no answer.\n\n2. Book Consultations\nIf a user wants to book a consultation, collect the following information:\nFull name, Company Name, Email address, their goal for the consultation, preferred day and time (remember: Chicago timezone, 30-min meetings)\n\nProcess:\n-Check their preferred slot with calendarAgent.\n-If unavailable, offer the closest alternate available times on the same day. \n-Once they pick a slot, confirm all details (name, email, goal, time).\n-After confirmation, use calendarAgent to book and send them confirmation.\nGolden Rule: Never double book. Always check availability first.\n\n3. Escalate to a Human Agent if any of these happen:\n\n-RAGagent can’t find an answer\n-User wants to talk to a human\n-You can’t complete their request\n\nThen:\nAsk if they’d like to be contacted by a human agent. If yes, collect:\nFirst name, Email address, Description of their issue or question\nThen, use ticketAgent to create a support ticket.\n\nRules of Engagement:\n-No improvisation. Tools only.\n-Always clarify if info is missing or unclear.\n-The current date is {{ $now.format('yyyy-MM-dd') }}. You are in the Chicago timezone. Always confirm this when talking about times.\n-Redirect trolls. If someone derails the convo away from Marketing Ladder, steer them back or offer to escalate to a human.\n-Have a friendly, conversational tone of voice, but stick to the point.\n-Default CTA: Always try to book them in for a consultation. That’s your north star.\n"
        }
      },
      "typeVersion": 1.7
    }
  ],
  "active": true,
  "pinData": {
    "When chat message received": [
      {
        "json": {
          "route": "general",
          "action": "sendMessage",
          "metadata": {
            "userId": ""
          },
          "chatInput": "What can you do",
          "sessionId": "89b58710-63b4-459d-8bd0-9c105de4817b"
        }
      }
    ]
  },
  "settings": {
    "timezone": "America/Chicago",
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "versionId": "daed30db-61fa-48ab-aaf8-d507dc609fc5",
  "connections": {
    "RAGagent": {
      "ai_tool": [
        [
          {
            "node": "Ultimate Website Chatbot Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "ticketAgent": {
      "ai_tool": [
        [
          {
            "node": "Ultimate Website Chatbot Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Ultimate Website Chatbot Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "calendarAgent": {
      "ai_tool": [
        [
          {
            "node": "Ultimate Website Chatbot Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Ultimate Website Chatbot Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Ultimate Website Chatbot Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 客服机器人, AI 聊天机器人

需要付费吗?

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

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

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

作者
Abdul Mir

Abdul Mir

@abdulmir

Hey 👋 I'm Abdul. I build AI-powered systems for marketing agencies and consultants who want to move fast and automate the boring stuff. Think lead gen agents, proposal generators, and content creation systems. I specialize in growth-focused automations and share workflows that save time and land clients.

外部链接
在 n8n.io 查看

分享此工作流