8
n8n 中文网amn8n.com

通过非官方API从Google Sheets批量发送WhatsApp消息

中级

这是一个Social Media领域的自动化工作流,包含 8 个节点。主要使用 Wait, Limit, HttpRequest, GoogleSheets, SplitInBatches 等节点。 使用WasenderAPI从Google Sheets批量发送WhatsApp消息

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "1ZnPRyjP4J0gq5Pw",
  "meta": {
    "instanceId": "281fe883012e72eba57c771d5dbf7c3138ca3fe3633c5ba2adf6169821825dd4",
    "templateCredsSetupCompleted": true
  },
  "name": "通过非官方 API 从 Google Sheets 批量发送 WhatsApp 消息",
  "tags": [],
  "nodes": [
    {
      "id": "0037860e-fbd4-4690-8063-eb94c1aad64d",
      "name": "获取所有待处理查询用于消息发送",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        48,
        32
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "pending",
              "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": "hIOzlTOST3U7PqR8",
          "name": "Google Sheets account"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.6
    },
    {
      "id": "032d3141-2d16-4b05-b94f-94272e0c7612",
      "name": "将已发送行的状态更改为已发送",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        912,
        16
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "sent",
            "row_number": "={{ $('Limit').item.json.row_number }}"
          },
          "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": "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": "hIOzlTOST3U7PqR8",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "da162b79-1c4e-4405-ad58-e0c9ffd74dd3",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        528,
        32
      ],
      "parameters": {
        "options": {}
      },
      "executeOnce": false,
      "typeVersion": 3
    },
    {
      "id": "f178aa36-8e99-4919-9320-36432a405bc5",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        928,
        192
      ],
      "webhookId": "7e5b1bab-e843-4f74-8462-2bf75260215e",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "17249748-0dca-40ad-a0fd-22b6948015ed",
      "name": "限制",
      "type": "n8n-nodes-base.limit",
      "position": [
        352,
        32
      ],
      "parameters": {
        "maxItems": 60
      },
      "typeVersion": 1
    },
    {
      "id": "18ae75b8-1dc9-4bdd-98d6-b421af4691f9",
      "name": "每 5 分钟触发一次",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -272,
        32
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d92b5e28-2752-4977-8daf-1d69ca70b7cf",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        -496
      ],
      "parameters": {
        "color": 4,
        "width": 704,
        "height": 1644,
        "content": "## 📘 n8n 工作流:通过非官方 API 进行 WhatsApp 批量消息发送"
      },
      "typeVersion": 1
    },
    {
      "id": "7a5c47a0-abab-4992-866b-55912ea23ac2",
      "name": "使用 HTTP 请求发送消息",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        736,
        192
      ],
      "parameters": {
        "url": "https://www.wasenderapi.com/api/send-message",
        "method": "POST",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "to",
              "value": "={{ $json['WhatsApp No'] }}"
            },
            {
              "name": "text",
              "value": "={{ $json.Message }}"
            },
            {
              "name": "imageUrl",
              "value": "={{ $json['Image URL'] }}"
            }
          ]
        }
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "eEnvhbO5JFh46Shb",
          "name": "WasenderAPI"
        }
      },
      "executeOnce": false,
      "typeVersion": 4.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "05c64115-b5bb-48b8-acc4-2091e40c6bd0",
  "connections": {
    "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": "Change State of Rows in Sent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Message Using HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger Every 5 Minute": {
      "main": [
        [
          {
            "node": "Fetch All Pending Queries for Messaging",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Change State of Rows in Sent": {
      "main": [
        []
      ]
    },
    "Send Message Using HTTP Request": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All Pending Queries for Messaging": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 社交媒体

需要付费吗?

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

工作流信息
难度等级
中级
节点数量8
分类1
节点类型7
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
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 6,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 查看

分享此工作流