Abandoned cart reminders on WhatsApp
Customers who leave checkout get a friendly WhatsApp reminder with a link back to their cart.
How it works
Trigger: Schedule — every hour
- Every hour, get checkouts abandoned 1–2 hours ago from Shopify.
- Keep the ones with a phone number that weren't completed.
- Send each customer an approved WhatsApp template with their total and a link back to the cart.
Diagram
Trigger App Code
Code
JavaScript used in the Code step — already included in the template below.
// Keeps abandoned checkouts from the last hour or two that have a phone number
// and were not completed, ready for a WhatsApp reminder.
const checkouts = $input.first().json.checkouts || [];
return checkouts
.filter((c) => !c.completed_at)
.map((c) => ({
phone: String(c.phone || c.shipping_address?.phone || c.billing_address?.phone || "").replace(/[^0-9]/g, ""),
name: c.shipping_address?.first_name || c.customer?.first_name || "",
total: `${c.total_price} ${c.currency}`,
url: c.abandoned_checkout_url,
}))
.filter((c) => c.phone.length >= 10)
.map((c) => ({ json: c }));Build it
Pick your tool — same automation, step by step.
Copy and paste straight into an n8n canvas (Ctrl+V), or download and use Import from File. Then connect your own credentials and replace every YOUR_… placeholder.
Show code (151 lines)
{
"name": "Abandoned cart reminders on WhatsApp (Flowngn)",
"nodes": [
{
"parameters": {
"content": "## Abandoned cart reminders on WhatsApp\nCustomers who leave checkout get a friendly WhatsApp reminder with a link back to their cart.\n\n**Setup**\n1. Open each node and connect your own credentials.\n2. Replace every YOUR_… placeholder.\n3. Test once, then activate.\n\nFree template from Flowngn",
"height": 260,
"width": 340
},
"id": "458210f1-f980-4989-a1ec-07858e8eaece",
"name": "Setup notes",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-420,
-60
]
},
{
"parameters": {
"rule": {
"interval": [
{
"field": "hours",
"hoursInterval": 1
}
]
}
},
"id": "458210f1-f980-4989-a1ec-07858e8eaece",
"name": "Every hour",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
0,
0
]
},
{
"parameters": {
"url": "=https://YOUR_STORE.myshopify.com/admin/api/2024-10/checkouts.json?created_at_min={{ $now.minus({ hours: 2 }).toISO() }}&created_at_max={{ $now.minus({ hours: 1 }).toISO() }}",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "shopifyAccessTokenApi",
"options": {}
},
"id": "458210f1-f980-4989-a1ec-07858e8eaece",
"name": "Get abandoned checkouts",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
300,
0
]
},
{
"parameters": {
"jsCode": "// Keeps abandoned checkouts from the last hour or two that have a phone number\n// and were not completed, ready for a WhatsApp reminder.\nconst checkouts = $input.first().json.checkouts || [];\n\nreturn checkouts\n .filter((c) => !c.completed_at)\n .map((c) => ({\n phone: String(c.phone || c.shipping_address?.phone || c.billing_address?.phone || \"\").replace(/[^0-9]/g, \"\"),\n name: c.shipping_address?.first_name || c.customer?.first_name || \"\",\n total: `${c.total_price} ${c.currency}`,\n url: c.abandoned_checkout_url,\n }))\n .filter((c) => c.phone.length >= 10)\n .map((c) => ({ json: c }));"
},
"id": "458210f1-f980-4989-a1ec-07858e8eaece",
"name": "Carts with a phone",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
600,
0
]
},
{
"parameters": {
"operation": "sendTemplate",
"phoneNumberId": "YOUR_PHONE_NUMBER_ID",
"recipientPhoneNumber": "={{ $json.phone }}",
"template": "YOUR_CART_REMINDER_TEMPLATE|ar",
"components": {
"component": [
{
"type": "body",
"bodyParameters": {
"parameter": [
{
"type": "text",
"text": "={{ $json.name || 'عميلنا العزيز' }}"
},
{
"type": "text",
"text": "={{ $json.total }}"
},
{
"type": "text",
"text": "={{ $json.url }}"
}
]
}
}
]
}
},
"id": "458210f1-f980-4989-a1ec-07858e8eaece",
"name": "Send cart reminder",
"type": "n8n-nodes-base.whatsApp",
"typeVersion": 1,
"position": [
900,
0
]
}
],
"connections": {
"Every hour": {
"main": [
[
{
"node": "Get abandoned checkouts",
"type": "main",
"index": 0
}
]
]
},
"Get abandoned checkouts": {
"main": [
[
{
"node": "Carts with a phone",
"type": "main",
"index": 0
}
]
]
},
"Carts with a phone": {
"main": [
[
{
"node": "Send cart reminder",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"meta": {
"templateCredsSetupCompleted": false
},
"tags": []
}In Make, create a new scenario and add these modules in order:
- Schedule the scenario: Every hour
- HTTP › Make a request
- Tools › Set variable / Iterator + Array aggregator (same logic as the Code step)
- WhatsApp Business Cloud › Send a Template Message
- Every module run uses Make operations — the free plan includes a monthly quota.
- Make's built-in functions (map, sum, formatDate…) can replace most Code steps; for complex logic use a code module.
- Module and step names can differ slightly as Make and Zapier update their apps.
In Zapier, create a new Zap and add these steps in order:
- Schedule by Zapier — Every hour
- Webhooks by Zapier — GET
- Code by Zapier — Run JavaScript (paste the code from the Code section)
- WhatsApp — Send Template Message
- Zaps with more than two steps need a paid Zapier plan.
- Webhooks, Filters/Paths and Code by Zapier are premium features on some Zapier plans.
- Code by Zapier runs JavaScript: reuse the code shown above, reading inputs from inputData instead of $json.
- Module and step names can differ slightly as Make and Zapier update their apps.
Tips
- Only message customers who agreed to WhatsApp messages at checkout.
- A small discount code in the template often doubles recoveries.
Related flows
E-commerceMedium
Daily Shopify sales summary on WhatsApp
Every morning, get yesterday's order count and revenue sent to your WhatsApp.
Shopify → WhatsApp3h/mo
E-commerceMedium
WhatsApp order confirmation for Shopify
Customers get a WhatsApp message the moment they place an order.
Shopify → WhatsApp6h/mo
E-commerceEasy
Log every new order in Google Sheets
Each new Shopify order becomes a row in a spreadsheet you can filter and share.
Shopify → Google Sheets4h/mo