{
  "name": "Send Rapiwa WhatsApp apology & reorder link when Shopify order is cancelled",
  "nodes": [
    {
      "id": "19ca882d-78dd-42f7-b57b-d10f46d4ec56",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        -1104,
        544
      ]
    },
    {
      "id": "c02ef42f-6092-4893-baf3-999228b07085",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1328,
        528
      ]
    },
    {
      "id": "ed565cef-4455-4f18-a9c1-316d94ef2c65",
      "name": "Shopify Trigger",
      "type": "n8n-nodes-base.shopifyTrigger",
      "position": [
        -1520,
        528
      ]
    },
    {
      "id": "4fb74742-5ee8-4a75-884d-311023a8a267",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -80,
        544
      ]
    },
    {
      "id": "35b0be87-6a5a-46da-bd70-35a73d80a373",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        352,
        640
      ]
    },
    {
      "id": "ddf47009-eef3-452c-ad02-ea18dfa9d171",
      "name": "Clean WhatsApp Number",
      "type": "n8n-nodes-base.code",
      "position": [
        -688,
        544
      ]
    },
    {
      "id": "95654791-084f-4847-babe-13685c2c45ee",
      "name": "Save State of Rows in Verified & Sent",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        336,
        416
      ]
    },
    {
      "id": "b2612612-56b2-47d3-ac2b-24bbae46b23a",
      "name": "Save State of Rows in Verified & Sent1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        128,
        640
      ]
    },
    {
      "id": "df643747-05d9-4101-bdcf-a53eb3d20045",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2720,
        96
      ],
      "parameters": {
        "width": 1072,
        "height": 1536,
        "content": "# Send WhatsApp Apology & Reorder Link When Shopify Order is Cancelled\n\n## Overview\nThis **n8n workflow** listens for order cancellations in Shopify, extracts relevant customer and order data, checks "
      }
    },
    {
      "id": "a9e35272-f2c6-4785-9610-2269ffb3276c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        96
      ],
      "parameters": {
        "width": 656,
        "height": 752,
        "content": "## Shopify Trigger (Order Cancelled)\n**Purpose:** Starts the workflow whenever an order is cancelled in Shopify  \n**How it works:**  \n- Listens to the Shopify webhook for order cancellation events  \n-"
      }
    },
    {
      "id": "20ec2d81-8006-417d-92b5-668993d0586e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -928,
        208
      ],
      "parameters": {
        "width": 720,
        "height": 640,
        "content": "## Code (Clean WhatsApp Number)\n**Purpose:** Formats and sanitizes the customer phone number for WhatsApp usage\n**It works:** Removes all non-digit characters (spaces, dashes, parentheses)  \n\n## HTTP "
      }
    },
    {
      "id": "6f87f286-0aad-46a2-aef3-15a4b8e99fd6",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -160
      ],
      "parameters": {
        "width": 912,
        "height": 1008,
        "content": "## IF\n**Purpose:** Routes the workflow depending on WhatsApp number verification result `verified` or `unverified` number\n\n\n## HTTP Request (Send WhatsApp Message via Rapiwa)\n**Purpose:** Sends a pers"
      }
    },
    {
      "id": "ed95aab3-098c-4f38-ae39-0e469b3894aa",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        896
      ],
      "parameters": {
        "width": 560,
        "height": 432,
        "content": "## How to Use This Workflow\n### Step 1: Set Up Credentials\nAdd **Shopify**, **Google Sheets OAuth2**, and **Rapiwa Token** credentials in n8n.\n\n### Step 2: Prepare Google Sheet\n- Create a new Google S"
      }
    },
    {
      "id": "f24902f4-c503-4844-b022-c1005adfe689",
      "name": "Rapiwa",
      "type": "n8n-nodes-rapiwa.rapiwa",
      "position": [
        -480,
        544
      ]
    },
    {
      "id": "fde3fe4b-a404-4847-b8ce-7868eb71875f",
      "name": "Rapiwa (send message)",
      "type": "n8n-nodes-rapiwa.rapiwa",
      "position": [
        128,
        416
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Rapiwa (send message)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Save State of Rows in Verified & Sent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Clean WhatsApp Number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rapiwa": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Shopify Trigger": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean WhatsApp Number": {
      "main": [
        [
          {
            "node": "Rapiwa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rapiwa (send message)": {
      "main": [
        [
          {
            "node": "Save State of Rows in Verified & Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save State of Rows in Verified & Sent": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save State of Rows in Verified & Sent1": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}