Skip to main content

Automated employee attendance & salary deduction with Google Sheets and GPT-4

Workflow preview

Workflow preview
100%
Automated employee attendance & salary deduction with Google Sheets and GPT-4 preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow is designed for HR teams and payroll department to automate the monthly process of calculating employee attendance, salary deductionsm and personalized email notification. It seamless...

Best for

  • HR automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.code, n8n-nodes-base.googlesheets, n8n-nodes-base.merge, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.emailsend

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Mohamed Abubakkar.

Original n8n.io source

1.1 Workflow description

Title
Automated employee attendance & salary deduction with Google Sheets and GPT-4
Workflow name
Automated employee attendance & salary deduction with Google Sheets and GPT-4

Overview

This workflow is designed for HR teams and payroll department to automate the monthly process of calculating employee attendance, salary deductionsm and personalized email notification. It seamlessly integrates Google Sheets, internal attendance data and GPT-4 (via AI Agent) to generate complete monthly payroll reports with professional summaries for each employees.

Prerequisites

Before using this workflow, ensure you have:

  • A Google Sheet with the monthly attendance logs
  • A secong Google Sheet containing salary, employee names and email addresses.
  • Gmail or SMTP credentials for sending email
  • OpenAI API key (for summarization)
  • Crendentials for Google Sheet and Gmail Integration

Google Sheet Structure

1. Attendance Sheet (Daily Log)
EmpId	Name	Date	InTime	OutTime	HoursWorked	Status
2. Ouput Sheet (Generated by Workflow)
EmpId	Name	OriginalSalary	TotalMissingHours	TotalAbsentDays	Deduction	FinalSalary	EmpEmail

How It Works

1. Retrieve Attendance & Employee Master Data

The workflow fetches all employee attendace logs and thier corresponding salary, name and email details from Google Sheets.

2. Calculate Work Hours & Absences

The workflow computes total worked hours per day, missing hours and identifies absent days, It then calculates the total missing hours and absences for the entire month.

3. Salary Deduction Calculation

Each employee's hourly and daily rate is determined from thier salary, and deductions are calculated based on missing hours and absences.

4. Prepare Final Dataset

A structured JSON dataset is generated combining attendace summary, deductions and final salary amounts.

5. Generate AI Summary Report (GPT-4)

Using AI Agent GPT-4 creates a professional, HR-friendly summary paragraph for each employee's email report.

6. Send Salary Deduction Report Email

Each employee receives a personalized email with thier final salary summary and monthly attendance report.

7. Log Email Status

Email delivery details and summary text are stored in new Google Sheet for audit and HR tracking.

User Cases

  • Monthly attendance and payroll automation
  • Automated HR communication
  • Salary deduction reporting
  • Attendace compliance monitoring
  • Reducing manual calculation errors

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 2 - Calculate hours per day

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - Calculate Salary Deduction

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - Employees Attendant Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 5 - Employees Salary Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 6 - Merge with Salary

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 7 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 8 - Adding the report to new sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 9 - Convert the result to JSON format

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Save Email Log to Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 11 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Generate AI Summary Report

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3

Block 18 - Send Salary Deduction Report Email

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

3. Summary Table

Workflow Automated employee attendance & salary deduction with Google Sheets and GPT-4
Complexity advanced
Nodes 18
Categories HR, AI Summarization
Author Mohamed Abubakkar
Published 09 Dec 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11625/11625.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automated employee attendance & salary deduction with Google Sheets and GPT-4 do?

This workflow is designed for HR teams and payroll department to automate the monthly process of calculating employee attendance, salary deductionsm and personalized email notification. It seamless...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your HR, AI Summarization use case.