{
  "name": "School Attendance Tracking + Parent Alerts Automation",
  "nodes": [
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1B1NGSwWUdIGG8mRgkqFC5o492UqM0WcG2yVyxt7-UQI",
          "mode": "list",
          "cachedResultName": "Attendance Tracking + Parent Alerts",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B1NGSwWUdIGG8mRgkqFC5o492UqM0WcG2yVyxt7-UQI/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Students",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B1NGSwWUdIGG8mRgkqFC5o492UqM0WcG2yVyxt7-UQI/edit#gid=0"
        },
        "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": "31c862b1-c869-484f-917a-849590f1508f",
      "name": "Lookup Parent Contact",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "WdaCQmtoNquNSoAA",
          "name": "Suresh_Google Sheets"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// // =======================\n// // AUTO TODAY DATE (IST)\n// // =======================\n// const nowIST = new Date(\n//   new Date().toLocaleString(\"en-US\", { timeZone: \"Asia/Kolkata\" })\n// );\n\n// const yyyy = nowIST.getFullYear();\n// const mm = String(nowIST.getMonth() + 1).padStart(2, \"0\");\n// const dd = String(nowIST.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/74jWib3qDpKgpC4P7\";\n\n// // =======================\n// // BUILD WHATSAPP MESSAGE\n// // =======================\n// const message =\n// `🏫 *Sarswati Vidyalaya*\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 (IST)\n// =======================\nconst nowIST = new Date(\n  new Date().toLocaleString(\"en-US\", { timeZone: \"Asia/Kolkata\" })\n);\n\nconst yyyy = nowIST.getFullYear();\nconst mm = String(nowIST.getMonth() + 1).padStart(2, \"0\");\nconst dd = String(nowIST.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/74jWib3qDpKgpC4P7\";\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`🏫 *Sarswati Vidyalaya*\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": "2de9c79d-e26b-4935-8a4d-95c51ded8dc1",
      "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": "82d6b145-cb05-4677-be6d-94ad9a108f4b",
      "name": "Send WhatsApp Alert",
      "credentials": {
        "twilioApi": {
          "id": "vTM9zbcO5mzo9dps",
          "name": "Twilio account 3"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1B1NGSwWUdIGG8mRgkqFC5o492UqM0WcG2yVyxt7-UQI",
          "mode": "list",
          "cachedResultName": "Attendance Tracking + Parent Alerts",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B1NGSwWUdIGG8mRgkqFC5o492UqM0WcG2yVyxt7-UQI/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 817069560,
          "mode": "list",
          "cachedResultName": "Attendance",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B1NGSwWUdIGG8mRgkqFC5o492UqM0WcG2yVyxt7-UQI/edit#gid=817069560"
        },
        "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": "1a3088ea-0bfd-4786-a436-76b0c39cc068",
      "name": "Update Notification Status",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "WdaCQmtoNquNSoAA",
          "name": "Suresh_Google Sheets"
        }
      }
    },
    {
      "parameters": {
        "content": "## WF-01 | Daily Absent Alert",
        "width": 336
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -336,
        176
      ],
      "id": "46e988f5-fdfc-404e-81ed-d4221ca8fa66",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Google Sheet\nhttps://docs.google.com/spreadsheets/d/1B1NGSwWUdIGG8mRgkqFC5o492UqM0WcG2yVyxt7-UQI/edit?usp=sharing\n## Google Form\n## Attendance\nhttps://docs.google.com/forms/d/e/1FAIpQLSfeUX7GjSU1yn5RTn_mnC7NGi5ibFJTvdiB8JI5PG3Z8eOu-A/viewform\n## Reason collect\nhttps://forms.gle/74jWib3qDpKgpC4P7",
        "height": 288,
        "width": 464
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -864,
        240
      ],
      "id": "034b3e90-1695-44db-b094-5d8fe10838f7",
      "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": "ce9f07a8-810e-4784-afea-cf8753ff2333",
      "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": "f361ff72-644d-46ba-8b54-03eb11dccca1",
      "name": "Check Absent Status"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -144,
        240
      ],
      "id": "c5fca95c-62a7-4620-861a-ff27d0e644f2",
      "name": "Loop Attendance Data"
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "documentId": {
          "__rl": true,
          "value": "1B1NGSwWUdIGG8mRgkqFC5o492UqM0WcG2yVyxt7-UQI",
          "mode": "list",
          "cachedResultName": "Attendance Tracking + Parent Alerts",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B1NGSwWUdIGG8mRgkqFC5o492UqM0WcG2yVyxt7-UQI/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 817069560,
          "mode": "list",
          "cachedResultName": "Attendance",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B1NGSwWUdIGG8mRgkqFC5o492UqM0WcG2yVyxt7-UQI/edit#gid=817069560"
        },
        "event": "rowAdded",
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "typeVersion": 1,
      "position": [
        -336,
        240
      ],
      "id": "3d720ec6-41da-49d2-a84f-0bbcb71baf5d",
      "name": "Trigger New Attendance Add",
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "id": "rZ2gM5fVqsChvwb9",
          "name": "Suresh_Google Sheets Trigger"
        }
      }
    },
    {
      "parameters": {
        "content": "## WF-02 | Attendance Google Form Create",
        "height": 176,
        "width": 352
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -336,
        480
      ],
      "id": "947c697f-124d-48f1-9bc1-a5e370879ce5",
      "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": "6410e1fa-148d-4d9a-96dc-50f1b4f51fc4",
      "name": "Add Student Data",
      "credentials": {
        "googleOAuth2Api": {
          "id": "a1SSZdhXr5t4sS1l",
          "name": "Google account 2"
        }
      }
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -336,
        560
      ],
      "id": "6bec4ed2-f18b-421a-b663-0588c47ab0b5",
      "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": "b54d3bc2-d713-45ab-963e-40a7cf4fcff3",
      "name": "Create Form",
      "credentials": {
        "httpHeaderAuth": {
          "id": "5mPIC9gzJpkIdESq",
          "name": "PI API"
        },
        "googleOAuth2Api": {
          "id": "a1SSZdhXr5t4sS1l",
          "name": "Google account 2"
        }
      }
    }
  ],
  "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": "822e049b-cfb4-4844-be84-ce3fd3e1a3d1",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "9272721148ea09184b6bbb7ce6219dab088562dd450e2df8280d57c2e34c7d84"
  },
  "id": "TaHgaMUhPa8FBqaV-2pIJ",
  "tags": []
}