# Monthly Payslip Generator (WhatsApp & Email)

**Category:** HR & Recruitment  
**Tools:** n8n, Google Sheets, Google Drive  
**Nodes:** 20  
**Built by:** Forgent Systems

Generates a PDF payslip for every employee each month, saves it to Google Drive, sends it on WhatsApp and email, and marks payroll as sent in Google Sheets.

![Workflow](preview.webp)

## How it works

1. A monthly trigger fetches pending payroll rows.
2. Each employee's data is normalised into a payslip template.
3. The HTML is converted to PDF and stored in a Drive folder.
4. A shareable link is sent on WhatsApp and the PDF by email.
5. The payroll status is updated in the sheet.

## Use cases

- SMEs running payroll in spreadsheets
- HR outsourcing firms
- Contract staff payouts

## Data setup

**Google Sheets** (tab: columns)

- **Automated Payroll Slip Sender → Employees**: `status`, `month`, `Receipt PDF`

## Setup

1. In n8n open **Workflows → Import from File** and choose `workflow.json`.
2. Connect these credentials:
   - Gmail account
   - Google Drive account
   - Google Sheets account
   - Twilio account
3. Point the Sheets / Airtable / Drive / Slack nodes at your own resources (structure above).
4. Replace placeholder emails, phone numbers and `YOUR-FORM-ID` links with your own.
5. Times use the America/New_York timezone and dates use MM/DD/YYYY. Adjust if needed.
6. Run a test execution, then activate.

## Nodes

- **Check If Receipt Folder Exists** — `n8n-nodes-base.if`
- **Upload Receipt PDF (Existing Folder)** — `n8n-nodes-base.googleDrive`
- **Upload Receipt PDF (New Folder)** — `n8n-nodes-base.googleDrive`
- **Generate Public Receipt Link** — `n8n-nodes-base.set`
- **Find “Staff Salary Receipts” Folder in Drive** — `n8n-nodes-base.googleDrive`
- **Create “Staff Salary Receipts” Folder** — `n8n-nodes-base.googleDrive`
- **Monthly Payroll Trigger** — `n8n-nodes-base.scheduleTrigger`
- **Fetch Pending Payroll** — `n8n-nodes-base.googleSheets`
- **Process Employees One by One** — `n8n-nodes-base.splitInBatches`
- **Normalize Payroll Fields** — `n8n-nodes-base.set`
- **Build Payslip HTML** — `n8n-nodes-base.code`
- **Create HTML Binary** — `n8n-nodes-base.code`
- **Convert Payslip HTML → PDF** — `n8n-nodes-base.httpRequest`
- **Extract PDF Binary Only** — `n8n-nodes-base.code`
- **Get & Rename PDF Binary to data** — `n8n-nodes-base.code`
- **Make PDF Public (Read-Only)** — `n8n-nodes-base.googleDrive`
- **Send Payslip via WhatsApp** — `n8n-nodes-base.twilio`
- **Send Payslip via Email** — `n8n-nodes-base.gmail`
- **Store Receipt Link & Mark Payroll as Sent** — `n8n-nodes-base.googleSheets`
- **Sticky Note** — `n8n-nodes-base.stickyNote`
