Shopify: automatisches Versenden von WhatsApp-Danke-Nachrichten und Treue-Coupons (mit Rapiwa-API)
Dies ist ein Content Creation, Multimodal AI-Bereich Automatisierungsworkflow mit 17 Nodes. Hauptsächlich werden If, Code, Wait, HttpRequest, GoogleSheets und andere Nodes verwendet. Automatisches Senden von WhatsApp-Dank-Nachrichten und Treue-Coupons aus Shopify mit Rapiwa
- •Möglicherweise sind Ziel-API-Anmeldedaten erforderlich
- •Google Sheets API-Anmeldedaten
Verwendete Nodes (17)
Kategorie
{
"id": "TZh5DGrhbMLuufLR",
"meta": {
"instanceId": "cb9a1e5321767b6316634728341237e564b2587ab15b74ca0a89eb02a53484d6",
"templateCredsSetupCompleted": true
},
"name": "Shopify Auto Send WhatsApp Thank-You Messages & Loyalty Coupon Using Rapiwa API",
"tags": [],
"nodes": [
{
"id": "b520df6b-3acf-4fb0-929e-77446e6eaefc",
"name": "Elemente durchlaufen",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-448,
672
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "652b65b5-f5f0-4d15-99e4-41c0976ad8e2",
"name": "Wenn",
"type": "n8n-nodes-base.if",
"position": [
224,
928
],
"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": "f187821c-cd12-455f-b41e-91a851d62d78",
"name": "WhatsApp-Nummer bereinigen",
"type": "n8n-nodes-base.code",
"position": [
-176,
800
],
"parameters": {
"jsCode": "const items = $input.all();\n\nconst updatedItems = items.map((item) => {\n const waNo = item?.json?.[\"phone\"];\n const waNoStr = typeof waNo === 'string'\n ? waNo\n : (waNo !== undefined && waNo !== null ? String(waNo) : \"\");\n\n const cleanedNumber = waNoStr.replace(/\\D/g, \"\"); // Remove non-digit characters\n\n item.json[\"phone\"] = cleanedNumber;\n\n return item;\n});\n\nreturn updatedItems;\n"
},
"typeVersion": 2
},
{
"id": "1f5eefb7-8c49-4f53-a621-1f6628856964",
"name": "Gültige whatsapp-Nummer mit Rapiwa prüfen",
"type": "n8n-nodes-base.httpRequest",
"position": [
16,
800
],
"parameters": {
"url": "=https://app.rapiwa.com/api/verify-whatsapp",
"method": "POST",
"options": {},
"sendBody": true,
"authentication": "genericCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "number",
"value": "={{ $json.phone }}"
}
]
},
"genericAuthType": "httpBearerAuth"
},
"credentials": {
"httpBearerAuth": {
"id": "jnaHCyYia9OAFozh",
"name": "Rapiwa Bearer Auth"
}
},
"typeVersion": 4.2
},
{
"id": "3700e098-7168-4752-99e8-1656d8689ab7",
"name": "Zeilen in Tabelle 'Verifiziert & Gesendet' anhängen",
"type": "n8n-nodes-base.googleSheets",
"position": [
672,
800
],
"parameters": {
"columns": {
"value": {
"name": "={{ $('Clean WhatsApp Number').item.json.customerName }}",
"number": "={{ $json.to }}",
"status": "sent",
"validity": "verified"
},
"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": "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": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Zx_WXQW29NsITFPJ-SnjHgOlouvzG_sBNGzSA_B8cSA/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1q5mO2pRCdO-v51OyUZt-56UprsGpmn0PMGhnglgg2ls",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1q5mO2pRCdO-v51OyUZt-56UprsGpmn0PMGhnglgg2ls/edit?usp=drivesdk",
"cachedResultName": "Shopify - Send WhatsApp thank-you + loyalty coupon"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "gFH3Wjq6yYqSEAei",
"name": "Google Sheets"
}
},
"typeVersion": 4.6
},
{
"id": "1eda2f14-4088-4ced-9304-23868a0763e3",
"name": "Zeilen in Tabelle 'Nicht verifiziert & Nicht gesendet' anhängen",
"type": "n8n-nodes-base.googleSheets",
"position": [
464,
1024
],
"parameters": {
"columns": {
"value": {
"name": "={{ $('Clean WhatsApp Number').item.json.customerName }}",
"number": "={{ $json.data.number }}",
"status": "not sent",
"validity": "unverified"
},
"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": "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": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Zx_WXQW29NsITFPJ-SnjHgOlouvzG_sBNGzSA_B8cSA/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1q5mO2pRCdO-v51OyUZt-56UprsGpmn0PMGhnglgg2ls",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1q5mO2pRCdO-v51OyUZt-56UprsGpmn0PMGhnglgg2ls/edit?usp=drivesdk",
"cachedResultName": "Shopify - Send WhatsApp thank-you + loyalty coupon"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "gFH3Wjq6yYqSEAei",
"name": "Google Sheets"
}
},
"typeVersion": 4.6
},
{
"id": "4e8f8880-393d-4148-a43a-6b45dedae0fd",
"name": "Warten",
"type": "n8n-nodes-base.wait",
"position": [
704,
1024
],
"webhookId": "6c474e54-eb3c-4fcd-b455-948322cd0121",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "e6b244a0-9082-4dd9-979d-123c76b3d2b4",
"name": "Nachricht mit Rapiwa senden",
"type": "n8n-nodes-base.httpRequest",
"position": [
464,
800
],
"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": "=Hey {{ $('Clean WhatsApp Number').item.json.customerName }},\n\nYou're one of our favorite customers! 💚\nHere’s a *50% OFF* coupon just for you *SG-50*🎁\n\nHurry — it won’t last long! \n– Team *SpaGreen Creative*"
},
{
"name": "status"
}
]
},
"genericAuthType": "httpBearerAuth"
},
"credentials": {
"httpBearerAuth": {
"id": "jnaHCyYia9OAFozh",
"name": "Rapiwa Bearer Auth"
}
},
"typeVersion": 4.2
},
{
"id": "c964d973-17c1-4da3-903c-2ce26d8074ea",
"name": "Alle Kundendaten im Shop abrufen",
"type": "n8n-nodes-base.httpRequest",
"position": [
-896,
608
],
"parameters": {
"url": "https://your_shop_domain/admin/api/2025-07/customers.json",
"options": {},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "X-Shopify-Access-Token",
"value": "your_shopify_accesstoken like this➡️shpat_57xx78xxxxx90fxxx67"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "30f9176f-6e91-4990-ac1b-fa8333ef09db",
"name": "HTTP-Anforderungsdaten bereinigen",
"type": "n8n-nodes-base.code",
"position": [
-672,
608
],
"parameters": {
"jsCode": "const customers = items[0].json.customers;\n\nif (!Array.isArray(customers)) {\n throw new Error(\"Customers not found or not an array\");\n}\n\nreturn customers\n .filter((customer) => {\n const totalSpent = parseFloat(customer.total_spent || '0.00');\n return totalSpent > 5000;\n })\n .map((customer) => {\n const address = customer.default_address || {};\n\n return {\n json: {\n customerId: customer.id || null,\n customerName: `${customer.first_name || ''} ${customer.last_name || ''}`.trim(),\n email: customer.email || 'N/A',\n phone: customer.phone || address.phone || 'N/A',\n totalSpent: customer.total_spent || '0.00',\n ordersCount: customer.orders_count || 0,\n address: address.address1 || 'N/A',\n city: address.city || 'N/A',\n country: address.country || 'N/A',\n createdAt: customer.created_at || null,\n updatedAt: customer.updated_at || null,\n state: customer.state || 'N/A'\n }\n };\n });\n"
},
"typeVersion": 2
},
{
"id": "7616b409-a957-4e18-9247-88b6e8181dfb",
"name": "Clicki",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-1104,
608
],
"parameters": {},
"typeVersion": 1
},
{
"id": "ffe3dd46-960c-42a1-90ea-5bc5b69ae8cb",
"name": "Haftnotiz",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1248,
208
],
"parameters": {
"color": 7,
"width": 288,
"height": 608,
"content": "## Node: Clicki (Manual Trigger) \n**Purpose**: \nStarts the workflow manually when you want to run it.\n"
},
"typeVersion": 1
},
{
"id": "fffcb6eb-2a09-4285-bbf7-a4530ef6949e",
"name": "Haftnotiz1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-944,
208
],
"parameters": {
"color": 2,
"width": 400,
"height": 816,
"content": "## 1. Node: Get All Customer Data In Store \n**Purpose**: \nFetches all customer data from your Shopify store using Shopify API.\n`your_shopify_accesstoken like this➡️shpat_57xx78xxxxx90fxxx67\n`\n\n## 2. Node: Clean HTTP Request Data \n**Purpose**: \nFilters and processes Shopify customer data to only keep customers who have spent more than 5000 units. Extracts key customer info like name, phone, email, total spent, and address.\n"
},
"typeVersion": 1
},
{
"id": "c75fac79-51eb-44f7-8bf5-13ddb622884f",
"name": "Haftnotiz2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-528,
208
],
"parameters": {
"color": 5,
"width": 256,
"height": 1024,
"content": "## Node: Loop Over Items (Split in Batches) \n**Purpose**: \nSplits the customer list into smaller batches to process each customer individually or in groups.\n"
},
"typeVersion": 1
},
{
"id": "13e6b28d-ea71-42ba-a614-1e843dccbb2f",
"name": "Haftnotiz3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-256,
208
],
"parameters": {
"color": 6,
"width": 416,
"height": 1024,
"content": "## 1. Node: Clean WhatsApp Number (Code Node) \n**Purpose**: \nCleans up the phone numbers by removing non-digit characters to format the number properly for WhatsApp verification.\n\n## 2. Node: Check valid whatsapp number Using Rapiwa \n**Purpose**: \nChecks if the cleaned phone number is a valid WhatsApp number by calling the Rapiwa API."
},
"typeVersion": 1
},
{
"id": "bb30d9ea-0826-4aaa-aa95-7d1e1be71a3c",
"name": "Haftnotiz4",
"type": "n8n-nodes-base.stickyNote",
"position": [
176,
208
],
"parameters": {
"color": 4,
"width": 720,
"height": 1024,
"content": "## 1. Node: If (Condition Check) \n**Purpose**: \nChecks the Rapiwa API response to see if the phone number is verified as a WhatsApp number.\n\n## 2. Node: Send Message Using Rapiwa \n**Purpose**: \nSends a personalized discount message via WhatsApp to customers with verified WhatsApp numbers.\n\n## 3. Node: Append Rows in Sheet Verified & Sent \n**Purpose**: \nLogs details of customers with verified WhatsApp numbers and sent messages into a Google Sheet.\n\n## 4. Node: Append Rows in Sheet Unverified & Not sent \n**Purpose**: \nLogs customers with unverified WhatsApp numbers and marks them as “not sent” in the Google Sheet.\n\n## 5. Node: Wait \n**Purpose**: \nPauses the workflow briefly to avoid hitting API rate limits before processing the next batch of customers."
},
"typeVersion": 1
},
{
"id": "53d0c208-8d90-4503-8fd5-49057a65c93d",
"name": "Haftnotiz5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2128,
208
],
"parameters": {
"color": 4,
"width": 848,
"height": 2416,
"content": "# Shopify Auto Send WhatsApp Thank-You Messages & Loyalty Coupon Using Rapiwa API\n\n## Overview\nThis workflow retrieves all customers from a Shopify store, filters customers who have spent over 5000, cleans and standardizes WhatsApp phone numbers, validates numbers via the Rapiwa API, sends personalized WhatsApp messages to verified numbers, and logs verified and unverified numbers into separate Google Sheets tabs. It uses batching and wait delays to manage API rate limits.\n\n## Features\n- Fetches customer data automatically from Shopify\n- Filters high-value customers (total spent > 5000)\n- Cleans phone numbers by removing non-digit characters\n- Validates WhatsApp registration status using Rapiwa API\n- Conditional logic to handle verified vs unverified numbers\n- Sends promotional WhatsApp messages to verified contacts\n- Logs results to Google Sheets with status and validity tags\n- Includes a delay to prevent API throttling and sheet write conflicts\n- Loops over customers in batches for efficient processing\n\n## Requirements\n- Shopify store access with API token\n- Rapiwa API account with valid bearer token\n- Google Sheets account with OAuth2 credentials connected in n8n\n- Google Sheet prepared with appropriate columns (see below)\n- n8n instance with nodes enabled: HTTP Request, Code, Split In Batches, IF, Google Sheets, Wait\n- Phone numbers must be in a format suitable for cleaning and verification\n\n## n8n Credentials\n- Shopify Access Token: For API calls to fetch customer data\n- Rapiwa Bearer Token: For WhatsApp number verification and messaging\n- Google Sheets OAuth2 Credentials: To append rows to your spreadsheet\n\n\n## Google Sheet format (example rows)\n- **A Google Sheet** formatted like this ➤ [Sample](https://docs.google.com/spreadsheets/d/1q5mO2pRCdO-v51OyUZt-56UprsGpmn0PMGhnglgg2ls/edit?usp=sharing)\n\n| Name | Number | Status | Validity |\n| -------------- | ------------- | -------- | ---------- |\n| Abdul Mannan | 8801322827798 | not sent | unverified |\n| Abdul Mannan | 8801322827799 | sent | verified |\n\n\nNote: Ensure these columns exist exactly as specified for the append operation to work.\n\n## Nodes Used in the Workflow\n- Manual Trigger — starts the workflow manually\n- HTTP Request (Shopify) — fetch all customer data\n- Code — filter customers by spend and clean customer data\n- Split In Batches — process customers one by one\n- Code — clean and format WhatsApp numbers\n- HTTP Request (Rapiwa Verify) — check if number is registered on WhatsApp\n- IF — branch workflow based on verification result\n- HTTP Request (Rapiwa Send Message) — send WhatsApp message to verified numbers\n- Google Sheets Append — log verified numbers as sent\n- Google Sheets Append — log unverified numbers as not sent\n- Wait — add delay between processing batches\n\n## How to Use This Workflow\n1. Trigger the workflow manually or set up a scheduler if needed.\n2. The workflow fetches all customers from Shopify automatically.\n3. Filters customers whose total spending exceeds 5000.\n4. Cleans each customer's WhatsApp phone number.\n5. Verifies the WhatsApp number via Rapiwa API.\n6. If verified, sends a promotional message via WhatsApp.\n7. Logs the verified customers with \"sent\" status in Google Sheets.\n8. If not verified, logs them with \"not sent\" status.\n9. Adds a wait period before processing the next customer to avoid rate limits.\n10. Repeats until all customers are processed.\n\n## Customization Ideas\n- Modify filtering criteria (e.g., based on order count or location)\n- Change the WhatsApp message template to suit your brand voice\n- Add additional data points to Google Sheets (email, city, country)\n- Integrate with other messaging APIs or CRM platforms\n- Add error handling for API failures\n- Adjust batch sizes and wait times for performance tuning\n\n## Notes & Warnings\n- Ensure your Shopify API token has permissions to read customers\n- Rapiwa API limits may require adjusting wait times or batch sizes\n- Phone numbers must be consistent and cleaned for best validation accuracy\n- Google Sheets columns and sheet IDs must be correctly set\n- Keep sensitive credentials secure; avoid exposing bearer tokens\n- Test with a small data set before scaling up\n- This workflow is designed for customers with a high total spend; adjust filters as needed\n\n## Useful Links\n- **Dashboard:** [https://app.rapiwa.com](https://app.rapiwa.com/login)\n- **Official Website:** [https://rapiwa.com](https://rapiwa.com/)\n- **Documentation:** [https://docs.rapiwa.com](https://docs.rapiwa.com/)\n\n## Support & Help\n- **WhatsApp**: [Chat on WhatsApp](https://wa.me/8801322827799)\n- **Discord**: [SpaGreen Community](https://discord.gg/SsCChWEP)\n- **Facebook Group**: [SpaGreen Support](https://www.facebook.com/groups/spagreenbd)\n- **Website**: [https://spagreen.net](https://spagreen.net)\n- **Developer Portfolio**: [Codecanyon SpaGreen](https://codecanyon.net/user/spagreen/portfolio)\n"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "cbabfc7c-e86f-4f5d-a3ab-3eee077691d4",
"connections": {
"652b65b5-f5f0-4d15-99e4-41c0976ad8e2": {
"main": [
[
{
"node": "e6b244a0-9082-4dd9-979d-123c76b3d2b4",
"type": "main",
"index": 0
}
],
[
{
"node": "1eda2f14-4088-4ced-9304-23868a0763e3",
"type": "main",
"index": 0
}
]
]
},
"4e8f8880-393d-4148-a43a-6b45dedae0fd": {
"main": [
[
{
"node": "b520df6b-3acf-4fb0-929e-77446e6eaefc",
"type": "main",
"index": 0
}
]
]
},
"7616b409-a957-4e18-9247-88b6e8181dfb": {
"main": [
[
{
"node": "c964d973-17c1-4da3-903c-2ce26d8074ea",
"type": "main",
"index": 0
}
]
]
},
"b520df6b-3acf-4fb0-929e-77446e6eaefc": {
"main": [
[],
[
{
"node": "f187821c-cd12-455f-b41e-91a851d62d78",
"type": "main",
"index": 0
}
]
]
},
"f187821c-cd12-455f-b41e-91a851d62d78": {
"main": [
[
{
"node": "1f5eefb7-8c49-4f53-a621-1f6628856964",
"type": "main",
"index": 0
}
]
]
},
"30f9176f-6e91-4990-ac1b-fa8333ef09db": {
"main": [
[
{
"node": "b520df6b-3acf-4fb0-929e-77446e6eaefc",
"type": "main",
"index": 0
}
]
]
},
"e6b244a0-9082-4dd9-979d-123c76b3d2b4": {
"main": [
[
{
"node": "3700e098-7168-4752-99e8-1656d8689ab7",
"type": "main",
"index": 0
}
]
]
},
"c964d973-17c1-4da3-903c-2ce26d8074ea": {
"main": [
[
{
"node": "30f9176f-6e91-4990-ac1b-fa8333ef09db",
"type": "main",
"index": 0
}
]
]
},
"3700e098-7168-4752-99e8-1656d8689ab7": {
"main": [
[
{
"node": "4e8f8880-393d-4148-a43a-6b45dedae0fd",
"type": "main",
"index": 0
}
]
]
},
"1f5eefb7-8c49-4f53-a621-1f6628856964": {
"main": [
[
{
"node": "652b65b5-f5f0-4d15-99e4-41c0976ad8e2",
"type": "main",
"index": 0
}
]
]
},
"1eda2f14-4088-4ced-9304-23868a0763e3": {
"main": [
[
{
"node": "4e8f8880-393d-4148-a43a-6b45dedae0fd",
"type": "main",
"index": 0
}
]
]
}
}
}Wie verwende ich diesen Workflow?
Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.
Für welche Szenarien ist dieser Workflow geeignet?
Experte - Content-Erstellung, Multimodales KI
Ist es kostenpflichtig?
Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.
Verwandte Workflows
SpaGreen Creative
@spagreenSpaGreen 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.
Diesen Workflow teilen