WA-机器人模块-预约-v1-数据库-销售-完整版

高级

这是一个Sales、Support、Marketing领域的自动化工作流,包含 49 个节点。主要使用 If、Set、Merge、Switch、Postgres 等节点。 通过Telegram和PostgreSQL的自动化客户预约("预约"模块)

前置要求
  • PostgreSQL 数据库连接信息
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "AJTY10KEqzGWzQ8p",
  "meta": {
    "instanceId": "888b5b52ac2aa3f8f1bab6800cae8fce6f3d7947e840e64245b5198449908655"
  },
  "name": "WA-机器人模块-预约-v1-数据库-销售-完整版",
  "tags": [
    {
      "id": "XPad0ERjSdqfxG52",
      "name": "module",
      "createdAt": "2025-03-31T08:11:00.151Z",
      "updatedAt": "2025-03-31T08:11:00.151Z"
    },
    {
      "id": "NeRMkUNq0sRVlL99",
      "name": "whatsapp",
      "createdAt": "2025-03-10T18:20:40.864Z",
      "updatedAt": "2025-03-10T18:20:40.864Z"
    },
    {
      "id": "2ocrWSzdKoCOU2AC",
      "name": "sell",
      "createdAt": "2025-04-19T15:39:51.859Z",
      "updatedAt": "2025-04-19T15:39:51.859Z"
    }
  ],
  "nodes": [
    {
      "id": "49db5bb8-bcae-44c1-a215-5d8d1c125f5e",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1800,
        -60
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b7d46289-6bfd-4639-acb9-951969bd88e7",
      "name": "便利贴11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1800,
        200
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3c4778a1-6806-442d-a50a-de0e87089169",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1800,
        -300
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6c2acf36-0c01-4984-ac42-662f4f6ea072",
      "name": "更新姓名",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2300,
        1240
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "2ac3bcd1-a090-48fd-a133-ffd1c7c6b889",
      "name": "更新小时",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2300,
        640
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "ee24c24c-5083-49bd-8e0c-cfee8ef6c760",
      "name": "获取工作时间",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2740,
        240
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "8d602e70-38e7-4639-9cec-b45e4ac46c68",
      "name": "获取工作日",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1860,
        -20
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "32910627-3e1f-45dd-a4ec-63132762215c",
      "name": "启动时更新机器人状态",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1860,
        -280
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "d1a8ef06-6507-4e90-8f97-0d28f3abe94a",
      "name": "日期是否正确?",
      "type": "n8n-nodes-base.if",
      "position": [
        2060,
        -20
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "22fa9829-ef33-4a20-a6c9-a03442c0dbab",
      "name": "命令",
      "type": "n8n-nodes-base.switch",
      "position": [
        1360,
        -80
      ],
      "parameters": {},
      "retryOnFail": false,
      "typeVersion": 3.2
    },
    {
      "id": "fca9aaf7-53cb-4c5d-91d2-2cb1a8591c2f",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -300
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "62ea839f-f934-4862-8709-a08d1a9d5e5c",
      "name": "开始",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        860,
        -280
      ],
      "webhookId": "aa26d2a0-99da-4d11-8504-89acaafbb0c5",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "946b34a4-b9b4-4dc0-884c-d897f4f0987b",
      "name": "获取机器人状态",
      "type": "n8n-nodes-base.postgres",
      "position": [
        860,
        -80
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "491739c5-8dff-489a-9565-02fc4f5edf7e",
      "name": "启动时更新机器人状态",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1080,
        -280
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "33d1bfa8-a7f1-4d28-8178-765436763a25",
      "name": "WhatsApp 触发器",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        420,
        -80
      ],
      "webhookId": "8defa4ea-11c0-4ab9-9228-0bef6ffd00ad",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8e174865-d332-4e16-a0a0-25723635de87",
      "name": "定义流程",
      "type": "n8n-nodes-base.switch",
      "position": [
        1080,
        -80
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "d6bc1318-df4c-4ef6-b830-66540720df6a",
      "name": "初始化",
      "type": "n8n-nodes-base.set",
      "position": [
        640,
        -80
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "ec733a20-b9f0-4039-8514-8217ca491b9b",
      "name": "获取预约",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1360,
        640
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "d98b2950-df1f-4fc1-b18c-2290b7bf621e",
      "name": "主菜单",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1640,
        -80
      ],
      "webhookId": "41c4e076-3618-44f5-bf0e-96ace7b28fb0",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "bd5ebe69-cd98-4c2c-8a5b-ea8114a4a5a4",
      "name": "请求日期",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2740,
        -20
      ],
      "webhookId": "03f0e01e-8493-40c0-b4dc-5c1b79006757",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f36f3c9d-4bd6-409d-b7af-9d96b5c03075",
      "name": "将编号与问题合并",
      "type": "n8n-nodes-base.set",
      "position": [
        2300,
        -20
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "c8e08639-5b3c-4552-af2e-b0ad0d6c89f3",
      "name": "合并列表",
      "type": "n8n-nodes-base.summarize",
      "position": [
        2520,
        -20
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "c2c75379-cec2-43c4-88c4-bc63bd1cde1e",
      "name": "预约时更新机器人状态",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2960,
        -20
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "fca3d8b1-b320-41ed-9b42-c236679e1e6a",
      "name": "第一个问题?",
      "type": "n8n-nodes-base.if",
      "position": [
        1860,
        240
      ],
      "parameters": {},
      "executeOnce": false,
      "typeVersion": 2.2
    },
    {
      "id": "553efef6-2dd3-40c1-86ca-df2c513dd3bf",
      "name": "获取工作日",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2060,
        420
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "fa7159a9-57fd-4f35-8c53-9fde5289a23e",
      "name": "添加预约",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2060,
        240
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "85885381-f773-4f8d-8b68-241822d8cd05",
      "name": "合并1",
      "type": "n8n-nodes-base.merge",
      "position": [
        2300,
        240
      ],
      "parameters": {},
      "executeOnce": false,
      "typeVersion": 3
    },
    {
      "id": "ad5bed52-c4c1-4e52-8321-e0ba884ca77d",
      "name": "问题1与号码合并",
      "type": "n8n-nodes-base.set",
      "position": [
        2960,
        240
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "7a58c044-0d1f-470b-894b-5e0f994f9b5c",
      "name": "列表1合并",
      "type": "n8n-nodes-base.summarize",
      "position": [
        3180,
        240
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "7c7298b5-7f78-40e0-ab66-4966bf56e9ee",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        1640,
        440
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 3
    },
    {
      "id": "e227110c-53de-443b-ad3d-1a8157f80938",
      "name": "编辑字段",
      "type": "n8n-nodes-base.set",
      "position": [
        1360,
        440
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "9795ad35-d291-4e82-b2ee-0f898843a535",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        2060,
        640
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "de7099bd-e95f-4c09-b4a2-a0e8708f86b1",
      "name": "更新日期和状态",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2520,
        240
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "f7c5056a-c6b7-4c61-a0f1-d116754a70aa",
      "name": "电话验证1",
      "type": "n8n-nodes-base.if",
      "position": [
        2300,
        840
      ],
      "parameters": {},
      "executeOnce": false,
      "typeVersion": 2.2
    },
    {
      "id": "f8a30b0c-9b25-433c-8da1-30b25af14c34",
      "name": "请求电话",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2740,
        640
      ],
      "webhookId": "b1232b40-8742-48b3-b117-db915f25cf58",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8173128a-5c21-40c0-a394-abe62b3b30b8",
      "name": "请求姓名",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2740,
        840
      ],
      "webhookId": "0ba29b47-cbb5-4d87-9813-a5778291c943",
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 1
    },
    {
      "id": "7b392a56-df82-43fb-9fa3-a7acb1df79e8",
      "name": "电话错误",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2740,
        1040
      ],
      "webhookId": "ae89b4aa-8718-4030-b75d-fc65911f7953",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1deb7b7c-07df-414a-ba7d-c421e15ce979",
      "name": "预约成功页面",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2740,
        1240
      ],
      "webhookId": "610074a5-5439-4662-8080-408cceb93796",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d07a6f69-2c2f-4655-8d3a-8b93c25ef911",
      "name": "已预约状态更新",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2960,
        1240
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "d994f535-8b42-4ea5-8466-98ecd0988b0e",
      "name": "更新电话",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2520,
        840
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "4913b0e5-ff41-40d0-adc8-5593d2ae7614",
      "name": "支付",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1640,
        -280
      ],
      "webhookId": "4248cc84-3c81-4fc4-a65c-a71281595da8",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5219aa55-5017-4182-bc1a-7f65a6229ac9",
      "name": "支付时更新机器人状态",
      "type": "n8n-nodes-base.postgres",
      "position": [
        3180,
        1240
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "3a9dd518-b8a1-4503-b6bb-5345bf14ab75",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "76705120-761e-45f2-b027-028ba9a88875",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -300
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "146316c0-6f31-4701-a3ba-63ddd87e741b",
      "name": "请求时间",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        3400,
        240
      ],
      "webhookId": "e89c3c22-f3cf-483c-9ad9-c58149c19b18",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d14141f8-5f5c-4f08-9e45-72831e44a01a",
      "name": "便利贴12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        -300
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3bd6b336-c195-4aa2-adea-7176222ab22a",
      "name": "便签13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        -80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "717ed12c-9495-4ed9-9b81-e89f254bb38c",
      "name": "便签14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "a15078a1-f6be-4dcd-b0f8-1eb43a22bdab",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        -300
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "timezone": "Asia/Almaty",
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "versionId": "e32a293f-ae93-4c83-ad8d-5c9e685c75a8",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "First Question?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Update Date AND Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Starts": {
      "main": [
        [
          {
            "node": "Upsert Bot Status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Update Hour",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Phone validation1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Book": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Commands": {
      "main": [
        [
          {
            "node": "Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Work Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get book": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Payments": {
      "main": [
        [
          {
            "node": "Update bot status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Main Menu": {
      "main": [
        [
          {
            "node": "Update bot status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Union list": {
      "main": [
        [
          {
            "node": "Request Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define Flow": {
      "main": [
        [
          {
            "node": "Starts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Commands",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get book",
            "type": "main",
            "index": 0
          },
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Payments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Union list1": {
      "main": [
        [
          {
            "node": "Request Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Hour": {
      "main": [
        [
          {
            "node": "Request Phone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Name": {
      "main": [
        [
          {
            "node": "page booking success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request Date": {
      "main": [
        [
          {
            "node": "Update bot status on BOOKING",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Phone": {
      "main": [
        [
          {
            "node": "Request Name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Work Days": {
      "main": [
        [
          {
            "node": "Is Date correct?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Bot Status": {
      "main": [
        [
          {
            "node": "Define Flow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Work Days ": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Get Work Hours": {
      "main": [
        [
          {
            "node": "Union Number with Question1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialization": {
      "main": [
        [
          {
            "node": "Get Bot Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "First Question?": {
      "main": [
        [
          {
            "node": "Add Book",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Work Days ",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Date correct?": {
      "main": [
        [
          {
            "node": "Union Number with Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Initialization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Phone validation1": {
      "main": [
        [
          {
            "node": "Update Phone",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Phone Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "page booking success": {
      "main": [
        [
          {
            "node": "Update status on BOOKED",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Date AND Status": {
      "main": [
        [
          {
            "node": "Get Work Hours",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update status on BOOKED": {
      "main": [
        [
          {
            "node": "Update bot status on PAYMENTS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Union Number with Question": {
      "main": [
        [
          {
            "node": "Union list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Union Number with Question1": {
      "main": [
        [
          {
            "node": "Union list1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update bot status on PAYMENTS": {
      "main": [
        [
          {
            "node": "Payments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

工作流信息
难度等级
高级
节点数量49
分类3
节点类型9
难度说明

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

作者
Andrew

Andrew

@boanse

Analyst-Developer

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

分享此工作流