8
n8n 中文网amn8n.com

使用Rapiwa API从Google表格自动化发送WhatsApp欢迎消息

高级

这是一个Lead Nurturing, Multimodal AI领域的自动化工作流,包含 17 个节点。主要使用 If, Code, Wait, Limit, HttpRequest 等节点。 使用Google表格和Rapiwa为销售线索自动化发送WhatsApp欢迎消息

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "wVvNaEO8lG0lIMzU",
  "meta": {
    "instanceId": "cb9a1e5321767b6316634728341237e564b2587ab15b74ca0a89eb02a53484d6",
    "templateCredsSetupCompleted": true
  },
  "name": "使用 Rapiwa API 从 Google Sheets 自动化 WhatsApp 欢迎消息",
  "tags": [],
  "nodes": [
    {
      "id": "0550f462-b916-47d3-bebf-b505da01a7fd",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2736,
        -880
      ],
      "parameters": {
        "color": 4,
        "width": 1040,
        "height": 1728,
        "content": "# 使用 n8n 和 Rapiwa API 从 Google Sheets 自动化 WhatsApp 欢迎消息"
      },
      "typeVersion": 1
    },
    {
      "id": "0841f0a0-7042-4049-8642-6d40987fc607",
      "name": "获取所有待处理查询以发送消息1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1072,
        -496
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "check"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1amkVSIXrhOkf86YDYaddOcAamhUC4DlvFiSg3cpAH78/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1amkVSIXrhOkf86YDYaddOcAamhUC4DlvFiSg3cpAH78",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1amkVSIXrhOkf86YDYaddOcAamhUC4DlvFiSg3cpAH78/edit?usp=drivesdk",
          "cachedResultName": "Sales - Send welcome message"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gFH3Wjq6yYqSEAei",
          "name": "Google Sheets"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.6
    },
    {
      "id": "27263025-0d11-4e6b-bf84-df8e3269cd24",
      "name": "限制1",
      "type": "n8n-nodes-base.limit",
      "position": [
        -656,
        -496
      ],
      "parameters": {
        "maxItems": 60
      },
      "typeVersion": 1
    },
    {
      "id": "ed57db8c-6127-454f-b7a1-b65a77877e7b",
      "name": "清理 WhatsApp 号码1",
      "type": "n8n-nodes-base.code",
      "position": [
        16,
        -480
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\n\nconst updatedItems = items.map((item) => {\n  let waNo = item?.json[\"WhatsApp No\"];\n\n  // Convert to string safely\n  let waNoStr = \"\";\n  if (typeof waNo === 'string') {\n    waNoStr = waNo;\n  } else if (waNo !== undefined && waNo !== null) {\n    waNoStr = String(waNo);\n  }\n\n  // Remove all non-digit characters\n  const cleanedNumber = waNoStr.replace(/\\D/g, \"\");\n\n  // Assign cleaned number as a string\n  item.json[\"WhatsApp No\"] = cleanedNumber;\n\n  return item;\n});\n\nreturn updatedItems;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "7e100ddc-107e-4059-90cb-b4cef3d5c3a7",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -416,
        -496
      ],
      "parameters": {
        "options": {}
      },
      "executeOnce": false,
      "typeVersion": 3
    },
    {
      "id": "da9deff5-b797-4997-a2e2-5923f09f7c18",
      "name": "使用 Rapiwa 发送消息1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        816,
        -128
      ],
      "parameters": {
        "url": "=https://app.rapiwa.com/api/send-message",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "number",
              "value": "={{ $json.data.phone }}"
            },
            {
              "name": "message_type",
              "value": "text"
            },
            {
              "name": "message",
              "value": "=Hi *{{ $('Clean WhatsApp Number1').item.json['name '] }}*,\nThanks for purchasing from *Spagreen Creative*. Your product purchase has been confirmed.\nWe truly appreciate your trust in our products. If you have any questions, feel free to message us here anytime!\n– Team *Spagreen Creative*"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "jnaHCyYia9OAFozh",
          "name": "Rapiwa Bearer Auth"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ae5bfcf0-f1c5-41a5-ad48-2f0cc94faa3c",
      "name": "更新行:未发送和未验证1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        816,
        80
      ],
      "parameters": {
        "columns": {
          "value": {
            "check": "checked",
            "status": "not sent",
            "validity": "unverified",
            "row_number": "={{ $('Loop Over Items').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "name ",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "name ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "number",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "time",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "check",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "check",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "validity",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "validity",
              "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": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1amkVSIXrhOkf86YDYaddOcAamhUC4DlvFiSg3cpAH78/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1amkVSIXrhOkf86YDYaddOcAamhUC4DlvFiSg3cpAH78",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1amkVSIXrhOkf86YDYaddOcAamhUC4DlvFiSg3cpAH78/edit?usp=drivesdk",
          "cachedResultName": "Sales - Send welcome message"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gFH3Wjq6yYqSEAei",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "fc1b5295-dda0-43ee-a275-32f55b969cb4",
      "name": "更新行:已发送和已验证1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1040,
        -128
      ],
      "parameters": {
        "columns": {
          "value": {
            "check": "checked",
            "status": "sent",
            "validity": "verified",
            "row_number": "={{ $('Loop Over Items').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "name ",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "name ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "number",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "time",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "check",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "check",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "validity",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "validity",
              "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": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1amkVSIXrhOkf86YDYaddOcAamhUC4DlvFiSg3cpAH78/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1amkVSIXrhOkf86YDYaddOcAamhUC4DlvFiSg3cpAH78",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1amkVSIXrhOkf86YDYaddOcAamhUC4DlvFiSg3cpAH78/edit?usp=drivesdk",
          "cachedResultName": "Sales - Send welcome message"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gFH3Wjq6yYqSEAei",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "524c6411-7826-4ef0-a723-e6fa741758b9",
      "name": "等待1",
      "type": "n8n-nodes-base.wait",
      "position": [
        1040,
        80
      ],
      "webhookId": "6c474e54-eb3c-4fcd-b455-948322cd0121",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "1f9f9e50-4934-4184-b4dd-b4aa3d2351ac",
      "name": "使用 Rapiwa 检查有效的 WhatsApp 号码1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        -480
      ],
      "parameters": {
        "url": "=https://app.rapiwa.com/api/verify-whatsapp",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "number",
              "value": "={{ String($json.number) }}"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "jnaHCyYia9OAFozh",
          "name": "Rapiwa Bearer Auth"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "31c3193f-ac56-4ae8-8221-06ef827f00ee",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        -896
      ],
      "parameters": {
        "width": 320,
        "height": 720,
        "content": "## 工作流计划"
      },
      "typeVersion": 1
    },
    {
      "id": "f1ed589d-493c-4a62-9fb3-5bbf0f83b0a5",
      "name": "## 为什么选择 4o 模型?👆",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1248,
        -896
      ],
      "parameters": {
        "color": 2,
        "width": 448,
        "height": 944,
        "content": "## Google Sheets 连接"
      },
      "typeVersion": 1
    },
    {
      "id": "83a91565-e5b4-4551-a8b7-6407ce030c6b",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        -896
      ],
      "parameters": {
        "color": 6,
        "width": 608,
        "height": 1232,
        "content": "## 限制和处理潜在客户"
      },
      "typeVersion": 1
    },
    {
      "id": "5f158c59-9cb4-4c43-9705-8cb6843baef8",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -896
      ],
      "parameters": {
        "color": 5,
        "width": 560,
        "height": 1232,
        "content": "## Clean and Verify WhatsApp Numbers\nBefore sending messages, each WhatsApp number is cleaned (removing spaces and symbols) and checked to make sure it’s a real, active WhatsApp account. Only valid numbers will get a message, so you don’t waste time or credits.\n\n- **Node:** Clean WhatsApp Number\n  - Removes any spaces or symbols from phone numbers so they work with the API.\n- **Node:** Check valid whatsapp number Using Rapiwa\n  - Checks if the WhatsApp number is real and can receive messages.\n  - Only valid numbers will get a message."
      },
      "typeVersion": 1
    },
    {
      "id": "30aea538-f33c-4e6e-ae4a-8295cc455f0f",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        464,
        -896
      ],
      "parameters": {
        "color": 4,
        "width": 848,
        "height": 1232,
        "content": "## Message Sending & Status Update\nIf a WhatsApp number is valid, the workflow sends a personalized message and updates the sheet to show it was sent. If not, it marks the row as not sent and unverified. Each message is sent with a 5-second pause to avoid being blocked. The Google Sheet is always updated, so you know which leads were contacted.\n\n- **Node:** If\n  - Checks if the WhatsApp number is valid.\n  - If valid: sends the message.\n  - If not valid: marks the row as \"not sent\" and \"unverified\".\n- **Node:** Send Message Using Rapiwa\n  - Sends a personalized WhatsApp message using the name from your sheet.\n- **Node:** Update rows: sent & verified\n  - Marks successful messages as \"sent\" and \"verified\".\n- **Node:** Update rows: not sent & unverified\n  - Marks failed messages as \"not sent\" and \"unverified\".\n- **Node:** Wait\n  - Waits 5 seconds between each message to avoid being blocked by WhatsApp or the API."
      },
      "typeVersion": 1
    },
    {
      "id": "20ec8ec0-ef20-40fe-9f97-8f11c201eb71",
      "name": "Trigger Every 5 Minute1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1504,
        -496
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "769eb9a9-5afb-42f3-8b79-26dbb824902d",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        560,
        0
      ],
      "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
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "40f6da2f-5153-49a9-b19a-c0365573c1ef",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Send Message Using Rapiwa1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update rows: not sent & unverified1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Clean WhatsApp Number1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean WhatsApp Number1": {
      "main": [
        [
          {
            "node": "Check valid whatsapp number Using Rapiwa1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger Every 5 Minute1": {
      "main": [
        [
          {
            "node": "Fetch All Pending Queries for Messaging1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Message Using Rapiwa1": {
      "main": [
        [
          {
            "node": "Update rows: sent & verified1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update rows: sent & verified1": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update rows: not sent & unverified1": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All Pending Queries for Messaging1": {
      "main": [
        [
          {
            "node": "Limit1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check valid whatsapp number Using Rapiwa1": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 客户培育, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量17
分类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 查看

分享此工作流