{
  "name": "Handle WhatsApp course enrollment and payments with Wati and Razorpay",
  "nodes": [
    {
      "id": "94414a4d-4c70-41f0-9e3c-0f6b572c4545",
      "name": "📋 Flow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        -528
      ],
      "parameters": {
        "width": 620,
        "height": 392,
        "content": "## 📚 WhatsApp Course Enrollment & Payment Automation\n\n**How it works:**\n1. Student sends *courses* on WhatsApp → gets a list of available courses\n2. Student sends *enroll <course code>* → gets course "
      }
    },
    {
      "id": "4e437211-1ecc-4e32-8190-df06305684c3",
      "name": "Sticky – Trigger & Route",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        80
      ],
      "parameters": {
        "width": 412,
        "height": 530,
        "content": "### 1️⃣ Trigger & Route\n**WATI Trigger** listens for all incoming WhatsApp messages.\n**Route Message Switch** checks the keyword:\n- `courses` → show course catalogue\n- `enroll <code>` → show course de"
      }
    },
    {
      "id": "3050e692-5b05-4692-95b9-587007819210",
      "name": "Sticky – Catalogue & Enroll",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1184,
        -208
      ],
      "parameters": {
        "width": 880,
        "height": 498,
        "content": "### 2️⃣ Course Catalogue & Enroll Intent\n**Google Sheets – Read Courses** fetches the master course list.\n**Build Catalogue Code** formats all courses into a WhatsApp-friendly list with codes, prices "
      }
    },
    {
      "id": "76a3dbf3-a38a-473c-9888-979374e5e678",
      "name": "Sticky – Payment",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1184,
        320
      ],
      "parameters": {
        "width": 1120,
        "height": 354,
        "content": "### 3️⃣ Payment Link Generation\n**Parse Pay Code** extracts course code + student phone from the message.\n**Sheets – Read Course** fetches price and course name for the code.\n**Razorpay – Create Payme"
      }
    },
    {
      "id": "02da57a8-6c42-4bc8-be49-def53ed7050a",
      "name": "Sticky – Status",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1184,
        704
      ],
      "parameters": {
        "width": 628,
        "height": 308,
        "content": "### 5️⃣ Enrollment Status\n**Sheets – Read Enrollments** fetches all rows for this student's phone.\n**Build Status Code** formats a clean history: course name, status, date and expiry.\n**WATI – Send St"
      }
    },
    {
      "id": "48e98355-d800-491c-857e-e1ddf8417c5d",
      "name": "Route Message",
      "type": "n8n-nodes-base.switch",
      "position": [
        928,
        320
      ]
    },
    {
      "id": "73dc20f1-add7-4078-a090-1c50bb96f2ae",
      "name": "Google Sheets – Read Courses",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1232,
        -48
      ]
    },
    {
      "id": "f506aaa9-d18e-40dc-8edd-d5d66c1bae1f",
      "name": "Build Course Catalogue",
      "type": "n8n-nodes-base.code",
      "position": [
        1440,
        -48
      ]
    },
    {
      "id": "dedf0307-9c54-4437-be7f-06ba1700a5a0",
      "name": "Parse Enroll Intent",
      "type": "n8n-nodes-base.code",
      "position": [
        1232,
        128
      ]
    },
    {
      "id": "4c0b1737-658d-42e4-9209-9d1069aff2ec",
      "name": "Google Sheets – Read Course Detail",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1440,
        128
      ]
    },
    {
      "id": "ee05fc85-e4bc-4e61-aa52-4a2e0277622a",
      "name": "Build Enroll Detail Card",
      "type": "n8n-nodes-base.code",
      "position": [
        1664,
        128
      ]
    },
    {
      "id": "371b0662-841a-4e8b-b69d-1936d037156a",
      "name": "Parse Pay Command",
      "type": "n8n-nodes-base.code",
      "position": [
        1216,
        480
      ]
    },
    {
      "id": "ba5690e8-9a85-4dee-87c0-41192cab98da",
      "name": "Google Sheets – Read Course for Payment",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1392,
        480
      ]
    },
    {
      "id": "04b50ab2-7254-48ca-9807-aae59f265519",
      "name": "Prepare Razorpay Payload",
      "type": "n8n-nodes-base.code",
      "position": [
        1568,
        480
      ]
    },
    {
      "id": "2978187b-5374-429e-be9b-144cd5aab500",
      "name": "Razorpay – Create Payment Link",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1744,
        480
      ]
    },
    {
      "id": "2703d441-b8c1-4c2c-b961-89759aa7662b",
      "name": "Google Sheets – Log Pending Enrollment",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1920,
        480
      ]
    },
    {
      "id": "05c70fca-fc54-4f64-843d-2963af2ce12e",
      "name": "Google Sheets – Read Enrollments",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1216,
        816
      ]
    },
    {
      "id": "cefc9436-56a5-42e1-8a42-94cbb2d08610",
      "name": "Build Enrollment Status",
      "type": "n8n-nodes-base.code",
      "position": [
        1408,
        816
      ]
    },
    {
      "id": "2207fe23-d8f7-4be6-a8a0-a0e2af757db1",
      "name": "Send a text message",
      "type": "n8n-nodes-wati.wati",
      "position": [
        1680,
        -48
      ]
    },
    {
      "id": "5d28bb5a-cd67-4bfd-bc44-e40d8d28b049",
      "name": "Send a text message1",
      "type": "n8n-nodes-wati.wati",
      "position": [
        1872,
        128
      ]
    },
    {
      "id": "1923700f-aded-41ac-9577-316b060661ca",
      "name": "Send a text message2",
      "type": "n8n-nodes-wati.wati",
      "position": [
        2112,
        480
      ]
    },
    {
      "id": "9f93ad64-fa9c-4fa3-a2c1-85982a058bd1",
      "name": "Send a text message3",
      "type": "n8n-nodes-wati.wati",
      "position": [
        1616,
        816
      ]
    },
    {
      "id": "597bb20e-c39e-4c2e-a8e8-ada8b96bf3b8",
      "name": "Wati Trigger",
      "type": "n8n-nodes-wati.watiTrigger",
      "position": [
        720,
        368
      ]
    }
  ],
  "connections": {
    "Wati Trigger": {
      "main": [
        [
          {
            "node": "Route Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Message": {
      "main": [
        [
          {
            "node": "Google Sheets – Read Courses",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Parse Enroll Intent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Parse Pay Command",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Google Sheets – Read Enrollments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Pay Command": {
      "main": [
        [
          {
            "node": "Google Sheets – Read Course for Payment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Enroll Intent": {
      "main": [
        [
          {
            "node": "Google Sheets – Read Course Detail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Course Catalogue": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Enrollment Status": {
      "main": [
        [
          {
            "node": "Send a text message3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Enroll Detail Card": {
      "main": [
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Razorpay Payload": {
      "main": [
        [
          {
            "node": "Razorpay – Create Payment Link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets – Read Courses": {
      "main": [
        [
          {
            "node": "Build Course Catalogue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Razorpay – Create Payment Link": {
      "main": [
        [
          {
            "node": "Google Sheets – Log Pending Enrollment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets – Read Enrollments": {
      "main": [
        [
          {
            "node": "Build Enrollment Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets – Read Course Detail": {
      "main": [
        [
          {
            "node": "Build Enroll Detail Card",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets – Log Pending Enrollment": {
      "main": [
        [
          {
            "node": "Send a text message2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets – Read Course for Payment": {
      "main": [
        [
          {
            "node": "Prepare Razorpay Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}