🛎️ 出租车服务

高级

这是一个Support、AI领域的自动化工作流,包含 40 个节点。主要使用 If、Set、Code、Redis、Switch 等节点,结合人工智能技术实现智能自动化。 AI聊天机器人呼叫中心:出租车服务(生产就绪,第3部分)

前置要求
  • Redis 服务器连接信息
  • PostgreSQL 数据库连接信息
  • 可能需要目标 API 的认证凭证

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "wgzgvKA5E4uNohoU",
  "meta": {
    "instanceId": "daae7bb90c8655b08e0b68de8a52b1178f2812f6a234efb0b0509279dbb70b3e",
    "templateCredsSetupCompleted": true
  },
  "name": "🛎️ 出租车服务",
  "tags": [
    {
      "id": "xofc8T2YGf1CKDRt",
      "name": "Service",
      "createdAt": "2025-04-29T08:57:58.323Z",
      "updatedAt": "2025-04-29T08:57:58.323Z"
    },
    {
      "id": "no8Mb078mvRgw7PS",
      "name": "DEMO",
      "createdAt": "2025-04-30T05:34:10.330Z",
      "updatedAt": "2025-04-30T05:34:10.330Z"
    }
  ],
  "nodes": [
    {
      "id": "49e474fa-d9a3-4a0f-b320-11969c3d4dae",
      "name": "流程触发器",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -160,
        120
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "66464934-d148-4039-8646-662e0ebda1d4",
      "name": "输入",
      "type": "n8n-nodes-base.set",
      "notes": "channel_no: taxi, service_no: test",
      "position": [
        60,
        120
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "daf3f0fc-c17c-4e93-ba6a-c43c0d8c6687",
      "name": "测试触发器",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -160,
        320
      ],
      "webhookId": "c9084cca-81bc-4b67-b114-3ba9e5588b5d",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "32364c53-2e89-4327-a895-967afdfb5436",
      "name": "测试字段",
      "type": "n8n-nodes-base.set",
      "position": [
        60,
        320
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "2d158e21-339f-46b3-b52f-4e42dd5f6496",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "onError": "continueErrorOutput",
      "position": [
        1980,
        100
      ],
      "parameters": {},
      "typeVersion": 1.9
    },
    {
      "id": "e775814b-0650-462f-9781-310d02b75d13",
      "name": "Postgres 聊天记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "notes": "n8n_chat_memory\n{session_id}:{timestamp}:{channel_no}\n20 CHAT, EXPIRY 60m",
      "position": [
        1980,
        360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1.3
    },
    {
      "id": "f5537e4a-2ae3-45dd-9a19-bc27eb4cb9d7",
      "name": "输出",
      "type": "n8n-nodes-base.set",
      "position": [
        2840,
        140
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "056c0101-aaa7-4533-9301-d1049d065e35",
      "name": "更新用户会话",
      "type": "n8n-nodes-base.redisTool",
      "notes": "TTL 5m {session_id}:session",
      "position": [
        2420,
        360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "058d0923-412f-4e9b-91e5-09eda956f07d",
      "name": "xAI @grok-2-1212",
      "type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok",
      "position": [
        1820,
        360
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7af82c88-2d4e-48b7-b8ff-52f62afaead4",
      "name": "加载用户记忆",
      "type": "n8n-nodes-base.postgresTool",
      "notes": "n8n_user_memory",
      "position": [
        1860,
        680
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2.6
    },
    {
      "id": "d4a06f5b-8a06-4847-92f7-1ee87f60e5ac",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        0
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "df348a93-5751-47bc-b684-c3e88a020b87",
      "name": "如果服务缓存",
      "type": "n8n-nodes-base.if",
      "position": [
        760,
        120
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "9c3aa803-8ac2-48cf-8f87-7804a76af490",
      "name": "服务缓存",
      "type": "n8n-nodes-base.redis",
      "notes": "TTL 15m service:{channel_no}:{service_no}:data",
      "onError": "continueRegularOutput",
      "position": [
        540,
        120
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "8af1b728-98ca-408c-9001-f0454c0a3c51",
      "name": "加载服务数据",
      "type": "n8n-nodes-base.postgres",
      "onError": "continueRegularOutput",
      "position": [
        980,
        300
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.6,
      "alwaysOutputData": true
    },
    {
      "id": "b5ab2ba7-e64f-4b12-b13e-a34cf6c8ea92",
      "name": "保存服务缓存",
      "type": "n8n-nodes-base.redis",
      "notes": "TTL 15m",
      "onError": "continueRegularOutput",
      "position": [
        1220,
        520
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "7b599293-b2e2-4379-8a1b-636be24af175",
      "name": "如果活跃",
      "type": "n8n-nodes-base.if",
      "position": [
        980,
        540
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "a92b6285-7a99-4839-8212-22e7dba36453",
      "name": "非活跃输出",
      "type": "n8n-nodes-base.set",
      "notes": "Service not available.",
      "position": [
        980,
        980
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "b9f413e3-1f28-4275-a23e-14b72e085ed0",
      "name": "服务",
      "type": "n8n-nodes-base.set",
      "position": [
        1220,
        100
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "48693914-6738-41cb-a0bb-214212b9f5b3",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        60
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "1a562856-24ba-423c-9908-b054e570ae27",
      "name": "错误输出",
      "type": "n8n-nodes-base.set",
      "notes": "Please retry.",
      "position": [
        1680,
        980
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "647b9d7b-a09f-403c-8273-9eae98ee5070",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        880
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "08dc57ee-b1b3-4d4a-8f83-a6a125ea444f",
      "name": "保存用户记忆",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        2020,
        680
      ],
      "parameters": {},
      "typeVersion": 2.6
    },
    {
      "id": "35d17795-0e79-41a5-b9aa-fdc17f42d399",
      "name": "创建路线数据",
      "type": "n8n-nodes-base.redisTool",
      "notes": "TTL 5m {session_id}:{channel_id}:route",
      "position": [
        2480,
        680
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "0013383d-ae83-4dc6-a807-18c7a6a21efa",
      "name": "删除路线数据",
      "type": "n8n-nodes-base.redis",
      "notes": "{session_id}:{channel_no}:route",
      "onError": "continueRegularOutput",
      "position": [
        1740,
        100
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "d6bbac8f-d959-4e2a-8f69-e652b5796060",
      "name": "路线数据",
      "type": "n8n-nodes-base.redis",
      "notes": "TTL 5m {session_id}:{channel_id}:route",
      "onError": "continueRegularOutput",
      "position": [
        2400,
        80
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "4bfe2d36-52fa-4d68-ad2d-dd40cf7b48b5",
      "name": "如果路线数据",
      "type": "n8n-nodes-base.if",
      "position": [
        2600,
        80
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "3271172c-3e41-4bd7-8296-385e33e16916",
      "name": "解析路线",
      "type": "n8n-nodes-base.code",
      "position": [
        3040,
        60
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "73903a6a-6a2e-4f69-81fa-4e6183d8e8d0",
      "name": "解析服务",
      "type": "n8n-nodes-base.code",
      "position": [
        980,
        100
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "8188696f-150a-4354-bdbc-58ed6c8fad19",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3200,
        280
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "35291999-36c5-408d-83d1-7c974cc5e46b",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2200,
        580
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "56352d75-f317-4689-9bef-a78f5aa653e9",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        580
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "5a8b070b-3d3f-4326-8b17-ac43776aba10",
      "name": "查找路线距离",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        2320,
        680
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "634aca25-fa0d-470a-b618-c2795d77853d",
      "name": "重置会话",
      "type": "n8n-nodes-base.redis",
      "notes": "TTL 5m {session_id}:session",
      "onError": "continueRegularOutput",
      "position": [
        1520,
        100
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "b1419db7-a6f4-427a-bbc1-bbd1d7e20dc9",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        3420,
        -100
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "01503d68-8207-4f7e-a0b7-76c07d1fa6c7",
      "name": "英语",
      "type": "n8n-nodes-base.set",
      "notes": "Enter 0 to cancel",
      "position": [
        3660,
        80
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "ba2866e0-ec75-4930-ab32-d8834fbe9f94",
      "name": "中文",
      "type": "n8n-nodes-base.set",
      "notes": "如須取消,輸入0",
      "position": [
        3660,
        -300
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "1f2383a9-1063-41e0-a93f-57892a0fb86c",
      "name": "日语",
      "type": "n8n-nodes-base.set",
      "notes": "キャンセルする場合は0を入力してください",
      "position": [
        3660,
        -100
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "f3b11076-6ced-49d2-ad9f-8de13f7c5986",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3300,
        -340
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "c08bb122-dc7a-4a4d-ad0b-075e5ac5cc50",
      "name": "回调",
      "type": "n8n-nodes-base.executeWorkflow",
      "notes": "Demo Call Back",
      "position": [
        2840,
        980
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1.2
    },
    {
      "id": "c074e29a-d4a2-4111-9a2a-1ca31ceb6bf4",
      "name": "出租车服务提供商",
      "type": "n8n-nodes-base.executeWorkflow",
      "notes": "Taxi Service Provider NO WAIT",
      "onError": "continueRegularOutput",
      "position": [
        3320,
        440
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "timezone": "Etc/UTC",
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "vuso7W8t402BPcT2",
    "executionOrder": "v1"
  },
  "versionId": "62b3d769-578e-421a-867a-4ed9d50e1220",
  "connections": {
    "Input": {
      "main": [
        [
          {
            "node": "Service Cache",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Output": {
      "main": [
        [
          {
            "node": "Call Back",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Chinese",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Chinese",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Chinese",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Japanese",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "English",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chinese": {
      "main": [
        [
          {
            "node": "Call Back",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "English": {
      "main": [
        [
          {
            "node": "Call Back",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Service": {
      "main": [
        [
          {
            "node": "Reset Session",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Route Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Japanese": {
      "main": [
        [
          {
            "node": "Call Back",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Active": {
      "main": [
        [
          {
            "node": "Save Service Cache",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Inactive Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Data": {
      "main": [
        [
          {
            "node": "If Route Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Route": {
      "main": [
        [
          {
            "node": "Taxi Service Provider",
            "type": "main",
            "index": 0
          },
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Test Fields": {
      "main": [
        [
          {
            "node": "Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Output": {
      "main": [
        [
          {
            "node": "Call Back",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Flow Trigger": {
      "main": [
        [
          {
            "node": "Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Test Trigger": {
      "main": [
        [
          {
            "node": "Test Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Route Data": {
      "main": [
        [
          {
            "node": "Parse Route",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Service": {
      "main": [
        [
          {
            "node": "Service",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reset Session": {
      "main": [
        [
          {
            "node": "Delete Route Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Service Cache": {
      "main": [
        [
          {
            "node": "If Service Cache",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Inactive Output": {
      "main": [
        [
          {
            "node": "Call Back",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Service Cache": {
      "main": [
        [
          {
            "node": "Parse Service",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Load Service Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load User Memory": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Save User Memory": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "xAI @grok-2-1212": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create Route Data": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Delete Route Data": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load Service Data": {
      "main": [
        [
          {
            "node": "If Active",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Service Cache": {
      "main": [
        [
          {
            "node": "Service",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Route Distance": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update User Session": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

这是一个高级难度的工作流,适用于Support、AI等场景。适合高级用户,包含 16+ 个节点的复杂工作流

需要付费吗?

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

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

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

作者
ChatPayLabs

ChatPayLabs

@chatpaylabs

Production Ready AI n8n Workflow Templates Startup Fundraising 💰 Support Us 🦄

外部链接
在 n8n.io 上查看 →

分享此工作流