TG机器人-复选框模块-v2-数据库-销售完整版
高级
这是一个Sales、Marketing领域的自动化工作流,包含 46 个节点。主要使用 If、Set、Code、Switch、Postgres 等节点。 Telegram机器人,用于多选项目并保存到PostgreSQL("复选框"模块)
前置要求
- •PostgreSQL 数据库连接信息
- •Telegram Bot Token
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "KCGTmRn3lbzfx0on",
"meta": {
"instanceId": "888b5b52ac2aa3f8f1bab6800cae8fce6f3d7947e840e64245b5198449908655"
},
"name": "TG-Bot-Module-Checkbox-v2-db-sell-full",
"tags": [
{
"id": "EwFGeL3ePPNgm0R7",
"name": "telegram",
"createdAt": "2025-02-10T18:10:47.435Z",
"updatedAt": "2025-02-10T18:10:47.435Z"
},
{
"id": "XPad0ERjSdqfxG52",
"name": "module",
"createdAt": "2025-03-31T08:11:00.151Z",
"updatedAt": "2025-03-31T08:11:00.151Z"
},
{
"id": "2ocrWSzdKoCOU2AC",
"name": "sell",
"createdAt": "2025-04-19T15:39:51.859Z",
"updatedAt": "2025-04-19T15:39:51.859Z"
}
],
"nodes": [
{
"id": "d065e9ae-ea26-4b2f-aafc-875149b65b5a",
"name": "发送",
"type": "n8n-nodes-base.telegram",
"position": [
2520,
-40
],
"webhookId": "535ff410-2b68-4076-8316-65ef65ecad88",
"parameters": {},
"executeOnce": true,
"typeVersion": 1.2
},
{
"id": "28672168-5a49-41e9-86c9-a322f366576c",
"name": "更新 message_id",
"type": "n8n-nodes-base.postgres",
"position": [
2740,
-40
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "4f788243-df38-4943-90f3-f50385ba7269",
"name": "获取 message_id",
"type": "n8n-nodes-base.postgres",
"position": [
1200,
-240
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "96fa1b44-9ab6-46ab-9f31-ae3f4ca91a9b",
"name": "获取店铺列表",
"type": "n8n-nodes-base.postgres",
"position": [
1200,
-40
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "ea0ad58d-0e28-4417-aaaf-3a0f2e2cd05d",
"name": "添加店铺列表选择",
"type": "n8n-nodes-base.postgres",
"position": [
1420,
-40
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "6918085c-28de-4872-8d7d-955e0502e1c5",
"name": "获取店铺列表选择",
"type": "n8n-nodes-base.postgres",
"position": [
1640,
-240
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "6d59a9e0-4953-4843-9a87-acafd7490d39",
"name": "更新店铺列表选择",
"type": "n8n-nodes-base.postgres",
"position": [
1420,
-240
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "3db18d31-9302-45ab-8e8c-00f475aab9bb",
"name": "编辑",
"type": "n8n-nodes-base.telegram",
"position": [
2520,
-240
],
"webhookId": "b69dce8f-66e7-4927-b600-2846a2f8247b",
"parameters": {},
"executeOnce": true,
"typeVersion": 1.2
},
{
"id": "6ef72b01-1b87-4003-aa39-db1155691915",
"name": "转换状态",
"type": "n8n-nodes-base.code",
"position": [
1640,
-40
],
"parameters": {},
"typeVersion": 2
},
{
"id": "2212a148-3d32-4be6-a989-0fc482ede8f8",
"name": "转换状态和反状态",
"type": "n8n-nodes-base.code",
"position": [
1860,
-240
],
"parameters": {},
"typeVersion": 2
},
{
"id": "dd58465e-693c-4628-886a-f51a7e62a38e",
"name": "变量 TG",
"type": "n8n-nodes-base.set",
"position": [
-140,
-40
],
"parameters": {},
"typeVersion": 3.4
},
{
"id": "301a05b3-f0a8-40fe-b2db-2ff015455556",
"name": "初始化",
"type": "n8n-nodes-base.set",
"position": [
100,
-40
],
"parameters": {},
"typeVersion": 3.4
},
{
"id": "7f9e5365-d2db-4925-a638-13f17ddc3183",
"name": "Telegram触发器",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-360,
-40
],
"webhookId": "994d1e4e-4547-4f8c-b402-ce6058ab99fa",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "cc09ce10-2c8c-4140-a3f3-b4930e781b10",
"name": "欢迎消息",
"type": "n8n-nodes-base.telegram",
"position": [
320,
-240
],
"webhookId": "871e0586-ef03-4e05-8ad6-50eefe56ac28",
"parameters": {},
"executeOnce": true,
"typeVersion": 1.2
},
{
"id": "37146263-537c-462f-a5ea-b4fb246974af",
"name": "开始?",
"type": "n8n-nodes-base.if",
"position": [
320,
-40
],
"parameters": {},
"typeVersion": 2.2
},
{
"id": "1dedc192-55f9-4007-b2c4-c524c5d31ab9",
"name": "定义类型",
"type": "n8n-nodes-base.switch",
"position": [
540,
-40
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "136abdb4-146b-45c5-beed-964a21882f12",
"name": "切换",
"type": "n8n-nodes-base.switch",
"position": [
760,
-240
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "7eb8a6f0-e17c-443b-b9c2-003c997b9721",
"name": "结果",
"type": "n8n-nodes-base.telegram",
"position": [
2520,
-440
],
"webhookId": "c4528e35-f0e9-4dde-a66d-aa4fe3a34bb7",
"parameters": {},
"executeOnce": true,
"typeVersion": 1.2
},
{
"id": "341fa44b-e82e-454a-919f-b2e893cb3fdf",
"name": "获取店铺列表选择",
"type": "n8n-nodes-base.postgres",
"position": [
1200,
-440
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "9a3e8667-05b6-43cd-b622-c846fc290b5e",
"name": "新的?",
"type": "n8n-nodes-base.if",
"position": [
760,
-40
],
"parameters": {},
"typeVersion": 2.2
},
{
"id": "b182148c-cd63-4907-b06b-0d857fe217bd",
"name": "添加订单",
"type": "n8n-nodes-base.postgres",
"position": [
980,
-40
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "e3d21c9a-92da-4157-84ca-d639d0c3b0f4",
"name": "获取订单",
"type": "n8n-nodes-base.postgres",
"position": [
980,
-240
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "9efb1e5f-3471-4beb-9574-cd3cf5423d08",
"name": "获取订单",
"type": "n8n-nodes-base.postgres",
"position": [
980,
-440
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "9e45cadf-99ca-4ac7-b4ac-24583e1ae577",
"name": "合并数字与文本",
"type": "n8n-nodes-base.set",
"position": [
1640,
-440
],
"parameters": {},
"typeVersion": 3.4
},
{
"id": "74908820-0030-46f9-93c4-03409d1114c6",
"name": "合并列表",
"type": "n8n-nodes-base.summarize",
"position": [
1860,
-440
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "f0735435-b9e0-440f-99d9-d2103beced70",
"name": "活跃?",
"type": "n8n-nodes-base.if",
"position": [
1420,
-440
],
"parameters": {},
"typeVersion": 2.2
},
{
"id": "1a1662fd-9132-492c-820c-73eb053bc82b",
"name": "成功",
"type": "n8n-nodes-base.telegram",
"position": [
2520,
-1040
],
"webhookId": "a35b9642-3e4f-48ef-a205-9c92f6153765",
"parameters": {},
"executeOnce": true,
"typeVersion": 1.2
},
{
"id": "3f98deb7-91b9-45bd-9793-46aee0d27646",
"name": "答案",
"type": "n8n-nodes-base.switch",
"position": [
980,
-640
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "7e34ab31-d876-4e57-af2a-0ca16f676496",
"name": "获取店铺列表选择",
"type": "n8n-nodes-base.postgres",
"position": [
1420,
-640
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "c1c90687-59d3-45a5-9120-4f5cbc665716",
"name": "获取订单",
"type": "n8n-nodes-base.postgres",
"position": [
1200,
-640
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "0b7fe215-da59-4929-9ff0-243f228ca44a",
"name": "更新 message_id",
"type": "n8n-nodes-base.postgres",
"position": [
2740,
-640
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "651bbf00-0f3c-4f62-90b5-495620d0f31b",
"name": "发送",
"type": "n8n-nodes-base.telegram",
"position": [
2520,
-640
],
"webhookId": "fdbc73c9-4bc5-43c9-ad3e-0cff98615765",
"parameters": {},
"executeOnce": true,
"typeVersion": 1.2
},
{
"id": "d16ecf8d-8710-4670-b075-665868b12448",
"name": "转换状态",
"type": "n8n-nodes-base.code",
"position": [
1640,
-640
],
"parameters": {},
"typeVersion": 2
},
{
"id": "b32aa3a1-7c77-449f-97a3-e6a16ad75eb8",
"name": "在 START 时更新插入机器人状态",
"type": "n8n-nodes-base.postgres",
"position": [
540,
-240
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "82b8d8e1-e85e-4b05-8dce-837e7803952b",
"name": "更新 message_id",
"type": "n8n-nodes-base.postgres",
"position": [
2740,
-240
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "c6df2a06-9190-4147-92d3-3c1c66ee7c4e",
"name": "获取 message_id",
"type": "n8n-nodes-base.postgres",
"position": [
2080,
-440
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "7426d596-c35f-4fca-97a4-c8b5baa756b2",
"name": "删除上一条短信",
"type": "n8n-nodes-base.telegram",
"position": [
2300,
-440
],
"webhookId": "c9507578-7052-4b01-b623-ad9a5fe6f6f1",
"parameters": {},
"executeOnce": true,
"typeVersion": 1.2
},
{
"id": "78621baf-bfcc-46aa-b60d-9cff4f510af7",
"name": "更新 message_id",
"type": "n8n-nodes-base.postgres",
"position": [
2740,
-440
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "73aff6d6-69c8-4ab4-a7ca-49fc389855e3",
"name": "获取 message_id",
"type": "n8n-nodes-base.postgres",
"position": [
1420,
-840
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "59332e3f-4f81-41a4-972c-68e0b9c56e82",
"name": "删除上一条短信",
"type": "n8n-nodes-base.telegram",
"position": [
1640,
-840
],
"webhookId": "6e8dcbfe-b289-4319-bb64-2ac07093c990",
"parameters": {},
"executeOnce": true,
"typeVersion": 1.2
},
{
"id": "873cf289-950a-4a7f-94bb-a91270d32a69",
"name": "获取 message_id",
"type": "n8n-nodes-base.postgres",
"position": [
2740,
-1040
],
"parameters": {},
"typeVersion": 2.5
},
{
"id": "ef673238-88cc-436d-a0c9-8a8fbabc3e97",
"name": "删除上一条短信",
"type": "n8n-nodes-base.telegram",
"position": [
2960,
-1040
],
"webhookId": "53eaa7da-9d3d-4c06-af52-4c738b281ac7",
"parameters": {},
"executeOnce": true,
"typeVersion": 1.2
},
{
"id": "99de2f14-e365-4d25-843c-46ce2e38b691",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-820,
-320
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "0ca089e8-f540-4d18-8fea-cd49d503edd9",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-820,
-40
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "62f94e29-3299-4dce-8340-9b73607acfd3",
"name": "便签6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-820,
280
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "cafd4316-13cb-4bed-82f1-3217f40bdcf2",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-360,
280
],
"parameters": {
"content": ""
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "4f299886-d7f2-4fde-93eb-0c769aa52ead",
"connections": {
"Edit": {
"main": [
[
{
"node": "Update message_id ",
"type": "main",
"index": 0
}
]
]
},
"New?": {
"main": [
[
{
"node": "Add Order",
"type": "main",
"index": 0
}
],
[]
]
},
"Send": {
"main": [
[
{
"node": "Update message_id",
"type": "main",
"index": 0
}
]
]
},
"Send ": {
"main": [
[
{
"node": "Update message_id ",
"type": "main",
"index": 0
}
]
]
},
"Start?": {
"main": [
[
{
"node": "Welcome Message",
"type": "main",
"index": 0
}
],
[
{
"node": "Define Type",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Answers",
"type": "main",
"index": 0
}
],
[
{
"node": "Get Order ",
"type": "main",
"index": 0
}
],
[
{
"node": "Get Order",
"type": "main",
"index": 0
}
]
]
},
"Active?": {
"main": [
[
{
"node": "Union Number with Text",
"type": "main",
"index": 0
}
]
]
},
"Answers": {
"main": [
[
{
"node": "Success",
"type": "main",
"index": 0
}
],
[
{
"node": "Get Order ",
"type": "main",
"index": 0
}
]
]
},
"Results": {
"main": [
[
{
"node": "Update message_id ",
"type": "main",
"index": 0
}
]
]
},
"Success": {
"main": [
[
{
"node": "Get message_id ",
"type": "main",
"index": 0
}
]
]
},
"Add Order": {
"main": [
[
{
"node": "Get Shop List",
"type": "main",
"index": 0
}
]
]
},
"Get Order": {
"main": [
[
{
"node": "Get message_id",
"type": "main",
"index": 0
}
]
]
},
"Get Order ": {
"main": [
[
{
"node": "Get Shop List Choices",
"type": "main",
"index": 0
}
]
]
},
"Union List": {
"main": [
[
{
"node": "Get message_id ",
"type": "main",
"index": 0
}
]
]
},
"Define Type": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
],
[
{
"node": "New?",
"type": "main",
"index": 0
}
]
]
},
"Get Order ": {
"main": [
[
{
"node": "Get Shop List Choices ",
"type": "main",
"index": 0
},
{
"node": "Get message_id ",
"type": "main",
"index": 0
}
]
]
},
"Variables TG": {
"main": [
[
{
"node": "Initialization",
"type": "main",
"index": 0
}
]
]
},
"Get Shop List": {
"main": [
[
{
"node": "Add Shop List Choice",
"type": "main",
"index": 0
}
]
]
},
"Get message_id": {
"main": [
[
{
"node": "Update Shop List Choice",
"type": "main",
"index": 0
}
]
]
},
"Initialization": {
"main": [
[
{
"node": "Start?",
"type": "main",
"index": 0
}
]
]
},
"Delete Prev SMS": {
"main": [
[
{
"node": "Results",
"type": "main",
"index": 0
}
]
]
},
"Get message_id ": {
"main": [
[
{
"node": "Delete Prev SMS",
"type": "main",
"index": 0
}
]
]
},
"Welcome Message": {
"main": [
[
{
"node": "Upsert bot status on START",
"type": "main",
"index": 0
}
]
]
},
"Convert statuses": {
"main": [
[
{
"node": "Send",
"type": "main",
"index": 0
}
]
]
},
"Delete Prev SMS ": {
"main": [
[]
]
},
"Get message_id ": {
"main": [
[
{
"node": "Delete Prev SMS ",
"type": "main",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "Variables TG",
"type": "main",
"index": 0
}
]
]
},
"Convert statuses ": {
"main": [
[
{
"node": "Send ",
"type": "main",
"index": 0
}
]
]
},
"Get message_id ": {
"main": [
[
{
"node": "Delete Prev SMS ",
"type": "main",
"index": 0
}
]
]
},
"Add Shop List Choice": {
"main": [
[
{
"node": "Convert statuses",
"type": "main",
"index": 0
}
]
]
},
"Get Shop List Choice": {
"main": [
[
{
"node": "Convert statuses and antistatuses",
"type": "main",
"index": 0
}
]
]
},
"Get Shop List Choices": {
"main": [
[
{
"node": "Active?",
"type": "main",
"index": 0
}
]
]
},
"Get Shop List Choices ": {
"main": [
[
{
"node": "Convert statuses ",
"type": "main",
"index": 0
}
]
]
},
"Union Number with Text": {
"main": [
[
{
"node": "Union List",
"type": "main",
"index": 0
}
]
]
},
"Update Shop List Choice": {
"main": [
[
{
"node": "Get Shop List Choice",
"type": "main",
"index": 0
}
]
]
},
"Convert statuses and antistatuses": {
"main": [
[
{
"node": "Edit",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
这是一个高级难度的工作流,适用于Sales、Marketing等场景。适合高级用户,包含 16+ 个节点的复杂工作流
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
TG-Bot-Module-Quiz-v4-db-sell-full
通过Telegram在Postgres中自动化测试和收集响应("测验"模块)
If
Set
Code
+9
36 节点Andrew
Sales
TG-机器人模块-跨平台发布-v1-数据库-销售完整版
使用Postgres自动化Telegram频道帖子("跨平台发布"模块)
If
Set
Switch
+5
47 节点Andrew
Sales
TG-Bot-模块-检查_订阅-v4-数据库-销售-完整版
使用 Postgres 验证 Telegram 频道订阅并进行访问控制
If
Set
Switch
+7
45 节点Andrew
Building Blocks
WA-机器人模块-测验-v1-数据库销售完整版
使用PostgreSQL自动化WhatsApp测验和结果排名("测验"模块)
If
Set
Sort
+6
39 节点Andrew
Sales
WA-机器人模块-预约-v1-数据库-销售-完整版
通过Telegram和PostgreSQL的自动化客户预约("预约"模块)
If
Set
Merge
+6
49 节点Andrew
Sales
WA-机器人模块目录-v1-数据库销售完整版
基于PostgreSQL数据库的WhatsApp产品目录机器人
If
Set
Switch
+5
22 节点Andrew
Sales