8
n8n 中文网amn8n.com

使用Rapiwa API的批量WhatsApp营销自动化(非官方集成)

高级

这是一个Social Media, Multimodal AI领域的自动化工作流,包含 20 个节点。主要使用 If, Code, Wait, Limit, HttpRequest 等节点。 使用Rapiwa API从Google Sheets批量发送WhatsApp消息

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "Z69DQyzbsETSrFnF",
  "meta": {
    "instanceId": "cb9a1e5321767b6316634728341237e564b2587ab15b74ca0a89eb02a53484d6",
    "templateCredsSetupCompleted": true
  },
  "name": "使用Rapiwa API的批量WhatsApp营销自动化(非官方集成)",
  "tags": [],
  "nodes": [
    {
      "id": "6ffdf381-b0ad-443f-b2c2-43ab66b81f41",
      "name": "获取所有待处理查询以进行消息发送",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1232,
        176
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "Status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 2104188169,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Ui4TzzI-Gq-bsEsrZELwW1Kyddw0IU9L1wxlHikktqw/edit#gid=2104188169",
          "cachedResultName": "Message Queue"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Ui4TzzI-Gq-bsEsrZELwW1Kyddw0IU9L1wxlHikktqw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Ui4TzzI-Gq-bsEsrZELwW1Kyddw0IU9L1wxlHikktqw/edit?usp=drivesdk",
          "cachedResultName": "WhatsApp Bulk Messaging via Unofficial API"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gFH3Wjq6yYqSEAei",
          "name": "Google Sheets"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.6
    },
    {
      "id": "d1fe1708-b770-4bd0-914b-eb8a626013e8",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1920,
        176
      ],
      "parameters": {
        "options": {}
      },
      "executeOnce": false,
      "typeVersion": 3
    },
    {
      "id": "13f03348-6233-4300-b6c8-ed98e836a938",
      "name": "限制",
      "type": "n8n-nodes-base.limit",
      "position": [
        1568,
        176
      ],
      "parameters": {
        "maxItems": 60
      },
      "typeVersion": 1
    },
    {
      "id": "c51ac8c7-a266-4c2f-ace6-3f60eed3fb72",
      "name": "每 5 分钟触发一次",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        912,
        176
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "41e96999-aa74-41d8-8d5b-961ecc1ccc0e",
      "name": "清理 WhatsApp 号码",
      "type": "n8n-nodes-base.code",
      "position": [
        2224,
        192
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst updatedItems = items.map((item) => {\n  const waNo = item?.json[\"WhatsApp No\"];\n  const waNoStr = typeof waNo === 'string' ? waNo : (waNo !== undefined && waNo !== null ? String(waNo) : \"\");\n  const cleanedNumber = waNoStr.replace(/\\D/g, \"\");\n  item.json[\"WhatsApp No\"] = cleanedNumber;\n  return item;\n});\nreturn updatedItems;"
      },
      "typeVersion": 2
    },
    {
      "id": "fd906102-6ead-40f1-b821-154606be83f6",
      "name": "使用Rapiwa发送消息",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3360,
        256
      ],
      "parameters": {
        "url": "https://app.rapiwa.com/api/send-message",
        "method": "POST",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "number",
              "value": "={{ $json.data.number }}"
            },
            {
              "name": "message",
              "value": "={{ $('Clean WhatsApp Number').item.json.Message }}"
            },
            {
              "name": "imageUrl",
              "value": "={{ $('Clean WhatsApp Number').item.json[\"Image URL\"] }}"
            },
            {
              "name": "message_type",
              "value": "text"
            }
          ]
        }
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "jnaHCyYia9OAFozh",
          "name": "Rapiwa Bearer Auth"
        }
      },
      "executeOnce": false,
      "typeVersion": 4.2
    },
    {
      "id": "30e554d8-c023-4fa1-b015-ec28121fa86d",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        -208
      ],
      "parameters": {
        "color": 4,
        "width": 304,
        "height": 592,
        "content": "## 每5分钟触发"
      },
      "typeVersion": 1
    },
    {
      "id": "5104be69-ac68-4868-9d9b-b81602e04578",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        -208
      ],
      "parameters": {
        "color": 4,
        "width": 336,
        "height": 592,
        "content": "## 获取所有待处理的消息查询"
      },
      "typeVersion": 1
    },
    {
      "id": "5e75e33c-be5c-49f0-93a5-5071aa00e514",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1456,
        -208
      ],
      "parameters": {
        "color": 4,
        "width": 336,
        "height": 592,
        "content": "## 限制"
      },
      "typeVersion": 1
    },
    {
      "id": "42f57b01-0f2e-4490-93a9-ccfa5b218d59",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1808,
        -208
      ],
      "parameters": {
        "color": 5,
        "width": 336,
        "height": 992,
        "content": "## 遍历项目"
      },
      "typeVersion": 1
    },
    {
      "id": "b13fb8fa-0cc4-4a9f-8b8c-e56c37628d09",
      "name": "使用Rapiwa1检查有效WhatsApp号码",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2512,
        192
      ],
      "parameters": {
        "url": "=https://app.rapiwa.com/api/verify-whatsapp",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "number",
              "value": "={{ $json[\"WhatsApp No\"] }}"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "jnaHCyYia9OAFozh",
          "name": "Rapiwa Bearer Auth"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0ff144e6-0c99-4a10-9906-17de9981a5bb",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2160,
        -208
      ],
      "parameters": {
        "color": 2,
        "width": 576,
        "height": 992,
        "content": "## 清理和验证WhatsApp号码"
      },
      "typeVersion": 1
    },
    {
      "id": "2e73d560-f405-4c25-9f2a-f9373d6d4e23",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2752,
        -208
      ],
      "parameters": {
        "color": 5,
        "width": 432,
        "height": 992,
        "content": "## 条件逻辑"
      },
      "typeVersion": 1
    },
    {
      "id": "6a8f9605-abe6-4047-959b-9ca0d23ae5ea",
      "name": "便签12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3200,
        -208
      ],
      "parameters": {
        "color": 4,
        "width": 880,
        "height": 688,
        "content": "## 通过HTTP请求使用Rapiwa发送消息"
      },
      "typeVersion": 1
    },
    {
      "id": "e04b24ae-a298-4af2-872e-97bbebac3b2c",
      "name": "便签13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3200,
        496
      ],
      "parameters": {
        "color": 7,
        "width": 880,
        "height": 608,
        "content": "## 附加未验证行到表格"
      },
      "typeVersion": 1
    },
    {
      "id": "b2cee59b-5cd0-4c42-92a4-3c80caea3406",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        3600,
        560
      ],
      "webhookId": "6c474e54-eb3c-4fcd-b455-948322cd0121",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "87cf0d0e-62ff-43f9-879a-9cab386d541b",
      "name": "如果",
      "type": "n8n-nodes-base.if",
      "position": [
        2912,
        432
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "3ab8725a-9268-45fd-b91c-0e055fe6fa7c",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.exists }}",
              "rightValue": "=\"true\""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e655fc56-d84e-48b3-ae54-d6b8f26886c9",
      "name": "更改已验证和已发送行的状态",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3600,
        256
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "sent",
            "row_number": "={{ $('Limit').item.json.row_number }}",
            "Verification": "verified"
          },
          "schema": [
            {
              "id": "SL",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "SL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "WhatsApp No",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "WhatsApp No",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Message",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image URL",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Image URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Verification",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Verification",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 2104188169,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Ui4TzzI-Gq-bsEsrZELwW1Kyddw0IU9L1wxlHikktqw/edit#gid=2104188169",
          "cachedResultName": "Message Queue"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Ui4TzzI-Gq-bsEsrZELwW1Kyddw0IU9L1wxlHikktqw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Ui4TzzI-Gq-bsEsrZELwW1Kyddw0IU9L1wxlHikktqw/edit?usp=drivesdk",
          "cachedResultName": "WhatsApp Bulk Messaging via Unofficial API"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gFH3Wjq6yYqSEAei",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "2c768d60-a246-4077-b6f6-ce14c21fe6e2",
      "name": "更改未验证和未发送行的状态",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3360,
        560
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "not sent",
            "row_number": "={{ $('Limit').item.json.row_number }}",
            "Verification": "unverified"
          },
          "schema": [
            {
              "id": "SL",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "SL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "WhatsApp No",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "WhatsApp No",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Message",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image URL",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Image URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Verification",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Verification",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 2104188169,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Ui4TzzI-Gq-bsEsrZELwW1Kyddw0IU9L1wxlHikktqw/edit#gid=2104188169",
          "cachedResultName": "Message Queue"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Ui4TzzI-Gq-bsEsrZELwW1Kyddw0IU9L1wxlHikktqw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Ui4TzzI-Gq-bsEsrZELwW1Kyddw0IU9L1wxlHikktqw/edit?usp=drivesdk",
          "cachedResultName": "WhatsApp Bulk Messaging via Unofficial API"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gFH3Wjq6yYqSEAei",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "d8922b67-8186-42ef-abf9-afeea7380db5",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        -208
      ],
      "parameters": {
        "width": 1056,
        "height": 2716,
        "content": "# 使用Rapiwa API的批量WhatsApp营销自动化(非官方集成)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "db2b9cf8-f139-49c8-ae20-b8e81854156b",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Send Message Using Rapiwa",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Change State of Rows in Unverified & Not Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Clean WhatsApp Number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean WhatsApp Number": {
      "main": [
        [
          {
            "node": "Check valid whatsapp number Using Rapiwa1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger Every 5 Minute": {
      "main": [
        [
          {
            "node": "Fetch All Pending Queries for Messaging",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Message Using Rapiwa": {
      "main": [
        [
          {
            "node": "Change State of Rows in Verified & Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Change State of Rows in Verified & Sent": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All Pending Queries for Messaging": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check valid whatsapp number Using Rapiwa1": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Change State of Rows in Unverified & Not Sent": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 社交媒体, 多模态 AI

需要付费吗?

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

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

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

作者
SpaGreen Creative

SpaGreen Creative

@spagreen

SpaGreen Creative is a leading software company specializing in SaaS solutions, AI automation, and Laravel/Vue.js development. With 800+ eCommerce platforms and 8,000+ global clients, we deliver powerful tools for OTT, CRM, ERP, and WhatsApp marketing. We combine innovation and tech to build scalable digital products.

外部链接
在 n8n.io 查看

分享此工作流