{
  "name": "Send WooCommerce discount coupons to customers via WhatsApp using Rapiwa API",
  "nodes": [
    {
      "id": "70fcfcfc-a653-4d5b-92db-01951eb416da",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        160,
        224
      ]
    },
    {
      "id": "1830de6f-7291-4150-8d02-3b88bed4a49a",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        688,
        320
      ]
    },
    {
      "id": "2a78cc95-9c6f-484d-913a-de3d708bc35e",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -560,
        208
      ]
    },
    {
      "id": "3a8e2e8e-faa4-4f84-ad98-855f22d74a52",
      "name": "WooCommerce Trigger",
      "type": "n8n-nodes-base.wooCommerceTrigger",
      "position": [
        -1280,
        208
      ]
    },
    {
      "id": "e421bbaa-b283-417d-8dc3-c8715c855518",
      "name": "Clean WhatsApp Number",
      "type": "n8n-nodes-base.code",
      "position": [
        -304,
        224
      ]
    },
    {
      "id": "13e94fe4-66dd-42d2-85a8-e291fb7dee28",
      "name": "Save State of Rows in Verified & Sent",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        672,
        96
      ]
    },
    {
      "id": "bdd3c281-cc39-441c-8275-e0b95390429b",
      "name": "Format WooCommerce Trigger Response Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -1040,
        208
      ]
    },
    {
      "id": "e87d5c95-b176-4062-897d-3eb15bd6c5e1",
      "name": "Get many customers",
      "type": "n8n-nodes-base.wooCommerce",
      "position": [
        -752,
        208
      ]
    },
    {
      "id": "8e804acd-a932-4849-bc42-428c478808cd",
      "name": "Save State of Rows in Unerified & Not sent",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        464,
        320
      ]
    },
    {
      "id": "091ac102-1ec7-4dca-a64e-702e075bb3c3",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        32
      ],
      "parameters": {
        "width": 400,
        "height": 496,
        "content": "## Get All Customers\n- Purpose: Fetches all WooCommerce customer records.\n- Output: Customer list used for messaging\n"
      }
    },
    {
      "id": "395e382a-e3b1-415c-bfcf-efcbc877854d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -80
      ],
      "parameters": {
        "width": 464,
        "height": 608,
        "content": "## Clean WhatsApp Numbers\n- Purpose: Standardizes phone numbers for WhatsApp validation.\n- Removes non-digit characters\n- Example:\n  - Input: `+880-1322-827799`\n  - Output: `8801322827799`\n\n## Verify "
      }
    },
    {
      "id": "a73fd36e-e349-44bd-9bf0-221fd7f22c8d",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -304
      ],
      "parameters": {
        "width": 768,
        "height": 832,
        "content": "## If (Conditional)\n- Purpose: Branch the flow depending on Rapiwa verification.\n\n\n## Send WhatsApp Message (via Rapiwa)\n- Purpose: Sends a personalized WhatsApp coupon message using Rapiwa.\n\n\n## Log "
      }
    },
    {
      "id": "a2b388b8-8055-4008-970a-4c1f82d86c81",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1376,
        -144
      ],
      "parameters": {
        "width": 544,
        "height": 672,
        "content": "## WooCommerce Trigger\n- Purpose: Starts the workflow when a new coupon is created in WooCommerce.\n- How it works:\n  - Listens for the `coupon.created` event\n  - Uses WooCommerce credentials to retrie"
      }
    },
    {
      "id": "d25e8d9c-0c45-4c70-baa8-49d18295a065",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2736,
        -144
      ],
      "parameters": {
        "width": 1328,
        "height": 1776,
        "content": "# Send WooCommerce Discount Coupons to Customers via WhatsApp Using Rapiwa API\n\n## Overview\nThis workflow listens for WooCommerce coupon creation events (coupon.created) and uses customer billing data"
      }
    },
    {
      "id": "fc197945-5c13-4a08-aed9-79cf3d9c3c83",
      "name": "Rapiwa",
      "type": "n8n-nodes-rapiwa.rapiwa",
      "position": [
        -96,
        224
      ]
    },
    {
      "id": "8929aa8f-78c2-4880-8aab-84ae6a3fc064",
      "name": "Rapiwa (send message)",
      "type": "n8n-nodes-rapiwa.rapiwa",
      "position": [
        448,
        96
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Rapiwa (send message)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Save State of Rows in Unerified & Not sent",
            "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": "Clean WhatsApp Number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many customers": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WooCommerce Trigger": {
      "main": [
        [
          {
            "node": "Format WooCommerce Trigger Response Data",
            "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
          }
        ]
      ]
    },
    "Format WooCommerce Trigger Response Data": {
      "main": [
        [
          {
            "node": "Get many customers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save State of Rows in Unerified & Not sent": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}