workflows.fit
Back to n8n workflows
n8n templateFreeBy Oneclick AI Squad

Automate construction site attendance tracking with geofencing, Google Sheets & email alerts

This n8n workflow automates attendance tracking for construction workers at a designated site in Thaltej, Ahmedabad (GPS coordinates: 23.0489, 72.5118). Using geofencing technology, it logs "Punch In" and "Punch Out" ...

CommunicationHITLCore NodesData & StorageProductivityDevelopmentWebhookFunction
Loading interactive preview...

Template notes

This n8n workflow automates attendance tracking for construction workers at a designated site in Thaltej, Ahmedabad (GPS coordinates: 23.0489, 72.5118). Using geofencing technology, it logs "Punch In" and "Punch Out" times when workers enter or exit a predefined 100-meter radius around the site, requiring no manual input. Attendance data is stored in Google Sheets for easy access and reporting, and error notifications are sent via email to ensure reliable operation.

Good to Know

- Fully Automated: Tracks attendance without worker intervention using GPS data from a mobile app. - Geofence-Based: Only logs entries/exits within the Thaltej, Ahmedabad site radius. - Structured Logs: Stores data in Google Sheets with columns for User ID, Punch Type, Punch Date, and Punch Time. - Error Handling: Sends email notifications for any issues in the workflow. - Scalable: Supports multiple workers with unique IDs sent by the GPS app. - Real-Time: Processes location updates instantly for accurate time tracking.

How It Works

Attendance Tracking Flow

1. Webhook Trigger: - Listens for POST requests from a GPS tracking app at the endpoint /webhook/geofence-thaltej-attendance. - Expects a JSON payload with: json { "latitude": 23.0489, "longitude": 72.5118, "event": "enter", // or "exit" "userId": "worker123" }

2. Validate Geofence & Format Log: - Validates the received payload for required fields (latitude, longitude, event, userId). - Uses the Haversine formula to check if the coordinates are within 100 meters of Thaltej, Ahmedabad (23.0489, 72.5118). - Maps event ("enter" to "in", "exit" to "out") and formats the log with current date and time (e.g., Punch Type: "in", Punch Date: "2025-08-01", Punch Time: "11:53:07"). - Skips invalid or out-of-geofence data.

3. Save to Google Sheets: - Appends the formatted log to a Google Sheet in the "Attendance" tab, under columns: User ID, Punch Type, Punch Date, Punch Time.