Automated Geofenced Construction Site Attendance Tracking - n8n Workflow

Use this robust n8n workflow to automate construction site attendance tracking. It uses a custom n8n trigger, geofencing validation, Google Sheets updates, and immediate email alerts.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Construction project managers needing reliable, automated attendance logs.
Companies that require strict site check-in verification using geofencing.
Users looking for advanced n8n templates for logistics and resource management.
Automation specialists seeking a practical example of combining webhooks, custom code (Function n8n node), and Google Sheets.

Overview

Managing worker attendance manually is prone to errors and ‘buddy punching.’ This comprehensive n8n workflow solves these problems by enforcing location validation.

When a worker attempts to punch in or out via a mobile interface, the system first verifies if their current GPS coordinates fall within the defined construction site geofence. This crucial logic is handled by a custom n8n node (the Function node). If the location is valid, the record is immediately appended to a centralized Google Sheet, creating a real-time, tamper-proof attendance log. Finally, a notification email is sent. This powerful n8n workflow template ensures accurate payroll records and improves site management efficiency.

How it Works

This automation operates in four distinct phases:


  1. Receive Punch Request (n8n Trigger): The n8n workflow starts immediately upon receiving a POST request via the Webhook n8n trigger at the defined path (geofence-thaltej-attendance). This request contains essential worker identification and GPS coordinates from a mobile input source.

  2. Validate Location and Format Data: The 'Validate Geofence & Format Log' Function n8n node executes custom logic. This node is responsible for comparing the received GPS data against the expected construction site coordinates (potentially using an external API like Google Maps) to ensure the worker is physically on site. It then formats the necessary data columns (worker ID, punch type, time, date) for the spreadsheet.

  3. Log Attendance: The validated data is passed to the Google Sheets n8n node, which performs the Append operation. The data is added to the specified range (Attendance!A:D), ensuring the log is always up-to-date.

  4. Send Confirmation Email: The final n8n node sends an automated email notification confirming that the attendance sheet has been successfully updated, completing the execution of this specific n8n workflow.

Installation Guide

To deploy this n8n workflow, follow these steps:


  1. Import the JSON: Copy the provided JSON data and import it directly into your n8n instance.

  2. Set up the Webhook n8n trigger: Activate the workflow and note the production URL provided by the Webhook n8n trigger. Configure your mobile input source (e.g., app, Google Form endpoint) to send POST requests containing GPS and worker data to this URL.

  3. Configure Credentials:

Google Sheets: Set up your Google API credentials (ScSS2KxGQULuPtdy) and replace the placeholder yourgooglesheet_id with the ID of your actual attendance tracking sheet.
SMTP: Configure your SMTP credentials (G1kyF8cSWTZ4vouN) for the 'Send email' n8n node.

  1. Customize Function Node: Update the JavaScript code within the 'Validate Geofence & Format Log' n8n node to include your specific geofence coordinates and the logic for location validation (as indicated by the sticky note).

  2. Test: Run the n8n workflow manually with test data to ensure the data flows correctly from the n8n trigger to the final Google Sheet update.

Node Details

Webhook (n8n Trigger):
Function: Serves as the primary n8n trigger, initiating the process upon receiving a check-in/out request, including GPS data.
Key Configuration: Configured to listen for POST requests at the path geofence-thaltej-attendance.
Validate Geofence & Format Log (Function n8n node):
Function: Executes custom JavaScript to validate if the received GPS coordinates are within the defined geofenced area. It also formats the incoming raw data into structured columns suitable for Google Sheets.
Key Configuration: Contains custom code logic (not visible in parameters) crucial for site location verification.
Append data to a sheet (Google Sheets n8n node):
Function: Records the validated attendance entry into the master tracking sheet.
Key Configuration: Operation set to Append. Targets the range Attendance!A:D.
Send email (EmailSend n8n node):
Function: Provides immediate confirmation to stakeholders that the attendance log has been successfully updated by the n8n workflow.
Key Configuration: Uses a parameterized subject 📋 Daily Attendance Updated – Please Review and a dynamic text body confirming the successful update.

Related n8n Workflows

Free

Nodes: 5 Nodes
Updated: December 26 2025
View all
Created by

The AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.

Featured*