Bosta delivery updates to customers on WhatsApp

Customers get a WhatsApp message when their Bosta shipment is picked up, out for delivery or delivered.

Advanced Saves ~10 hours/month MENA & local appsBy Flowngn team

Works with n8n · Make · Zapier

How it works

Trigger: Webhook — Bosta delivery status update
  1. Receive the status update from Bosta.
  2. Turn the state code into a readable Arabic status.
  3. Look up the customer's phone in your Orders sheet by order number.
  4. Send a WhatsApp template with the new status and tracking number.

Diagram

trueBosta updateWebhook{ }Read statusCode⑂Tell customer?IfGFind orderGoogle SheetsWSend status updateWhatsApp Business Cloud
Trigger App Logic Code

Code

JavaScript used in the Code step — already included in the template below.

Read status · Code node
// 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.

Workflow JSON
Show code (208 lines)
{
  "name": "Bosta delivery updates to customers on WhatsApp (Flowngn)",
  "nodes": [
    {
      "parameters": {
        "content": "## Bosta delivery updates to customers on WhatsApp\nCustomers get a WhatsApp message when their Bosta shipment is picked up, out for delivery or delivered.\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": "2de5c18f-5c8e-4bfb-a9ba-9118f6766aee",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "bosta-status",
        "options": {}
      },
      "id": "2de5c18f-5c8e-4bfb-a9ba-9118f6766aee",
      "name": "Bosta update",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "webhookId": "2de5c18f-5c8e-4bfb-a9ba-9118f6766aee"
    },
    {
      "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": "2de5c18f-5c8e-4bfb-a9ba-9118f6766aee",
      "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": "={{ ['progress', 'delivered'].includes($json.kind) }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "2de5c18f-5c8e-4bfb-a9ba-9118f6766aee",
      "name": "Tell customer?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        600,
        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": "={{ $json.order_id }}"
            }
          ]
        }
      },
      "id": "2de5c18f-5c8e-4bfb-a9ba-9118f6766aee",
      "name": "Find order",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        900,
        0
      ]
    },
    {
      "parameters": {
        "operation": "sendTemplate",
        "phoneNumberId": "YOUR_PHONE_NUMBER_ID",
        "recipientPhoneNumber": "={{ String($json.phone).replace(/[^0-9]/g, '') }}",
        "template": "YOUR_SHIPPING_TEMPLATE|ar",
        "components": {
          "component": [
            {
              "type": "body",
              "bodyParameters": {
                "parameter": [
                  {
                    "type": "text",
                    "text": "={{ $json.customer || 'عميلنا العزيز' }}"
                  },
                  {
                    "type": "text",
                    "text": "={{ $('Read status').item.json.status_ar }}"
                  },
                  {
                    "type": "text",
                    "text": "={{ $('Read status').item.json.tracking }}"
                  }
                ]
              }
            }
          ]
        }
      },
      "id": "2de5c18f-5c8e-4bfb-a9ba-9118f6766aee",
      "name": "Send status update",
      "type": "n8n-nodes-base.whatsApp",
      "typeVersion": 1,
      "position": [
        1200,
        0
      ]
    }
  ],
  "connections": {
    "Bosta update": {
      "main": [
        [
          {
            "node": "Read status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read status": {
      "main": [
        [
          {
            "node": "Tell customer?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tell customer?": {
      "main": [
        [
          {
            "node": "Find order",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find order": {
      "main": [
        [
          {
            "node": "Send status update",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

Open in the playground to edit →

Tips

  • Set your order number as the business reference when creating Bosta deliveries.
  • Pass the webhook URL to Bosta (in your delivery requests or account settings).

Related flows