Payroll PDF Processing and Approval Automation
What You'll Have When Done: Fully automated payroll processing that watches for new payroll PDFs, splits them into individual payslips, extracts employee names, adds digital signatures, and saves signed documents to an approved folder.
Prerequisites
Make sure you have these set up:
- Google Drive folders set up:
- Payroll - For Signature (incoming PDFs)
- Payroll - Approved (signed payslips)
- PDF.co API Key
- n8n instance (self-hosted or n8n.cloud)
- Google Drive OAuth2 credentials added in n8n
- Signature in PNG or JPG format (converted to base64 or hosted via public link)
Quick Start Options
Option A: I Want It Working Now
- Import this workflow template → Download JSON File
- Connect your Google Drive and PDF.co account
- Update folder IDs and signature image
- Test with a sample payroll PDF (password: 12345)
- Activate the workflow
Option B: I Want to Build It
Follow the 12-step guide below to create the automation from scratch.
What This Automation Does (Overview)
- Monitors a Google Drive folder for new payroll PDF uploads.
- Download the PDF securely.
- Uploads to PDF.co for processing.
- Removes password protection to unlock the PDF content.
- Splits the PDF into separate pages (payslips).
- Extracts each employee’s name using Regex.
- Adds a signature image and renames the file.
- Uploads the signed files to a separate “approved” folder.
IN THIS TUTORIAL
Step 1: Set Up Google Drive Folders
No nodes needed – just create two folders in your Drive:
- Source: "
Payroll - For Signature
" - Destination: "
Payroll - Approved
"
Success Looks Like: Two folders ready for workflow input/ouput.
Step 2: Trigger on New Payroll File
Node: Google Drive → Changes Involving a Specific Folder
Settings:
- Folder to Watch: "
Payroll - For Signature
" - Watch For:
File Created
Success Looks Like: Workflow starts when a new PDF is added.
Step 3: Download Payroll File
Node: Google Drive → File
Settings:
- Operation:
Download
- File ID:
{{ $json.id }}
Success Looks Like: PDF file downloaded as binary data.
Note: This step is especially important if your Google Drive and sharing settings are restricted, helping ensure secure access to sensitive files like payroll.
Step 4: Upload to PDF.co
Node: PDF.co API → Upload File
Settings:
- Upload Method:
Standard Upload
- Binary File:
True
- Input Binary Field:
data
- Name:
file.pdf
Success Looks Like:
{
"url": "https://pdf-co-temp-files.s3.amazonaws.com/...",
"name": "file.pdf"
}
Step 5: Remove PDF Password Protection
Node: PDF.co API → PDF Security
Settings:
- Url:
{{ $json.url }}
- Operation Mode:
Remove Security
- File Password: (Your file’s password)
Success Looks Like: Payroll file is unlocked and ready.
Step 6: Split PDF into Individual Payslips
Node: PDF.co API → Split PDF
Settings:
- Url:
{{ $json.url }}
- Split By:
Page Numbers
- Pages:
*
(splits all pages; see API Docs for more options) - Inline:
True
Success Looks Like:
{
"body": [
"https://pdf-co.../page1.pdf",
"https://pdf-co.../page2.pdf",
"https://pdf-co.../page3.pdf"
]
}
Step 7: Process Each Payslip
Node: Split Out
Settings:
- Field to Split Out:
body
- Include:
No Other Fields
Success Looks Like: Each payslip URL processed individually.
Step 8: Extract Employee Names
Node: PDF.co API → Search in PDF
Settings:
- PDF URL:
{{ $json.body }}
- Search String:
(?<=Employee Name:\s)([A-Z][a-z]+\s[A-Z][a-z]+)(?=\s)
- Use Regex:
True
- Pages:
0-
- Inline:
True
Success Looks Like:
{
"url": "https://pdf-co.../results.json..."
}
Step 9: Download Extracted Names
Node: HTTP Request
Settings:
- Method: GET
- URL:
{{ $json.url }}
Success Looks Like: Employee name data retrieved successfully.
Step 10: Add Signature and Rename PDF
Node: PDF.co API → Add Text/Images to PDF
Settings:
- URL:
{{ $('Split Out').item.json.body }}
- Images:
- Image Url:
https://image_link
- X-Coordinate: 49.58
- Y-Coordinate: 349.97
- Width: 234.68
- Height: 106.75
- Image Url:
- Advanced Options:
- File Name:
{{ $json.text }}.pdf
- File Name:
Signature Setup:
- Use a PNG or JPG of your signature.
- Host it on cloud storage (e.g., Google Drive).
- Replace
Image URL
with the hosted file link. - Tip: Use the PDF Inspector tool to fine-tune placement. Import the sample project to get started.
Success Looks Like:
{
"url": "https://pdf-co.../John_Smith.pdf...",
"name": "John_Smith.pdf"
}
Step 11: Download Signed PDF
Node: HTTP Request
Settings:
- Method: GET
- URL:
{{ $json.url }}
Success Looks Like: Signed PDF downloaded as binary data.
Step 12: Upload to Approved Folder
Node: Google Drive → Upload
Settings:
- Resource:
File
- Input Data Field Name:
data
- Parent Drive:
My Drive
- Parent Folder:
Payroll - Approved
Success Looks Like: Signed payslip stored in the "Payroll - Approved" folder.
Testing Your Workflow
- Upload a sample payroll PDF to Payroll - For Signature
- Or use Sample Payroll PDF with Password "
12345
" - Execute the workflow
- Check Payroll - Approved — you should see individual signed PDFs
Congrats! You've automated payroll processing from upload to signed approval. No more manual splitting, naming, or signing of payroll documents.
Built something cool? Share it with us @pdfdotco
Related Tutorials



