Skip to main content

Detect payroll discrepancies with Google Sheets, Slack and Gmail

Workflow preview

Workflow preview
100%
Detect payroll discrepancies with Google Sheets, Slack and Gmail preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow runs monthly to compare current vs. previous payroll data in Google Sheets, detect pay anomalies, alert Finance in Slack, email HR via Gmail, and log discrepancies back...

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.googlesheets, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.set, n8n-nodes-base.slack, n8n-nodes-base.gmail, n8n-nodes-base.stickynote

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Detect payroll discrepancies with Google Sheets, Slack and Gmail
Workflow name
Detect payroll discrepancies with Google Sheets, Slack and Gmail

Quick Overview

This workflow runs monthly to compare current vs. previous payroll data in Google Sheets, detect pay anomalies, alert Finance in Slack, email HR via Gmail, and log discrepancies back to a Google Sheets audit tab.

How it works

  1. Runs on a monthly schedule (cron: 0 9 25 * *) to start a pre-payroll review.
  2. Reads the current pay run and the previous pay run from two Google Sheets tabs.
  3. Compares both periods per employee to flag duplicates, unmatched employees, pay without hours, and large net pay swings based on percentage thresholds.
  4. If no anomalies are found, posts an all-clear message to a Slack channel.
  5. For each flagged anomaly, classifies severity and posts an immediate Slack “payroll hold” alert for Critical items.
  6. Appends each flagged anomaly to an AnomalyLog tab in Google Sheets and emails HR a per-employee review message via Gmail.
  7. Aggregates all flagged items into a run-level digest and posts the summary and recommendation to Slack for Finance.

Setup

  1. Add Google Sheets credentials and set your spreadsheet ID, ensuring it contains the CurrentPayRun, PreviousPayRun, and AnomalyLog tabs.
  2. Ensure your payroll sheets include the expected columns (employee_id, name, net_pay, hours, status, and email) so the discrepancy checks work correctly.
  3. Add Slack credentials and replace the Slack channel ID(s) used for critical holds, digests, and all-clear messages.
  4. Add Gmail credentials and set the HR recipient email address for anomaly review notifications.
  5. Adjust the schedule cron expression and the discrepancy thresholds in the detection code (for example, 15%, 40%, and 80%) to match your payroll policies.

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 - Monthly Pre-Payroll Trigger

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

Block 2 - Get Current Pay Run

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

Block 3 - Get Previous Pay Run

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

Block 4 - Detect Discrepancies

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

Block 5 - Has Anomalies

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

Block 6 - Classify Severity

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Is Critical Block

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

Block 8 - Slack Critical Hold

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.2

Block 9 - Log Anomaly to Sheet

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

Block 10 - Email HR Review

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

Block 11 - Build Run Digest

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

Block 12 - Slack Digest to Finance

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.2

Block 13 - Slack All Clear

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.2

Block 14 - Sticky Note Overview

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

Block 15 - Sticky Note Section1

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

Block 16 - Sticky Note Section2

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

Block 17 - Sticky Note Section3

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

3. Summary Table

Workflow Detect payroll discrepancies with Google Sheets, Slack and Gmail
Complexity advanced
Nodes 17
Categories HR, AI Summarization
Author Avkash Kakdiya
Published 09 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16197/16197.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 Detect payroll discrepancies with Google Sheets, Slack and Gmail do?

Quick Overview This workflow runs monthly to compare current vs. previous payroll data in Google Sheets, detect pay anomalies, alert Finance in Slack, email HR via Gmail, and log discrepancies back...

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.