8
n8n 中文网amn8n.com

使用LLM链的WhatsApp健康AI聊天机器人

高级

这是一个Other, AI领域的自动化工作流,包含 17 个节点。主要使用 Switch, WhatsApp, HttpRequest, WhatsAppTrigger, ChainLlm 等节点,结合人工智能技术实现智能自动化。 WhatsApp营养师AI聊天机器人工作流

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "exfELP1QbgPmWdJN",
  "meta": {
    "instanceId": "f26695f9dd9ec5be54b493d7e034928ff1ce84b484e05df76b3e0bc3c96eb6ca"
  },
  "name": "使用 LLM 链的 WhatsApp 健康 AI 聊天机器人",
  "tags": [],
  "nodes": [
    {
      "id": "fe70fcaa-6777-4473-951b-8324e2310bfc",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1000,
        20
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8329bab1-05d3-4bfe-85cf-60572fc064c9",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1220,
        40
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "3a8c62a0-c77f-43a9-9dd4-8ee6f853280e",
      "name": "WhatsApp 消息已接收",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -200,
        30
      ],
      "webhookId": "e90274bf-7949-436a-8429-2844ce22cf2d",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "fdb01ad3-95af-4d9a-9b95-0f4c5fd71504",
      "name": "获取 WhatsApp 图片",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        600,
        -120
      ],
      "webhookId": "378c59ca-2b57-460f-94d2-38cd115f296d",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "81f2902d-5d28-475c-a306-f03f76545e0a",
      "name": "下载图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        820,
        -120
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "07695d33-e3d9-4ea8-b817-922a5dbf1dbb",
      "name": "向客户发送回复",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1560,
        40
      ],
      "webhookId": "8faff3bf-f15e-476d-99ec-d69c2a9c8304",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "3923ef57-0cb4-4c7f-810b-943e4307283f",
      "name": "根据文本生成回复",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1040,
        280
      ],
      "parameters": {},
      "typeVersion": 1.6
    },
    {
      "id": "61838d8b-7f25-4bcb-94e2-3cdce4670023",
      "name": "根据图片和标题生成回复",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1040,
        -220
      ],
      "parameters": {},
      "typeVersion": 1.6
    },
    {
      "id": "d5f97550-7af4-45c3-8a71-de5eb1ab6f0c",
      "name": "检查消息是否包含图片",
      "type": "n8n-nodes-base.switch",
      "position": [
        140,
        40
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "5199d85d-3ac7-46a3-b59e-f199b6412b97",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        -100
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "f309b561-64c4-48ab-aad2-123523819cc3",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -140
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "de2b17c7-9157-4722-aa2c-90ab959462b2",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        520,
        -260
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "440689db-0477-4496-aa6f-9a1b378db7fc",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1000,
        -360
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "2123977d-04d2-414d-a42a-095f33e6dc3b",
      "name": "便签说明4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        980,
        260
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "841bdcf9-89dd-4a58-b413-bd0b2c21b390",
      "name": "便签说明5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1480,
        -80
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "6c9cda64-ad08-4b77-bdd6-a19f866fbf35",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        -300
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "a5c6d07c-508b-4cd6-b596-77cf7dd634d3",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1140,
        -760
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {},
  "versionId": "79a0f1c9-4007-456f-8dba-31e02c9949b8",
  "connections": {
    "Download Image": {
      "main": [
        [
          {
            "node": "Generate Response from Image and caption",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get whatsapp image": {
      "main": [
        [
          {
            "node": "Download Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Response from Image and caption",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Generate Response from text",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Response from Image and caption",
            "type": "ai_outputParser",
            "index": 0
          },
          {
            "node": "Generate Response from text",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Message Received": {
      "main": [
        [
          {
            "node": "Check if message contains image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Response from text": {
      "main": [
        [
          {
            "node": "Send Response to client",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if message contains image": {
      "main": [
        [
          {
            "node": "Get whatsapp image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Response from text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Response from Image and caption": {
      "main": [
        [
          {
            "node": "Send Response to client",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 其他, 人工智能

需要付费吗?

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

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

适合高级用户,包含 16+ 个节点的复杂工作流

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

分享此工作流