{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "528f3ada-b35d-42e9-a761-791a3cd5b4ce",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -160
      ],
      "parameters": {
        "height": 280,
        "content": "## Weekly on wednesday"
      },
      "typeVersion": 1
    },
    {
      "id": "a289dc7c-fd19-48ad-b060-71075f816958",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        -160
      ],
      "parameters": {
        "color": 6,
        "width": 180,
        "height": 280,
        "content": "## Check points & riffle vouchers"
      },
      "typeVersion": 1
    },
    {
      "id": "6dd51084-7ba0-4897-b0c8-8e67834f8426",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        -160
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 280,
        "content": "## Send message"
      },
      "typeVersion": 1
    },
    {
      "id": "30c6ed23-5f49-49c9-b0bc-a0d6b4a26c61",
      "name": "Every wednesday at 1 pm",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -240,
        -40
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                3
              ],
              "triggerAtHour": 13
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d62ad8a9-c748-4439-a5db-22ba6b69e25f",
      "name": "Send WhasApp (Weekly Message)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        240,
        -40
      ],
      "parameters": {
        "url": "https://gate.whapi.cloud/messages/text",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"to\": \"{{ $json.WhatsApp_ID }}\",\n  \"body\": \"MESSAGE\"\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            },
            {
              "name": "authorization",
              "value": "Bearer {TOKEN}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2164febb-f9ff-45ff-8f6b-6a1519f5b0fe",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        -160
      ],
      "parameters": {
        "color": 4,
        "width": 720,
        "height": 640,
        "content": "## Scheduled Trigger:\nEvery Wednesday at 1 pm, the workflow is automatically triggered.\n\n## Fetch User Data:\nThe workflow retrieves all user records from the \"WhatsApp Engagement Database\" in Airtable. Each record contains the user\u2019s WhatsApp ID, current points, and the number of raffle vouchers.\n\n## Personalized Message Preparation:\nFor each user, a personalized WhatsApp message is prepared. The message includes:\n\nThe user\u2019s current point total\n\nThe number of raffle vouchers they have for the week\n\nEncouragement to keep engaging for more chances to win\n\nInformation about the weekly raffle and available prizes\n\n## Send WhatsApp Message:\nThe workflow sends this personalized message to each user via the Whapi API, using their WhatsApp ID.\n\n## Result:\nEvery active user receives a weekly update about their engagement status, raffle tickets, and a motivational message to encourage further participation. This helps boost engagement and keeps users informed about their progress and chances in the weekly raffle."
      },
      "typeVersion": 1
    },
    {
      "id": "a989e633-9e8e-41f6-af3b-8107f1906742",
      "name": "Search records",
      "type": "n8n-nodes-base.airtable",
      "position": [
        0,
        -40
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appREiqyOxTYwsigc",
          "cachedResultUrl": "https://airtable.com/appREiqyOxTYwsigc",
          "cachedResultName": "WhatsApp Engagement Database"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblIf7YbtyvUvDNm0",
          "cachedResultUrl": "https://airtable.com/appREiqyOxTYwsigc/tblIf7YbtyvUvDNm0",
          "cachedResultName": "Table 1"
        },
        "options": {},
        "operation": "search"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "connections": {
    "Search records": {
      "main": [
        [
          {
            "node": "Send WhasApp (Weekly Message)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every wednesday at 1 pm": {
      "main": [
        [
          {
            "node": "Search records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}