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

高级

这是一个Sales、Building Blocks、Marketing领域的自动化工作流,包含 32 个节点。主要使用 If、Set、Switch、Postgres、WhatsApp 等节点。 在Postgres中收集WhatsApp问卷回复("Anketa"模块)

前置要求
  • PostgreSQL 数据库连接信息
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "5vWy0IdYDMinpbbv",
  "meta": {
    "instanceId": "888b5b52ac2aa3f8f1bab6800cae8fce6f3d7947e840e64245b5198449908655",
    "templateCredsSetupCompleted": true
  },
  "name": "WA-Bot-模块-问卷-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": "74e77f18-8de5-4f3b-95ef-d97b38a8af97",
      "name": "WhatsApp 触发器",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        40,
        760
      ],
      "webhookId": "8658e600-ca72-4153-889d-7a9439b19aff",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "13dfccbd-47d9-434b-8c54-4b7b33364f49",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        520
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "688a5af7-20df-4292-a6bc-d28e93aa4a24",
      "name": "开始",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        480,
        560
      ],
      "webhookId": "efa7c03a-583d-49d2-96fa-1efab40353ac",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c31015af-d2ea-477a-b039-f99d4994a334",
      "name": "获取机器人状态",
      "type": "n8n-nodes-base.postgres",
      "position": [
        480,
        760
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "7db6bdbb-e9c8-4b1f-9a8d-f65557884af6",
      "name": "便签说明5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        1340
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "3ccf8ac8-78b4-4332-a92f-c0c6ccdea135",
      "name": "命令",
      "type": "n8n-nodes-base.switch",
      "position": [
        980,
        760
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "c88213ae-81d5-4bfa-9de0-7fa45979abd6",
      "name": "主菜单",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1260,
        560
      ],
      "webhookId": "bf5feea7-a8a6-40bb-b499-1ca96ad58efd",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a7411083-1ad9-4295-9f16-86baccb234b9",
      "name": "初始化",
      "type": "n8n-nodes-base.set",
      "position": [
        260,
        760
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "173729da-c067-4a76-93df-35d2ffbcfd54",
      "name": "开始测试",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1260,
        760
      ],
      "webhookId": "a109a322-a4ac-4e54-818c-225e3b42a5cf",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "2ce61e6d-bca9-4efd-8fd3-3a9e2ad9b590",
      "name": "获取第一个问题",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1480,
        760
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "d8747f70-ab23-49ee-87ec-798786711bd9",
      "name": "在问卷上更新机器人状态",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1920,
        760
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "d88b9f5d-7529-4a20-89a5-4007f30b9535",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1860,
        720
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "f57e0e75-49e9-42ff-965d-b5cb6084ebee",
      "name": "定义流程",
      "type": "n8n-nodes-base.switch",
      "position": [
        700,
        760
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "0fc45a08-2719-43fb-8999-637b68d29ce0",
      "name": "在开始上更新机器人状态",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2340,
        1180
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "786e1ad6-5bb8-4ac5-a923-fafadabcc499",
      "name": "获取可用问题",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1700,
        980
      ],
      "parameters": {},
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "5ebe7749-4f5f-44ec-b041-16a9a62e93cd",
      "name": "是否有可用问题?",
      "type": "n8n-nodes-base.if",
      "position": [
        1920,
        980
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.2
    },
    {
      "id": "b65f351d-78b5-46da-bd73-93d0ceb2a919",
      "name": "是否找到问题?",
      "type": "n8n-nodes-base.if",
      "position": [
        1480,
        980
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "2cccfa58-1492-4420-ab5b-42f16ac53e96",
      "name": "第一个问题",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1700,
        760
      ],
      "webhookId": "3778ab5f-6e1e-45a2-97ae-f55ae13b0e9d",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "feacdb2b-de64-4784-85e8-a12b35992384",
      "name": "问题",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2140,
        980
      ],
      "webhookId": "c484c9c1-cf45-4a55-80a6-c9765ef650f8",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "df3eb202-da56-4c03-b4c4-61b557d786eb",
      "name": "添加上一个答案",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2340,
        980
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "a6818f00-dd39-4cbd-8f0a-018a80ef6064",
      "name": "添加答案",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1700,
        1180
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "104a660d-5032-413f-a72f-62ae74e9d12f",
      "name": "完成问卷",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2140,
        1180
      ],
      "webhookId": "318e5835-f23a-4435-bc10-883c75fcf37f",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "11b6580c-f083-45c6-8524-424c2ceef63b",
      "name": "获取上一个答案",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1260,
        980
      ],
      "parameters": {},
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "bfb2e3bd-7663-449d-8e61-b6125935aa3b",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        720
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "5d5d103e-9365-4f62-9efe-8199ed8f5ce5",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        960
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "199c0247-ecbd-4693-9572-1e70da007b44",
      "name": "在开始上插入/更新机器人状态",
      "type": "n8n-nodes-base.postgres",
      "position": [
        700,
        560
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "a164b652-b8cc-4edf-a552-293d613deb2e",
      "name": "添加上一个答案",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2140,
        760
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "60a9c88a-c156-4b3f-abfd-f2f30b492058",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        760
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "1c5c37c4-89e8-4ed4-9013-0a9c3c1748d1",
      "name": "## 为什么选择 4o 模型?👆",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        520
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "70f96a8e-c191-4f0e-9073-1f9bb1e8ef36",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        1080
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "d4f4e891-0c3b-425f-9dab-c83396cf4e27",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        1080
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "679715b4-677a-42c4-93ae-aba55a6cdc49",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        520
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e4ca2f56-6081-4e5f-814f-98bea4d20b0a",
  "connections": {
    "Starts": {
      "main": [
        [
          {
            "node": "Upsert Bot Status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Commands": {
      "main": [
        [
          {
            "node": "Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Starts Test",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Question": {
      "main": [
        [
          {
            "node": "Add prev Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Answer": {
      "main": [
        [
          {
            "node": "Get Available Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define Flow": {
      "main": [
        [
          {
            "node": "Starts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Commands",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get prev Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Starts Test": {
      "main": [
        [
          {
            "node": "Get First Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Finish Anketa": {
      "main": [
        [
          {
            "node": "Update Bot Status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "First Question": {
      "main": [
        [
          {
            "node": "Update Bot Status on ANKETA",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Bot Status": {
      "main": [
        [
          {
            "node": "Define Flow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialization": {
      "main": [
        [
          {
            "node": "Get Bot Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get prev Answer": {
      "main": [
        [
          {
            "node": "Is Question found? ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Initialization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get First Question": {
      "main": [
        [
          {
            "node": "First Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Question found? ": {
      "main": [
        [
          {
            "node": "Get Available Questions",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Available Questions": {
      "main": [
        [
          {
            "node": "Is Questions available?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Questions available?": {
      "main": [
        [
          {
            "node": "Question",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Finish Anketa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Bot Status on START": {
      "main": [
        []
      ]
    },
    "Update Bot Status on ANKETA": {
      "main": [
        [
          {
            "node": "Add prev Answer ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
Andrew

Andrew

@boanse

Analyst-Developer

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

分享此工作流