{
  "name": "Track student attendance from CSV, email parents, and build an HTML dashboard",
  "nodes": [
    {
      "id": "c933a392-8c2b-48b3-8757-ba850ab7537d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -384,
        -288
      ],
      "parameters": {
        "width": 500,
        "height": 620,
        "content": "## How it works\n\n1. Runs every weekday at 17:30 (Mon–Fri)\n2. Reads `student_attendance.csv` and filters to today's records only\n3. Splits students into Absent / Present branches\n4. Fetches parent cont"
      }
    },
    {
      "id": "88bd7eff-365a-4891-be99-43f6c9235d0b",
      "name": "Group Trigger Ingestion",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        -208
      ],
      "parameters": {
        "width": 860,
        "height": 420,
        "content": "## Trigger & data ingestion\n\nSchedule trigger reads attendance CSV and filters to today's records only."
      }
    },
    {
      "id": "254b824c-29fa-422d-82bf-d8288543cbd6",
      "name": "Group Routing Merge",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        -208
      ],
      "parameters": {
        "width": 798,
        "height": 424,
        "content": "## Absence routing & contact merge\n\nSplits absent vs present students, fetches parent contacts, and merges records."
      }
    },
    {
      "id": "9e76a543-d8ac-4906-aea1-1b4023a783f4",
      "name": "Group Alert Logic",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1856,
        -208
      ],
      "parameters": {
        "width": 244,
        "height": 416,
        "content": "## Alert logic\n\nCalculates risk level, attendance %, streak, and trend per student."
      }
    },
    {
      "id": "9dd75633-cd8e-4f97-bb65-6b27c32c937f",
      "name": "Group Notifications",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2144,
        -304
      ],
      "parameters": {
        "width": 494,
        "height": 272,
        "content": "## Parent notifications\n\nGenerates and sends a colour-coded HTML email alert to parents via SMTP."
      }
    },
    {
      "id": "66e18686-7781-48d3-8485-2f0e87fc11a6",
      "name": "Group No Absence",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2144,
        336
      ],
      "parameters": {
        "width": 276,
        "height": 274,
        "content": "## No absences branch\n\nSkips email and dashboard when all students are present today."
      }
    },
    {
      "id": "0d8e0e33-ad19-4222-967e-54b92efa97fc",
      "name": "No Absences Today",
      "type": "n8n-nodes-base.code",
      "position": [
        2224,
        480
      ]
    },
    {
      "id": "7b23422e-e7d0-4c55-8eac-429ddc56ad26",
      "name": "Recurring Time Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        192,
        32
      ]
    },
    {
      "id": "68e30462-a058-4c61-874b-530275978305",
      "name": "Student Attendance Data",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        416,
        32
      ]
    },
    {
      "id": "6f5f6070-20b2-4632-8943-80c8fd93b25f",
      "name": "Extract Attendance CSV",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        640,
        32
      ]
    },
    {
      "id": "cb8c1959-cfa0-4d31-8439-2241bb9beedb",
      "name": "IF: Is Absent?",
      "type": "n8n-nodes-base.if",
      "position": [
        1072,
        32
      ]
    },
    {
      "id": "f83c1d55-22ad-48d1-b3cd-40fc2ed447e7",
      "name": "Students Contacts",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        1264,
        -96
      ]
    },
    {
      "id": "e8d3f1a6-94c3-49ac-b127-20c964159826",
      "name": "Extract Contacts CSV",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        1488,
        -96
      ]
    },
    {
      "id": "06f4be2e-c00e-4314-a136-3364515a3340",
      "name": "Merge Absent + Contacts",
      "type": "n8n-nodes-base.merge",
      "position": [
        1696,
        32
      ]
    },
    {
      "id": "8bc30b58-a119-4bba-9683-24807367b66e",
      "name": "Alert Logic Block",
      "type": "n8n-nodes-base.code",
      "position": [
        1920,
        32
      ]
    },
    {
      "id": "bc63d2c7-c79c-4bd7-8484-d52a3e6d4a66",
      "name": "Generate Absence Email",
      "type": "n8n-nodes-base.code",
      "position": [
        2192,
        -176
      ]
    },
    {
      "id": "30e57f21-7296-4684-ba90-0ac805470287",
      "name": "Build Dashboard and Report",
      "type": "n8n-nodes-base.code",
      "position": [
        2192,
        112
      ]
    },
    {
      "id": "4f2aa786-1404-4dc3-8687-02efe7edcc59",
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2416,
        -176
      ]
    },
    {
      "id": "5c53845e-9b24-464e-abb2-5eb14c97fb4c",
      "name": "Existing Report History",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        2544,
        112
      ]
    },
    {
      "id": "3b86af26-3c7e-446f-b57f-e44bf6f6a34e",
      "name": "Extract History CSV",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        2752,
        112
      ]
    },
    {
      "id": "c9b04d9b-6bbd-48d1-84a8-204f9bd50571",
      "name": "Combine History + Build Dashboard",
      "type": "n8n-nodes-base.code",
      "position": [
        2976,
        112
      ]
    },
    {
      "id": "1f31fd3e-db8e-42be-8611-da4c07a1d242",
      "name": "Convert Data",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        3200,
        112
      ]
    },
    {
      "id": "54ee6850-a6eb-47d4-bcc5-fa44250fc0a9",
      "name": "Build Visual Report and Update Attendance File",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        3456,
        112
      ]
    },
    {
      "id": "56a26d48-b722-4c8a-bfa7-4d0825be0489",
      "name": "Date Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        848,
        32
      ]
    },
    {
      "id": "3913a364-a32c-4ed9-ac13-2095138266fc",
      "name": "Group Dashboard Report",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2144,
        0
      ],
      "parameters": {
        "width": 1506,
        "height": 324,
        "content": "## Dashboard & report update\n\nBuilds interactive HTML dashboard and appends today's records to attendance history CSV."
      }
    }
  ],
  "connections": {
    "Date Filter": {
      "main": [
        [
          {
            "node": "IF: Is Absent?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Data": {
      "main": [
        [
          {
            "node": "Build Visual Report and Update Attendance File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF: Is Absent?": {
      "main": [
        [
          {
            "node": "Students Contacts",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Absent + Contacts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Absences Today",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Alert Logic Block": {
      "main": [
        [
          {
            "node": "Generate Absence Email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Build Dashboard and Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No Absences Today": {
      "main": [
        [
          {
            "node": "Existing Report History",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Students Contacts": {
      "main": [
        [
          {
            "node": "Extract Contacts CSV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract History CSV": {
      "main": [
        [
          {
            "node": "Combine History + Build Dashboard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Contacts CSV": {
      "main": [
        [
          {
            "node": "Merge Absent + Contacts",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Extract Attendance CSV": {
      "main": [
        [
          {
            "node": "Date Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Absence Email": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recurring Time Trigger": {
      "main": [
        [
          {
            "node": "Student Attendance Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Existing Report History": {
      "main": [
        [
          {
            "node": "Extract History CSV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Absent + Contacts": {
      "main": [
        [
          {
            "node": "Alert Logic Block",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Student Attendance Data": {
      "main": [
        [
          {
            "node": "Extract Attendance CSV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Dashboard and Report": {
      "main": [
        [
          {
            "node": "Existing Report History",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine History + Build Dashboard": {
      "main": [
        [
          {
            "node": "Convert Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}