AutomationFlowsSlack & Telegram › Track Employee Attendance with Analytics, Email Reports & Slack Alerts Using…

Track Employee Attendance with Analytics, Email Reports & Slack Alerts Using…

Original n8n title: Track Employee Attendance with Analytics, Email Reports & Slack Alerts Using Google Sheets

ByOneclick AI Squad @oneclick-ai on n8n.io

Transform your attendance management with this enterprise-grade automated workflow featuring AI-powered analytics, multi-dimensional insights, and intelligent alerting. Running hourly, it integrates multiple data sources (attendance logs + employee master data), performs…

Cron / scheduled trigger★★★★☆ complexity15 nodesGoogle SheetsEmail SendSlack
Slack & Telegram Trigger: Cron / scheduled Nodes: 15 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #10106 — we link there as the canonical source.

This workflow follows the Emailsend → Google Sheets recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "QaExWEuXV0wzelZO",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Employee Attendance Tracker with Daily Summary",
  "tags": [],
  "nodes": [
    {
      "id": "0e4bdcc5-f1e5-4bcd-8ebb-9345a564c334",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1440,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5f2a24aa-5e38-4296-8071-0c7630cc61fc",
      "name": "Fetch Attendance Records",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1216,
        -96
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "AttendanceLogs"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_ATTENDANCE_SPREADSHEET_ID"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0d136a8a-09d5-41bc-a74f-fe6e14a5686a",
      "name": "Fetch Employee Master Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1216,
        96
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Employees"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_EMPLOYEE_SPREADSHEET_ID"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "7a72aa69-8c3d-472c-86d6-b04b4dfa0913",
      "name": "Analytics Engine",
      "type": "n8n-nodes-base.code",
      "position": [
        -992,
        0
      ],
      "parameters": {
        "jsCode": "const attendanceData = $('Fetch Attendance Records').all();\nconst employeeData = $('Fetch Employee Master Data').all();\nconst now = new Date();\nconst today = now.toISOString().split('T')[0];\nconst currentHour = now.getHours();\n\nconst employeeMap = {};\nemployeeData.forEach(emp => {\n  employeeMap[emp.json.EmployeeID] = {\n    name: emp.json.EmployeeName,\n    department: emp.json.Department,\n    manager: emp.json.Manager,\n    shift: emp.json.Shift || 'Day',\n    email: emp.json.Email\n  };\n});\n\nconst todayRecords = attendanceData.filter(item => item.json.Date === today);\n\nconst statusCount = {\n  present: 0,\n  absent: 0,\n  late: 0,\n  leave: 0,\n  wfh: 0\n};\n\nconst statusLists = {\n  late: [],\n  absent: [],\n  wfh: []\n};\n\nconst deptMetrics = {};\n\ntodayRecords.forEach(record => {\n  const empId = record.json.EmployeeID;\n  const status = record.json.Status;\n  const checkIn = record.json.CheckInTime;\n  const employee = employeeMap[empId];\n  \n  if (!employee) return;\n  \n  const dept = employee.department;\n  if (!deptMetrics[dept]) {\n    deptMetrics[dept] = { present: 0, absent: 0, late: 0, total: 0 };\n  }\n  \n  deptMetrics[dept].total++;\n  \n  switch(status) {\n    case 'Present':\n      statusCount.present++;\n      deptMetrics[dept].present++;\n      break;\n    case 'Absent':\n      statusCount.absent++;\n      deptMetrics[dept].absent++;\n      statusLists.absent.push({ name: employee.name, department: dept, manager: employee.manager });\n      break;\n    case 'Late':\n      statusCount.late++;\n      deptMetrics[dept].late++;\n      statusLists.late.push({ name: employee.name, department: dept, checkIn: checkIn || 'N/A', lateBy: '15 min' });\n      break;\n    case 'Leave':\n      statusCount.leave++;\n      break;\n    case 'WFH':\n      statusCount.wfh++;\n      statusLists.wfh.push({ name: employee.name, department: dept });\n      break;\n  }\n});\n\nconst totalEmployees = Object.keys(employeeMap).length;\nconst activeEmployees = statusCount.present + statusCount.absent + statusCount.late;\nconst attendanceRate = activeEmployees > 0 ? ((statusCount.present + statusCount.late) / activeEmployees * 100).toFixed(2) : 0;\nconst punctualityRate = (statusCount.present + statusCount.late) > 0 ? (statusCount.present / (statusCount.present + statusCount.late) * 100).toFixed(2) : 0;\n\nconst alerts = [];\nif (statusCount.late > totalEmployees * 0.1) {\n  alerts.push({ type: 'warning', severity: 'medium', message: `High tardiness: ${statusCount.late} employees late`, action: 'Review shift timings' });\n}\n\nif (statusCount.absent > totalEmployees * 0.15) {\n  alerts.push({ type: 'alert', severity: 'high', message: `High absence rate: ${statusCount.absent} employees absent`, action: 'Investigate issues' });\n}\n\nreturn {\n  date: today,\n  timestamp: now.toISOString(),\n  hour: currentHour,\n  totalEmployees: totalEmployees,\n  recordsProcessed: todayRecords.length,\n  present: statusCount.present,\n  absent: statusCount.absent,\n  late: statusCount.late,\n  onLeave: statusCount.leave,\n  wfh: statusCount.wfh,\n  attendanceRate: parseFloat(attendanceRate),\n  punctualityRate: parseFloat(punctualityRate),\n  absenteeismRate: parseFloat(((statusCount.absent / totalEmployees) * 100).toFixed(2)),\n  lateEmployees: statusLists.late,\n  absentEmployees: statusLists.absent,\n  wfhEmployees: statusLists.wfh,\n  departmentBreakdown: deptMetrics,\n  alerts: alerts,\n  alertCount: alerts.length,\n  hasHighPriorityAlerts: alerts.some(a => a.severity === 'high'),\n  shouldNotifyManagement: alerts.length > 0 || statusCount.absent > 5\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "7651642d-6966-49bd-b503-7b57369026d2",
      "name": "Records Available",
      "type": "n8n-nodes-base.if",
      "position": [
        -768,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "number": [
            {
              "value1": "={{ $json.recordsProcessed }}",
              "value2": 0,
              "operation": "larger"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "bc5e3d2a-5946-4223-af9a-696f54b79828",
      "name": "Critical Alerts",
      "type": "n8n-nodes-base.if",
      "position": [
        -544,
        -192
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "boolean": [
            {
              "value1": "={{ $json.shouldNotifyManagement }}",
              "value2": true
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "36732aa7-c12f-4af0-acfe-e94b4f64b5ca",
      "name": "Format Email",
      "type": "n8n-nodes-base.code",
      "position": [
        -320,
        -192
      ],
      "parameters": {
        "jsCode": "const data = $input.first().json;\n\nconst alertsHtml = data.alerts.length > 0 ? `\n  <div style=\"background: #fff3cd; border-left: 4px solid #ffc107; padding: 15px; margin: 20px 0;\">\n    <h3 style=\"color: #856404; margin-top: 0;\">\u26a0\ufe0f Alerts</h3>\n    ${data.alerts.map(alert => `<div style=\"margin: 10px 0;\"><strong>${alert.severity.toUpperCase()}</strong>: ${alert.message}</div>`).join('')}\n  </div>\n` : '';\n\nconst emailHtml = `\n<html>\n<body style=\"font-family: Arial, sans-serif; padding: 20px;\">\n  <div style=\"background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px; text-align: center;\">\n    <h1>\ud83d\udcca Daily Attendance Report</h1>\n    <p>${data.date} \u2022 ${data.hour}:00</p>\n  </div>\n  <div style=\"padding: 20px;\">\n    ${alertsHtml}\n    <div style=\"display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 20px 0;\">\n      <div style=\"background: #e8f5e9; padding: 20px; text-align: center;\">\n        <div style=\"font-size: 32px; font-weight: bold; color: #2e7d32;\">${data.present}</div>\n        <div>\u2705 Present</div>\n      </div>\n      <div style=\"background: #fff3e0; padding: 20px; text-align: center;\">\n        <div style=\"font-size: 32px; font-weight: bold; color: #e65100;\">${data.late}</div>\n        <div>\u23f0 Late</div>\n      </div>\n      <div style=\"background: #ffebee; padding: 20px; text-align: center;\">\n        <div style=\"font-size: 32px; font-weight: bold; color: #c62828;\">${data.absent}</div>\n        <div>\u274c Absent</div>\n      </div>\n      <div style=\"background: #e3f2fd; padding: 20px; text-align: center;\">\n        <div style=\"font-size: 32px; font-weight: bold; color: #1565c0;\">${data.onLeave}</div>\n        <div>\ud83c\udfd6\ufe0f Leave</div>\n      </div>\n    </div>\n    <h3>\ud83d\udcc8 Key Metrics</h3>\n    <p><strong>Attendance Rate:</strong> ${data.attendanceRate}%</p>\n    <p><strong>Punctuality Rate:</strong> ${data.punctualityRate}%</p>\n    <p><strong>Total Employees:</strong> ${data.totalEmployees}</p>\n  </div>\n</body>\n</html>\n`;\n\nreturn {\n  ...data,\n  emailHtml: emailHtml,\n  emailSubject: `${data.hasHighPriorityAlerts ? '\ud83d\udea8 URGENT: ' : '\ud83d\udcca'} Attendance Report - ${data.date}`\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "c6b97279-622c-479a-94b9-7591ac89b885",
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -96,
        -192
      ],
      "parameters": {
        "options": {},
        "subject": "={{ $json.emailSubject }}",
        "toEmail": "user@example.com",
        "fromEmail": "user@example.com"
      },
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "674e5e0a-3f26-4980-be64-aeaf1cdc4b48",
      "name": "Format Slack",
      "type": "n8n-nodes-base.code",
      "position": [
        -544,
        0
      ],
      "parameters": {
        "jsCode": "const data = $input.first().json;\n\nconst lateList = data.lateEmployees.length > 0 ? data.lateEmployees.slice(0, 5).map(e => `\u2022 ${e.name} (${e.department})`).join('\\n') : 'None';\nconst absentList = data.absentEmployees.length > 0 ? data.absentEmployees.slice(0, 5).map(e => `\u2022 ${e.name} (${e.department})`).join('\\n') : 'None';\n\nconst blocks = [\n  {\n    type: \"header\",\n    text: { type: \"plain_text\", text: `\ud83d\udcca Attendance Report - ${data.date}`, emoji: true }\n  },\n  {\n    type: \"section\",\n    fields: [\n      { type: \"mrkdwn\", text: `*\u2705 Present*\\n${data.present}` },\n      { type: \"mrkdwn\", text: `*\u23f0 Late*\\n${data.late}` },\n      { type: \"mrkdwn\", text: `*\u274c Absent*\\n${data.absent}` },\n      { type: \"mrkdwn\", text: `*\ud83c\udfd6\ufe0f Leave*\\n${data.onLeave}` }\n    ]\n  },\n  { type: \"divider\" },\n  {\n    type: \"section\",\n    text: { type: \"mrkdwn\", text: `*\u23f0 Late Arrivals*\\n${lateList}` }\n  },\n  {\n    type: \"section\",\n    text: { type: \"mrkdwn\", text: `*\u274c Absences*\\n${absentList}` }\n  }\n];\n\nreturn { ...data, slackBlocks: blocks };"
      },
      "typeVersion": 2
    },
    {
      "id": "39c44862-38ad-4c32-aa12-c55f1a3d1de6",
      "name": "Post to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        -320,
        0
      ],
      "parameters": {
        "text": "=Daily Attendance Report",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "C12345678"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "69043dab-0525-462b-b2de-12ce885def34",
      "name": "Log Summary",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -544,
        192
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "DailySummary"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_SUMMARY_SPREADSHEET_ID"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b2f9027b-2c48-4e26-b175-081ee2fc73ea",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1472,
        -160
      ],
      "parameters": {
        "color": 3,
        "width": 150,
        "height": 288,
        "content": "Runs hourly to monitor attendance with zero manual effort."
      },
      "typeVersion": 1
    },
    {
      "id": "1cda22e2-28de-40fa-b380-80264166deb3",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1280,
        -224
      ],
      "parameters": {
        "color": 3,
        "width": 416,
        "height": 464,
        "content": "Fetches attendance and employee master data, then merges them for enriched analytics and analyzes attendance, calculates key metrics, detects anomalies, and generates alerts."
      },
      "typeVersion": 1
    },
    {
      "id": "e2fbe0c6-3e13-4509-a6cc-f941376979ae",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        -304
      ],
      "parameters": {
        "color": 3,
        "width": 448,
        "height": 656,
        "content": "Validates data, prioritizes alerts, and routes notifications via email, Slack, and database and logs daily summaries, maintains audit trails, and prepares data for trend analysis dashboards."
      },
      "typeVersion": 1
    },
    {
      "id": "1dbde325-390a-4164-9e64-84f67fc6c1c8",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        -320
      ],
      "parameters": {
        "color": 3,
        "width": 416,
        "height": 464,
        "content": "Sends visually formatted reports with metrics, alerts, and detailed employee breakdowns."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ea71b953-3354-4852-af6f-5708906566fb",
  "connections": {
    "Format Email": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Slack": {
      "main": [
        [
          {
            "node": "Post to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Critical Alerts": {
      "main": [
        [
          {
            "node": "Format Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analytics Engine": {
      "main": [
        [
          {
            "node": "Records Available",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Fetch Attendance Records",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Employee Master Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Records Available": {
      "main": [
        [
          {
            "node": "Critical Alerts",
            "type": "main",
            "index": 0
          },
          {
            "node": "Format Slack",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Attendance Records": {
      "main": [
        [
          {
            "node": "Analytics Engine",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Employee Master Data": {
      "main": [
        [
          {
            "node": "Analytics Engine",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Transform your attendance management with this enterprise-grade automated workflow featuring AI-powered analytics, multi-dimensional insights, and intelligent alerting. Running hourly, it integrates multiple data sources (attendance logs + employee master data), performs…

Source: https://n8n.io/workflows/10106/ — original creator credit. Request a take-down →

More Slack & Telegram workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Slack & Telegram

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

N8N Nodes Scrapegraphai, HTTP Request, Google Sheets +2
Slack & Telegram

Simplify financial oversight with this automated n8n workflow. Triggered daily, it fetches cash flow and expense data from a Google Sheet, analyzes inflows and outflows, validates records, and generat

HTTP Request, Google Sheets, Email Send +3
Slack & Telegram

This workflow automatically monitors competitor affiliate programs twice daily using Bright Data's web scraping API to extract commission rates, cookie durations, average order values, and payout term

HTTP Request, Google Sheets, Slack +1
Slack & Telegram

Streamline your manufacturing quality control process with automated inspection tracking, compliance documentation, and real-time alerts. This workflow eliminates manual QC paperwork while ensuring IS

Google Sheets, Google Drive, Slack +2
Slack & Telegram

Optimize your performance review process with this automated workflow. Running daily at 8 AM, it retrieves scheduled reviews from a Google Sheet, validates upcoming sessions, processes each review, an

Google Sheets, Email Send, Google Calendar +1