8
n8n 中文网amn8n.com

通用AI助手

中级

这是一个Support Chatbot, AI Chatbot领域的自动化工作流,包含 10 个节点。主要使用 Webhook, Agent, RespondToWebhook, LmChatGoogleGemini, MemoryBufferWindow 等节点。 创建支持Webhook的对话助手(Google Gemini和会话记忆)

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "QNRmujxuRedJ4sCy",
  "meta": {
    "instanceId": "2000c64071c20843606b95c63795bb0797c41036047055a6586498e855b96efc"
  },
  "name": "通用 AI 助手",
  "tags": [],
  "nodes": [
    {
      "id": "a3a31971-a601-4a0a-a306-d5e63a7e33f5",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        920,
        -40
      ],
      "parameters": {
        "text": "You are a helpful AI assistant designed to provide accurate, concise, and friendly responses to user queries. Your goal is to understand the user's needs and provide relevant information, guidance, or solutions. Always maintain a professional yet approachable tone. If you're unsure about something, acknowledge it honestly and suggest alternative approaches when possible.",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "921ac636-0297-4b7a-aeb1-6c68e9af6885",
      "name": "Google Gemini聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        948,
        180
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "l4J5aPMMyPyBTuRg",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "afcdf33e-bce6-4b80-bfee-f6707e307a03",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        700,
        -40
      ],
      "webhookId": "45cec96e-962d-4e27-ab75-34d25b837032",
      "parameters": {
        "path": "45cec96e-962d-4e27-ab75-34d25b837032",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "317a9c30-7651-47e1-b6aa-64ce4162aa16",
      "name": "响应Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1296,
        -40
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "5f0d884e-3a75-49f9-babb-22fff9fb8a87",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1068,
        180
      ],
      "parameters": {
        "sessionKey": "={{ $json.body.sessionId }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "a5ff29b4-5a46-4716-bd3b-a29c40923e63",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        -140
      ],
      "parameters": {
        "width": 280,
        "height": 440,
        "content": "## Webhook 入口点"
      },
      "typeVersion": 1
    },
    {
      "id": "6799e102-74fe-49a3-8696-178143b5c7f7",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        280
      ],
      "parameters": {
        "width": 220,
        "height": 260,
        "content": "## AI 处理核心"
      },
      "typeVersion": 1
    },
    {
      "id": "e299b1f8-c6e7-4816-878d-60d3ff8edf14",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        280
      ],
      "parameters": {
        "color": 5,
        "width": 180,
        "height": 340,
        "content": "## 会话记忆"
      },
      "typeVersion": 1
    },
    {
      "id": "b926b0ea-11d6-4773-83bd-ce12c7be40c1",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1380,
        -140
      ],
      "parameters": {
        "width": 160,
        "height": 100,
        "content": "## 响应输出"
      },
      "typeVersion": 1
    },
    {
      "id": "456572e3-0abf-408d-a5ab-36cb0e2d5911",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -400
      ],
      "parameters": {
        "color": 5,
        "width": 300,
        "height": 320,
        "content": "## 🚀 AI 助手工作流"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3453d230-0017-4f82-8942-346e34867c63",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
David Olusola

David Olusola

@dae221

AI automation consultant working with ambitious businesses on their most complex operational challenges. For project inquiries, reach me at david@daexai.com

外部链接
在 n8n.io 查看

分享此工作流