8
n8n 中文网amn8n.com

使用Rapiwa自动化Shopify弃购车WhatsApp提醒(含产品链接)

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 19 个节点。主要使用 If, Code, Wait, HttpRequest, GoogleSheets 等节点。 自动化Shopify弃购车WhatsApp提醒:通过Rapiwa包含产品链接

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "H1rJA5MTCuWx5IFF",
  "meta": {
    "instanceId": "cb9a1e5321767b6316634728341237e564b2587ab15b74ca0a89eb02a53484d6",
    "templateCredsSetupCompleted": true
  },
  "name": "使用 Rapiwa 自动化 Shopify 弃购车 WhatsApp 提醒(含产品链接)",
  "tags": [],
  "nodes": [
    {
      "id": "4159f1ee-7b87-4320-8716-2d601b41bcd9",
      "name": "HTTP 请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2064,
        32
      ],
      "parameters": {
        "url": "https://salebotsg.myshopify.com/admin/api/2025-07/checkouts.json",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "i9zvAj1mpabm9ci9",
          "name": "shopify-app-auth"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "53535899-1bed-495b-a12c-38f7d4b38e21",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2400,
        32
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "69fbf648-32c5-42cf-8c8c-f504e3faec97",
      "name": "Rapiwa 发送器",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -144,
        112
      ],
      "parameters": {
        "url": "=https://app.rapiwa.com/api/send-message",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "number",
              "value": "={{ $json.data.number }}"
            },
            {
              "name": "message_type",
              "value": "text"
            },
            {
              "name": "message",
              "value": "=Hi {{ $('Clean WhatsApp Number').item.json.customerName }},\n\nYou left items in your cart at SpaGreen Creative. Here’s a quick look:\n\n🧾 Order Details:\n• Product: {{ $('Clean WhatsApp Number').item.json.productTitle }}\n• Qty: {{ $('Clean WhatsApp Number').item.json.quantity }}\n• Total: {{ $('Clean WhatsApp Number').item.json.totalPrice }} {{ $('Clean WhatsApp Number').item.json.presentment_currency }}\n\n🎁 Use code SPAGREEN10 for 10% OFF at checkout!\n\n👉 Complete your order: {{ $('Clean WhatsApp Number').item.json.abandonedCheckoutURL }}\n\nHurry — your cart won’t wait forever!\n\n— Team SpaGreen Creative"
            },
            {
              "name": "status"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "jnaHCyYia9OAFozh",
          "name": "Rapiwa Bearer Auth"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c925eed9-596d-4f47-a3bb-b1e7d366a14c",
      "name": "清理 WhatsApp 号码",
      "type": "n8n-nodes-base.code",
      "position": [
        -1264,
        48
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst updatedItems = items.map((item) => {\n  let rawNumber = item?.json[\"number\"];\n  rawNumber = rawNumber ? String(rawNumber) : \"\";\n  const cleanedNumber = rawNumber.replace(/\\D/g, \"\");\n  item.json[\"number\"] = cleanedNumber;\n  return item;\n});\nreturn updatedItems;"
      },
      "typeVersion": 2
    },
    {
      "id": "90aa8a3d-47eb-473f-afb4-906360350cd9",
      "name": "使用Rapiwa1检查有效WhatsApp号码",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -976,
        48
      ],
      "parameters": {
        "url": "=https://app.rapiwa.com/api/verify-whatsapp",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "number",
              "value": "={{ $json.number }}"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "jnaHCyYia9OAFozh",
          "name": "Rapiwa Bearer Auth"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a35dc547-b9c5-4a4c-9d7e-7fecd812bf71",
      "name": "便签 10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        -352
      ],
      "parameters": {
        "color": 6,
        "width": 576,
        "height": 992,
        "content": "## 清理和验证WhatsApp号码"
      },
      "typeVersion": 1
    },
    {
      "id": "45349501-247a-443c-b58e-1cea7f8f7e35",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        -352
      ],
      "parameters": {
        "color": 5,
        "width": 432,
        "height": 992,
        "content": "## 条件逻辑"
      },
      "typeVersion": 1
    },
    {
      "id": "4cffcb7b-6473-4c5d-a52c-23f33c28edfd",
      "name": "便签12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -352
      ],
      "parameters": {
        "color": 4,
        "width": 880,
        "height": 688,
        "content": "## 通过 HTTP 请求使用 Rapiwa 发送消息"
      },
      "typeVersion": 1
    },
    {
      "id": "d789b7a8-84ab-4143-98fc-d9b270302118",
      "name": "便签13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        352
      ],
      "parameters": {
        "color": 2,
        "width": 880,
        "height": 608,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6da3b3f7-8e68-41fb-b889-c62a0ca8f88b",
      "name": "如果",
      "type": "n8n-nodes-base.if",
      "position": [
        -576,
        288
      ],
      "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": "9ff80aa5-754b-4e07-b21d-c55ea9772a06",
      "name": "更改已验证和已发送行的状态",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        112,
        112
      ],
      "parameters": {
        "columns": {
          "value": {
            "name": "={{ $('Clean WhatsApp Number').item.json.customerName }}",
            "number": "={{ $('If').item.json.data.number }}",
            "status": "sent ",
            "order id": "={{ $('Clean WhatsApp Number').item.json.checkoutId }}",
            "validity": "vaeified",
            "item link": "={{ $('Clean WhatsApp Number').item.json.abandonedCheckoutURL }}",
            "item name": "={{ $('Clean WhatsApp Number').item.json.productTitle }}",
            "total price": "={{ $('Clean WhatsApp Number').item.json.totalPrice }} {{ $('Clean WhatsApp Number').item.json.presentment_currency }}"
          },
          "schema": [
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "number",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "order id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "order id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "item name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "item name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "coupon",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "coupon",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "item link",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "item link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "total price",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "total price",
              "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
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zsVzniJTeiFOafCI_V0B3_7VnlAPQ2CTWQa-N30qCqs/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1zsVzniJTeiFOafCI_V0B3_7VnlAPQ2CTWQa-N30qCqs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zsVzniJTeiFOafCI_V0B3_7VnlAPQ2CTWQa-N30qCqs/edit?usp=drivesdk",
          "cachedResultName": "Shopify - Send WhatsApp reminder with cart items link"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gFH3Wjq6yYqSEAei",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "44f406aa-e919-4c6a-a3fb-3eef71d5cb23",
      "name": "更改未验证和未发送行的状态",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -144,
        416
      ],
      "parameters": {
        "columns": {
          "value": {
            "name": "={{ $('Clean WhatsApp Number').item.json.customerName }}",
            "number": "={{ $json.data.number }}",
            "status": "not sent",
            "order id": "={{ $('Clean WhatsApp Number').item.json.checkoutId }}",
            "validity": "unverified",
            "item link": "={{ $('Loop Over Items').item.json.abandonedCheckoutURL }}",
            "item name": "={{ $('Clean WhatsApp Number').item.json.productTitle }}",
            "total price": "={{ $('Loop Over Items').item.json.totalPrice }} {{ $('Loop Over Items').item.json.presentment_currency }}"
          },
          "schema": [
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "number",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "order id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "order id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "item name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "item name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "coupon",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "coupon",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "item link",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "item link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "total price",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "total price",
              "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
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zsVzniJTeiFOafCI_V0B3_7VnlAPQ2CTWQa-N30qCqs/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1zsVzniJTeiFOafCI_V0B3_7VnlAPQ2CTWQa-N30qCqs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zsVzniJTeiFOafCI_V0B3_7VnlAPQ2CTWQa-N30qCqs/edit?usp=drivesdk",
          "cachedResultName": "Shopify - Send WhatsApp reminder with cart items link"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gFH3Wjq6yYqSEAei",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "f385eb14-50dd-4cac-82cd-30d9374adf70",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        112,
        416
      ],
      "webhookId": "6c474e54-eb3c-4fcd-b455-948322cd0121",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "965c02e8-8d9f-4edb-88b5-5cb8a509f633",
      "name": "格式化 HTTP 响应数据",
      "type": "n8n-nodes-base.code",
      "position": [
        -1840,
        32
      ],
      "parameters": {
        "jsCode": "const checkouts = items[0].json.checkouts;\n\nif (!Array.isArray(checkouts)) {\n  throw new Error(\"Checkouts not found or not an array\");\n}\n\nreturn checkouts.map((checkout) => {\n  const customer = checkout.customer || {};\n  const product = (checkout.line_items && checkout.line_items[0]) || {};\n\n  return {\n    json: {\n      checkoutId: checkout.id || null,\n      customerName: `${customer.first_name || ''} ${customer.last_name || ''}`.trim(),\n      number: checkout.phone || customer.phone || 'N/A',\n      productTitle: product.title || 'N/A',\n      quantity: product.quantity || 'N/A',\n      totalPrice: checkout.total_price || '0.00',\n      presentment_currency: checkout.presentment_currency,\n      abandonedCheckoutURL: checkout.abandoned_checkout_url || 'N/A'\n    }\n  };\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "01a37d2b-5e5b-4c00-ac3d-49f0fd7ce840",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1584,
        32
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "a2e4b5cb-996a-4d6e-a120-4a3c1955bec8",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4048,
        -352
      ],
      "parameters": {
        "color": 2,
        "width": 1424,
        "height": 2752,
        "content": "# 使用 Rapiwa 自动化 Shopify 弃购车 WhatsApp 提醒(含产品链接)"
      },
      "typeVersion": 1
    },
    {
      "id": "3524bc1e-7f0d-4cc2-8a45-339d60817664",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2496,
        -352
      ],
      "parameters": {
        "color": 4,
        "width": 256,
        "height": 656,
        "content": "## Scheduled Trigger  \n- What it does: Runs automatically based on a scheduled interval (e.g., every few hours).  \n- Why it matters: Ensures the automation works in the background without manual input."
      },
      "typeVersion": 1
    },
    {
      "id": "cbacf837-95cc-4509-aa67-75b57b045e06",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2224,
        -352
      ],
      "parameters": {
        "color": 5,
        "width": 528,
        "height": 656,
        "content": "## Fetch Abandoned Checkouts  \n### Node: HTTP Request  \n   - Endpoint: `https://salebotsg.myshopify.com/admin/api/2025-07/checkouts.json`  \n   - Auth: Shopify private app token via HTTP Header Auth  \n   - What it does: Pulls all active abandoned checkouts from Shopify.  \n   - Why it matters: It's the data source for your WhatsApp reminders.\n\n## Format the API Response  \n### Node: Format HTTP Response Data (Code Node)  \n   - What it does: Extracts customer name, phone, product title, quantity, price, and checkout URL from the raw JSON response.  \n   - Why it matters: Structures data for clean downstream use.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "35958d98-85da-45fb-ab7f-04057fd18f63",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        -352
      ],
      "parameters": {
        "color": 4,
        "width": 336,
        "height": 656,
        "content": "## Loop Through Each Checkout  \n### Node: Loop Over Items (SplitInBatches)  \n   - What it does: Processes one checkout at a time.  \n   - Why it matters: Enables batching and individual handling."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e21de6c3-502d-4100-b905-da2afd677ada",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Rapiwa Sender",
            "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
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Format HTTP Response Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rapiwa Sender": {
      "main": [
        [
          {
            "node": "Change State of Rows in Verified & Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Clean WhatsApp Number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean WhatsApp Number": {
      "main": [
        [
          {
            "node": "Check valid whatsapp number Using Rapiwa1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format HTTP Response Data": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Change State of Rows in Verified & Sent": {
      "main": [
        [
          {
            "node": "Wait",
            "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)可能需要您自行付费。

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

适合高级用户,包含 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 查看

分享此工作流