This workflow automates the entire payslip process by pulling payroll data directly from Google Sheets, generating a professional and secure PDF for each employee, and emailing it to them instantly. Save hours of manual HR administration, eliminate human error, and ensure timely, confidential delivery of payslips every month.

Time Savings: Reduces the entire payslip generation and distribution process from hours of manual work to under 5 minutes.
Cost Reduction: Avoids monthly subscription fees for dedicated payroll software, potentially saving $50-$200 per month.
Error Prevention: Ensures 100% data accuracy by pulling data directly from the source sheet, eliminating risky copy-paste mistakes.
Scalability: Effortlessly handles payroll for 10 or 1,000+ employees without any changes to the core process.

| Requirement | Type | Purpose |
|---|---|---|
| n8n instance | Essential | The platform to run the automation. |
| Google Sheets Account | Essential | To store and manage employee payroll data. |
| Gmail Account | Essential | To send the generated PDF payslips to employees. |
| Google Cloud Project | Essential | To create OAuth2 credentials for Sheets and Gmail. |
Is Email Sent column is set to "no".| Node | Purpose | Key Configuration |
|---|---|---|
| Google Sheets | Reads payroll data and updates the 'sent' status. | Spreadsheet ID, Sheet Name, and Bank Account as the key for matching rows to update. |
| Filter | Processes only employees who haven't received a payslip. | Condition: {{ $json["Is Email Sent"] }} equals no. |
| Code | Formats currency, creates dynamic tables, and converts numbers to words. | Maps input columns from the sheet to output variables for the HTML template. |
| Puppeteer | Converts the styled HTML into a downloadable PDF file. | page.pdf settings define the format (A4), margins, and scale. |
| Gmail | Emails the generated PDF to the corresponding employee. | To, Subject, and Attachment fields use expressions to pull data from previous nodes. |
| Set | Stores global configuration like company name and payroll date. | All company-specific details that appear on the payslip. |
The workflow operates on an idempotent loop principle. It first reads all data, then filters out employees who have already been processed by checking an Is Email Sent column. For each remaining employee, it generates the PDF, sends the email, and critically, updates the status column in Google Sheets from "no" to "yes". This final step ensures that if the workflow is run again, it will not re-process and re-send payslips, preventing duplicates.
Basic Adjustments:
Send Payslip Email node.Generate Payslip HTML node, change the CSS variables like --primary-color to match your company colors.Company Configuration node.Advanced Enhancements:
Manual Trigger with a Schedule Trigger to run the workflow automatically on a specific day each month.Common Issues:
| Problem | Cause | Solution |
|---|---|---|
| PDF formatting is broken or misaligned. | Invalid HTML/CSS in the template, or an expression is returning an empty value. | Verify all expressions in the Generate Payslip HTML node are linked correctly. Use an online validator to check for HTML syntax errors. |
| Workflow processes the same employees again. | The Mark Email Sent in Sheet node failed, or the Filter is misconfigured. |
Ensure the Filter node checks for "no" (case-sensitive). Verify the Mark Email Sent node has write permissions and is correctly identifying the row to update. |
| Emails are not being sent. | Incorrect Gmail API permissions or invalid credentials. | Re-authenticate your Gmail credential in n8n. Check your Google Cloud Project to ensure the Gmail API is enabled and has not hit its usage quota. |
Challenge: A small agency owner with 20 employees manages payroll in a Google Sheet. Every month, they spend half a day manually creating payslips in a Word template, saving each as a PDF, and emailing them one by one.
Solution: By implementing this workflow, they can trigger the entire process with a single click after finalizing the payroll sheet.
Result: What used to take 3 hours now takes less than 2 minutes. Employees receive professional, consistent payslips, and the owner has a clear record of delivery in their Google Sheet.
Challenge: An HR manager at a 150-employee company needs to distribute payslips confidentially. The current process involves a mail merge that is prone to errors and requires manual verification.
Solution: The payroll report is exported to a Google Sheet, and this workflow handles the rest. It runs through the entire list, generating and sending each payslip individually.
Result: The risk of sending the wrong payslip to an employee is eliminated. The process is fully automated, secure, and provides an auditable trail directly in the spreadsheet, saving the HR department over a day of work each month.
Created by: Khaisa Studio
Category: HR & Recruiting | Tags: Google Sheets, Gmail, PDF, HR, Automation, Puppeteer, Payroll
Need custom workflows? Contact us
Connect with the creator:
Portfolio • Workflows • LinkedIn • Medium • Threads