8
n8n 中文网amn8n.com

餐厅订单与菜单自动化RAG系统模板

高级

这是一个AI领域的自动化工作流,包含 21 个节点。主要使用 If, Supabase, WhatsApp, FormTrigger, SupabaseTool 等节点,结合人工智能技术实现智能自动化。 基于AI的餐厅订单与菜单管理,集成WhatsApp和Google Gemini

前置要求
  • Supabase URL 和 API Key
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "EKJBH7M555cnXxwU",
  "meta": {
    "instanceId": "b5a944ba8839572df11fe1edab9898c0cc0a8b920d79a8a9e1ccb59618a73552",
    "templateCredsSetupCompleted": true
  },
  "name": "餐厅订单与菜单自动化 RAG 系统模板",
  "tags": [],
  "nodes": [
    {
      "id": "745c722b-897d-4113-bda4-aae1c6d3b27f",
      "name": "WhatsApp 触发器",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -400,
        -280
      ],
      "webhookId": "cdf8ab22-d835-4254-87d0-745c5b689f64",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9b9f346b-d86f-4179-a722-90dfacf01d20",
      "name": "AI 代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        632,
        -280
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "839ec974-57ea-40d9-ad5d-79275cd25f22",
      "name": "发送最后一条消息",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1336,
        -280
      ],
      "webhookId": "3ea2d08e-30a4-4408-8140-d62f37e71fde",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e34bdcc9-e4df-4e82-8e17-dfacbedd5a41",
      "name": "获取用户",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -180,
        -280
      ],
      "parameters": {},
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "7ef6846e-71a6-4a9a-a31e-4125c937c5d7",
      "name": "检查用户是否存在",
      "type": "n8n-nodes-base.if",
      "position": [
        40,
        -280
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "73dcb97b-75cf-4c47-9138-f709ffcc7c4c",
      "name": "添加用户到数据库",
      "type": "n8n-nodes-base.supabase",
      "position": [
        260,
        -205
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "48a8dc25-748d-4329-97f0-0b1d9272378a",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        640,
        -120
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "8c89d461-b237-49e0-9b6d-30d1477fad11",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        920,
        -120
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "9a7b9c60-7673-4622-962f-45198b77894a",
      "name": "如果",
      "type": "n8n-nodes-base.if",
      "position": [
        1556,
        -280
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "9ffd5bae-b8f6-4a1c-b095-b4af9c570802",
      "name": "在数据库中创建订单",
      "type": "n8n-nodes-base.supabaseTool",
      "position": [
        580,
        180
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "90aaf3f1-45a5-4b85-947e-c66b90a1034b",
      "name": "添加菜单项",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -400,
        580
      ],
      "webhookId": "4b906832-a75c-4899-bb16-191e3186644d",
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "68b376ad-c032-4dd4-8b81-e3b746ef6852",
      "name": "默认数据加载器",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        0,
        1040
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "507ca6a5-4e84-46ac-8685-80d34665f739",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        -300
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d14ab52b-be57-4848-9479-5e281e997eae",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        560
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "dc6aea8a-3817-401c-881d-16473d1a3a6c",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1840,
        -500
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "8480f082-c333-465c-9013-ccf7c4ca0a93",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        480,
        -100
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9ca59c15-6c8d-4075-a8e0-5702b1b9253b",
      "name": "嵌入 Google Gemini",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        340,
        840
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b379404a-2990-4ac8-bf8d-52f8140848ff",
      "name": "Google Gemini 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1040,
        20
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c17857f8-8723-413c-a366-ac0227a2b74c",
      "name": "发送订单给配送员",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1800,
        -340
      ],
      "webhookId": "2bdb6a82-ba1e-4a04-80d3-890e8e9daf50",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "835ebb28-6c0f-44c9-88bf-84589275e40b",
      "name": "将菜单项插入向量存储",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        -120,
        580
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "89134aa0-5a75-4f0d-b369-6206eccba221",
      "name": "从向量存储获取菜单项",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        740,
        200
      ],
      "parameters": {},
      "typeVersion": 1.3
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8b3b31b9-18af-4967-8302-a737298764fa",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Send Order to delevery guy",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send last message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get user": {
      "main": [
        [
          {
            "node": "Check if user exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add menu item": {
      "main": [
        [
          {
            "node": "Insert Menu Item to Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Add user to db": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Get user",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send last message": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Insert Menu Item to Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Check if user exists": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add user to db",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create order in database": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Google Gemini": {
      "ai_embedding": [
        [
          {
            "node": "Insert Menu Item to Vector Store",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Get Menu Items from Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Menu Items from Vector Store": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Insert Menu Item to Vector Store": {
      "ai_tool": [
        []
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 人工智能

需要付费吗?

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

工作流信息
难度等级
高级
节点数量21
分类1
节点类型14
难度说明

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

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

分享此工作流