Ask for a review 2 days after delivery
When Bosta delivers an order, wait two days, then ask the customer for a review on WhatsApp.
How it works
- Receive the status update from Bosta.
- Continue only when the shipment is delivered.
- Wait two days so the customer has tried the product.
- Find the customer in your Orders sheet and send a WhatsApp template with your review link.
Diagram
Code
JavaScript used in the Code step — already included in the template below.
// Mode: Run Once for Each Item
// Bosta delivery webhook → clean fields with a readable status in English and Arabic.
// Confirm the state codes in Bosta's webhook documentation and adjust this map if needed.
const STATES = {
21: { en: "Picked up", ar: "تم استلام الشحنة من المتجر", kind: "progress" },
24: { en: "At Bosta warehouse", ar: "الشحنة في مخزن بوسطة", kind: "progress" },
41: { en: "Out for delivery", ar: "الشحنة خرجت للتوصيل", kind: "progress" },
45: { en: "Delivered", ar: "تم التوصيل", kind: "delivered" },
46: { en: "Returned to business", ar: "تم إرجاع الشحنة", kind: "problem" },
47: { en: "Exception", ar: "مشكلة في التوصيل", kind: "problem" },
};
const b = $json.body || {};
const code = Number(b.state?.code ?? b.state);
const state = STATES[code] || { en: `Status ${code}`, ar: `الحالة ${code}`, kind: "other" };
return {
json: {
tracking: b.trackingNumber || "",
order_id: b.businessReference || "",
code,
status_en: state.en,
status_ar: state.ar,
kind: state.kind,
cod: b.cod || 0,
reason: b.exceptionReason || "",
},
};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 (228 lines)
{
"name": "Ask for a review 2 days after delivery (Flowngn)",
"nodes": [
{
"parameters": {
"content": "## Ask for a review 2 days after delivery\nWhen Bosta delivers an order, wait two days, then ask the customer for a review on WhatsApp.\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": "47157a09-bfe3-4e1d-a09c-20a04769de30",
"name": "Setup notes",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-420,
-60
]
},
{
"parameters": {
"httpMethod": "POST",
"path": "bosta-review",
"options": {}
},
"id": "47157a09-bfe3-4e1d-a09c-20a04769de30",
"name": "Bosta update",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
0,
0
],
"webhookId": "47157a09-bfe3-4e1d-a09c-20a04769de30"
},
{
"parameters": {
"jsCode": "// Mode: Run Once for Each Item\n// Bosta delivery webhook → clean fields with a readable status in English and Arabic.\n// Confirm the state codes in Bosta's webhook documentation and adjust this map if needed.\nconst STATES = {\n 21: { en: \"Picked up\", ar: \"تم استلام الشحنة من المتجر\", kind: \"progress\" },\n 24: { en: \"At Bosta warehouse\", ar: \"الشحنة في مخزن بوسطة\", kind: \"progress\" },\n 41: { en: \"Out for delivery\", ar: \"الشحنة خرجت للتوصيل\", kind: \"progress\" },\n 45: { en: \"Delivered\", ar: \"تم التوصيل\", kind: \"delivered\" },\n 46: { en: \"Returned to business\", ar: \"تم إرجاع الشحنة\", kind: \"problem\" },\n 47: { en: \"Exception\", ar: \"مشكلة في التوصيل\", kind: \"problem\" },\n};\n\nconst b = $json.body || {};\nconst code = Number(b.state?.code ?? b.state);\nconst state = STATES[code] || { en: `Status ${code}`, ar: `الحالة ${code}`, kind: \"other\" };\n\nreturn {\n json: {\n tracking: b.trackingNumber || \"\",\n order_id: b.businessReference || \"\",\n code,\n status_en: state.en,\n status_ar: state.ar,\n kind: state.kind,\n cod: b.cod || 0,\n reason: b.exceptionReason || \"\",\n },\n};",
"mode": "runOnceForEachItem"
},
"id": "47157a09-bfe3-4e1d-a09c-20a04769de30",
"name": "Read status",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
300,
0
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose"
},
"conditions": [
{
"id": "c1",
"leftValue": "={{ $json.kind }}",
"rightValue": "delivered",
"operator": {
"type": "string",
"operation": "equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "47157a09-bfe3-4e1d-a09c-20a04769de30",
"name": "Delivered?",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
600,
0
]
},
{
"parameters": {
"amount": 2,
"unit": "days"
},
"id": "47157a09-bfe3-4e1d-a09c-20a04769de30",
"name": "Wait 2 days",
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
900,
0
]
},
{
"parameters": {
"operation": "read",
"documentId": {
"__rl": true,
"value": "YOUR_SPREADSHEET_ID",
"mode": "id"
},
"sheetName": {
"__rl": true,
"value": "Orders",
"mode": "name"
},
"options": {},
"filtersUI": {
"values": [
{
"lookupColumn": "order_id",
"lookupValue": "={{ $('Read status').item.json.order_id }}"
}
]
}
},
"id": "47157a09-bfe3-4e1d-a09c-20a04769de30",
"name": "Find customer",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
1200,
0
]
},
{
"parameters": {
"operation": "sendTemplate",
"phoneNumberId": "YOUR_PHONE_NUMBER_ID",
"recipientPhoneNumber": "={{ String($json.phone).replace(/[^0-9]/g, '') }}",
"template": "YOUR_REVIEW_TEMPLATE|ar",
"components": {
"component": [
{
"type": "body",
"bodyParameters": {
"parameter": [
{
"type": "text",
"text": "={{ $json.customer || 'عميلنا العزيز' }}"
},
{
"type": "text",
"text": "https://YOUR_REVIEW_LINK"
}
]
}
}
]
}
},
"id": "47157a09-bfe3-4e1d-a09c-20a04769de30",
"name": "Ask for a review",
"type": "n8n-nodes-base.whatsApp",
"typeVersion": 1,
"position": [
1500,
0
]
}
],
"connections": {
"Bosta update": {
"main": [
[
{
"node": "Read status",
"type": "main",
"index": 0
}
]
]
},
"Read status": {
"main": [
[
{
"node": "Delivered?",
"type": "main",
"index": 0
}
]
]
},
"Delivered?": {
"main": [
[
{
"node": "Wait 2 days",
"type": "main",
"index": 0
}
]
]
},
"Wait 2 days": {
"main": [
[
{
"node": "Find customer",
"type": "main",
"index": 0
}
]
]
},
"Find customer": {
"main": [
[
{
"node": "Ask for a review",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"meta": {
"templateCredsSetupCompleted": false
},
"tags": []
}In Make, create a new scenario and add these modules in order:
- Webhooks › Custom webhook
- Tools › Set variable / Iterator + Array aggregator (same logic as the Code step)
- Filter on the next route: “Delivered?”
- If yesTools › Sleep is limited to minutes — for 2 days, save the item to a Data store and run a second scheduled scenario
- If yesGoogle Sheets › Search Rows (by order_id)
- If yesWhatsApp 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:
- Webhooks by Zapier — Catch Hook
- Code by Zapier — Run JavaScript (paste the code from the Code section)
- Filter by Zapier: “Delivered?”
- If yesDelay by Zapier — Delay For 2 days
- If yesGoogle Sheets — Lookup Spreadsheet Row
- If yesWhatsApp — 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
- Point the review link at Google Maps or your store's review page — wherever reviews help you most.
Related flows
Bosta delivery updates to customers on WhatsApp
Customers get a WhatsApp message when their Bosta shipment is picked up, out for delivery or delivered.
Mark Bosta deliveries as delivered in your sheet
When Bosta delivers an order, its row in your sheet is updated with the status and COD amount.
Create Bosta shipments from paid Shopify orders
Every paid order becomes a Bosta delivery automatically — no more typing addresses.