{
  "name": "Student Absence WhatsApp Alerts",
  "nodes": [
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1B1NGSwWUdIGG8mRgkqFC5o492UqM0WcG2yVyxt7-UQI",
          "mode": "list",
          "cachedResultName": "Attendance Tracking + Parent Alerts"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Students"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "RollNo",
              "lookupValue": "={{ $json['RollNo'] }}"
            },
            {
              "lookupColumn": "Class",
              "lookupValue": "={{ $json.Class }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        432,
        240
      ],
      "id": "ddd4f259-d4eb-4b10-90a6-75ae079a64bd",
      "name": "Lookup Parent Contact",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "GojUvCMDXbhY8HrB",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// // =======================\n// // AUTO TODAY DATE (ET)\n// // =======================\n// const nowLocal = new Date(\n//   new Date().toLocaleString(\"en-US\", { timeZone: \"America/New_York\" })\n// );\n\n// const yyyy = nowLocal.getFullYear();\n// const mm = String(nowLocal.getMonth() + 1).padStart(2, \"0\");\n// const dd = String(nowLocal.getDate()).padStart(2, \"0\");\n// const todayDate = `${yyyy}-${mm}-${dd}`;\n\n// // =======================\n// // READ DATA FROM FLOW\n// // =======================\n// const data = $json;\n\n// const rollNo = data.RollNo;\n// const className = data.Class;\n// const studentName = data.StudentName || \"Student\";\n// const parentName = data.ParentName || \"Parent\";\n// const parentWhatsApp = data.ParentWhatsApp;\n\n// const formLink = \"https://forms.gle/YOUR-FORM-ID\";\n\n// // =======================\n// // BUILD WHATSAPP MESSAGE\n// // =======================\n// const message =\n// `🏫 *Brookside Academy*\n\n// 📌 *Attendance Update*\n\n// 👨‍👩‍👧‍👦 Dear *${parentName}*,\n// This is to inform you that your child was *ABSENT* today.\n\n// 👦 *Student Name:* ${studentName}\n// 🏫 *Class:* ${className}\n// 🆔 *Roll No:* ${rollNo}\n// 📅 *Date:* ${todayDate}\n// 🚫 *Attendance:* ABSENT\n// 📝 Please submit the reason for absence using the link below:\n// ${formLink}\n\n// 🙏 Thank you.`;\n\n// // =======================\n// // FINAL OUTPUT (FOR WHATSAPP NODE)\n// // =======================\n// return [\n//   {\n//     json: {\n//       Date: todayDate,\n//       RollNo: rollNo,\n//       Class: className,\n//       ParentWhatsApp: parentWhatsApp,\n//       Message: message\n//     }\n//   }\n// ];\n\n\n// =======================\n// AUTO TODAY DATE (ET)\n// =======================\nconst nowLocal = new Date(\n  new Date().toLocaleString(\"en-US\", { timeZone: \"America/New_York\" })\n);\n\nconst yyyy = nowLocal.getFullYear();\nconst mm = String(nowLocal.getMonth() + 1).padStart(2, \"0\");\nconst dd = String(nowLocal.getDate()).padStart(2, \"0\");\nconst todayDate = `${yyyy}-${mm}-${dd}`;\n\n// =======================\n// READ ALL INPUT ITEMS\n// =======================\nconst items = $input.all(); // 🔑 THIS IS THE KEY\n\nconst formLink = \"https://forms.gle/YOUR-FORM-ID\";\n\nconst results = [];\n\n// =======================\n// GENERATE MESSAGE FOR EACH PARENT\n// =======================\nfor (const item of items) {\n  const data = item.json;\n\n  const rollNo = data.RollNo;\n  const className = data.Class;\n  const studentName = data.StudentName || \"Student\";\n  const parentName = data.ParentName || \"Parent\";\n  const parentWhatsApp = data.ParentWhatsApp;\n\n  const message =\n`🏫 *Brookside Academy*\n\n📌 *Attendance Update*\n\n👨‍👩‍👧‍👦 Dear *${parentName}*,\nThis is to inform you that your child was *ABSENT* today.\n\n👦 *Student Name:* ${studentName}\n🏫 *Class:* ${className}\n🆔 *Roll No:* ${rollNo}\n📅 *Date:* ${todayDate}\n🚫 *Attendance:* ABSENT\n📝 Please submit the reason for absence using the link below:\n${formLink}\n\n🙏 Thank you.`;\n\n  results.push({\n    json: {\n      Date: todayDate,\n      ParentWhatsApp: parentWhatsApp,\n      Message: message\n    }\n  });\n}\n\n// =======================\n// RETURN ALL MESSAGES\n// =======================\nreturn results;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        608,
        240
      ],
      "id": "8a56ec5f-9f86-4300-976d-c5895cc0a99c",
      "name": "Build WhatsApp Message"
    },
    {
      "parameters": {
        "from": "+14155238886",
        "to": "=+{{ $json.ParentWhatsApp }}",
        "toWhatsapp": true,
        "message": "={{ $json.Message }}",
        "options": {}
      },
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        784,
        240
      ],
      "id": "feca7023-f992-4493-a398-f45ed21543cc",
      "name": "Send WhatsApp Alert",
      "credentials": {
        "twilioApi": {
          "id": "xmQ7NblKKLEiOZwC",
          "name": "Twilio account"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1B1NGSwWUdIGG8mRgkqFC5o492UqM0WcG2yVyxt7-UQI",
          "mode": "list",
          "cachedResultName": "Attendance Tracking + Parent Alerts"
        },
        "sheetName": {
          "__rl": true,
          "value": 817069560,
          "mode": "list",
          "cachedResultName": "Attendance"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "NotificationStatus": "Sent",
            "SentAt": "={{ $now.format('M/dd/yyyy hh:mma') }}",
            "RowID": "={{ $('Loop Attendance Data').item.json.RowID }}"
          },
          "matchingColumns": [
            "RowID"
          ],
          "schema": [
            {
              "id": "RowID",
              "displayName": "RowID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Timestamp",
              "displayName": "Timestamp",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Attendance Date",
              "displayName": "Attendance Date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Class",
              "displayName": "Class",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Marked By (Teacher Name)",
              "displayName": "Marked By (Teacher Name)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 1",
              "displayName": "Roll No 1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 2",
              "displayName": "Roll No 2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 3",
              "displayName": "Roll No 3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 4",
              "displayName": "Roll No 4",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 5",
              "displayName": "Roll No 5",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 6",
              "displayName": "Roll No 6",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 7",
              "displayName": "Roll No 7",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 8",
              "displayName": "Roll No 8",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 9",
              "displayName": "Roll No 9",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 10",
              "displayName": "Roll No 10",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 11",
              "displayName": "Roll No 11",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 12",
              "displayName": "Roll No 12",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 13",
              "displayName": "Roll No 13",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 14",
              "displayName": "Roll No 14",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 15",
              "displayName": "Roll No 15",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 16",
              "displayName": "Roll No 16",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 17",
              "displayName": "Roll No 17",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 18",
              "displayName": "Roll No 18",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 19",
              "displayName": "Roll No 19",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Roll No 20",
              "displayName": "Roll No 20",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "NotificationStatus",
              "displayName": "NotificationStatus",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "SentAt",
              "displayName": "SentAt",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        960,
        240
      ],
      "id": "42e9bdb2-cea2-41fc-bad3-ced1af08c6ba",
      "name": "Update Notification Status",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "GojUvCMDXbhY8HrB",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "content": "## WF-01 | Daily Absent Alert",
        "width": 336
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -336,
        176
      ],
      "id": "1ff713bd-bcef-44c0-94e1-52a4012ab876",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Google Sheet\nCreate your own spreadsheet with these tabs/columns, then select it in the Google Sheets nodes:\n- **Attendance Tracking + Parent Alerts → Students**: `RollNo`, `Class`\n- **Attendance Tracking + Parent Alerts → Attendance**: `RowID`, `NotificationStatus`, `SentAt`\n## Google Form\n## Attendance\n## Reason collect\nCreate your own Google Form and paste its link where `YOUR-FORM-ID` appears.",
        "height": 288,
        "width": 464
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -864,
        240
      ],
      "id": "3cf7048b-5cd4-4406-8c1b-31353f7055ad",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "jsCode": "const row = $json;\n\n// ---- METADATA ----\nconst date =\n  row[\"Attendance Date\"] ||\n  row[\"Date\"] ||\n  row[\"Attendance_Date\"];\n\nconst className = row[\"Class\"];\nconst markedBy =\n  row[\"Marked By (Teacher Name)\"] ||\n  row[\"Marked By\"] ||\n  \"Unknown\";\n\n// ---- BUILD STUDENT RECORDS ----\nconst results = [];\n\nfor (let i = 1; i <= 20; i++) {\n  const status = row[`Roll No ${i}`];\n\n  // Skip if no value (safety)\n  if (!status) continue;\n\n  results.push({\n    json: {\n      Date: date,\n      RollNo: String(i),          // IMPORTANT: matches Google Sheet column\n      Class: className,\n      Status: status,\n      MarkedBy: markedBy\n    }\n  });\n}\n\nreturn results;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        80,
        256
      ],
      "id": "aa68c1fd-5905-441e-beb9-d965474ca950",
      "name": "Structure Attendance Data"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "5b4e4e5d-823f-412c-85b7-b71a0414ab05",
              "leftValue": "={{ $json.Status }}",
              "rightValue": "Absent",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        256,
        256
      ],
      "id": "839e06e8-ded3-41d8-8777-9aef17fdfd07",
      "name": "Check Absent Status"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -144,
        240
      ],
      "id": "018788b0-a702-4daa-be1c-87c05a687712",
      "name": "Loop Attendance Data"
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "documentId": {
          "__rl": true,
          "value": "1B1NGSwWUdIGG8mRgkqFC5o492UqM0WcG2yVyxt7-UQI",
          "mode": "list",
          "cachedResultName": "Attendance Tracking + Parent Alerts"
        },
        "sheetName": {
          "__rl": true,
          "value": 817069560,
          "mode": "list",
          "cachedResultName": "Attendance"
        },
        "event": "rowAdded",
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "typeVersion": 1,
      "position": [
        -336,
        240
      ],
      "id": "88431b55-cff6-4a19-a545-98c4e0b46a86",
      "name": "Trigger New Attendance Add",
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "id": "aOXWt3By1xBEbBDS",
          "name": "Google Sheets Trigger account"
        }
      }
    },
    {
      "parameters": {
        "content": "## WF-02 | Attendance Google Form Create",
        "height": 176,
        "width": 352
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -336,
        480
      ],
      "id": "f8a3333e-1684-41d9-87f6-5426561a0069",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://forms.googleapis.com/v1/forms/{{ $('Create Form').item.json.formId }}:batchUpdate",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleOAuth2Api",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"requests\": [\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Attendance Date\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"dateQuestion\": {\n                \"includeYear\": true\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 0 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Class\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"DROP_DOWN\",\n                \"options\": [\n                  { \"value\": \"10A\" },\n                  { \"value\": \"10B\" },\n                  { \"value\": \"10C\" }\n                ]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 1 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Marked By (Teacher Name)\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"textQuestion\": {}\n            }\n          }\n        },\n        \"location\": { \"index\": 2 }\n      }\n    },\n\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 1\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 3 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 2\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 4 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 3\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 5 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 4\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 6 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 5\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 7 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 6\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 8 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 7\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 9 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 8\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 10 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 9\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 11 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 10\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 12 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 11\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 13 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 12\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 14 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 13\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 15 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 14\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 16 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 15\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 17 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 16\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 18 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 17\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 19 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 18\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 20 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 19\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 21 }\n      }\n    },\n    {\n      \"createItem\": {\n        \"item\": {\n          \"title\": \"Roll No 20\",\n          \"questionItem\": {\n            \"question\": {\n              \"required\": true,\n              \"choiceQuestion\": {\n                \"type\": \"RADIO\",\n                \"options\": [{ \"value\": \"Present\" }, { \"value\": \"Absent\" }]\n              }\n            }\n          }\n        },\n        \"location\": { \"index\": 22 }\n      }\n    }\n  ]\n} ",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.3,
      "position": [
        48,
        560
      ],
      "id": "f083e731-6bad-46c8-8d60-60bb71f2c172",
      "name": "Add Student Data",
      "credentials": {
        "googleOAuth2Api": {
          "id": "MWa38DNDqpHT7eWr",
          "name": "Google account"
        }
      }
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -336,
        560
      ],
      "id": "bf2f7bf4-9fee-42c8-8398-675c93370d17",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://forms.googleapis.com/v1/forms",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleOAuth2Api",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"info\": {\n    \"title\": \"Daily Attendance Form\",\n    \"documentTitle\": \"Attendance Register\"\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.3,
      "position": [
        -144,
        560
      ],
      "id": "d85651f1-bca9-457d-807e-41250d1bc633",
      "name": "Create Form",
      "credentials": {
        "httpHeaderAuth": {
          "id": "69ilqzcKEgbblIga",
          "name": "Http Header Auth account"
        },
        "googleOAuth2Api": {
          "id": "MWa38DNDqpHT7eWr",
          "name": "Google account"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Lookup Parent Contact": {
      "main": [
        [
          {
            "node": "Build WhatsApp Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build WhatsApp Message": {
      "main": [
        [
          {
            "node": "Send WhatsApp Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send WhatsApp Alert": {
      "main": [
        [
          {
            "node": "Update Notification Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Notification Status": {
      "main": [
        [
          {
            "node": "Loop Attendance Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structure Attendance Data": {
      "main": [
        [
          {
            "node": "Check Absent Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Absent Status": {
      "main": [
        [
          {
            "node": "Lookup Parent Contact",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Attendance Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Attendance Data": {
      "main": [
        [],
        [
          {
            "node": "Structure Attendance Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger New Attendance Add": {
      "main": [
        [
          {
            "node": "Loop Attendance Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Create Form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Form": {
      "main": [
        [
          {
            "node": "Add Student Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "availableInMCP": false
  },
  "versionId": "61158cba-ca81-487b-924f-8a406cd98742",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "f1c26778ec36097a9722a22c47c5e9c01f00b8862dadd0121ec118026a370fa6"
  },
  "id": "OjS2UhUNwDTUrI1o",
  "tags": []
}