AI-Process Pay Stub Payslip in n8n
AI-Process Pay Stub is a PDF4me AI action in n8n that reads a pay stub or payslip and returns its contents as structured JSON. Use it to pull gross and net pay, tax withholding, hours worked, deductions, and year-to-date totals out of a document without anyone retyping them.
What this node does
In n8n this appears as Resource: AI plus AI Operations: AI-Process Pay Stub. Give it a stub as binary data, base64, or a URL and it returns a payStubData object covering earnings, taxes, employee and employer details, hours, benefits, and year-to-date totals, alongside warnings and fallbackUsed so you can judge how much to trust the result.
Authenticating Your API Request
Every PDF4me node in n8n requires a valid Credential to connect with. Create or select one that holds your PDF4me API key so the workflow can authenticate AI extraction requests.
Important Facts You Should Not Miss
0 or an empty string. A zero is therefore ambiguous, so never calculate against one without checking warnings.AI-Process Pay Stub vs AI-Document Parser: which should I use?
Both read a document and return structured data. The difference is whether the schema is decided in advance.
| AI-Process Pay Stub | vs AI-Document Parser | |
|---|---|---|
| Output shape | A fixed payroll schema, same keys every run | Whatever you define per document type |
| Setup effort | Pick the action and go | You describe the fields you want |
| Best for | Stubs and payslips at volume | Documents with no dedicated action |
| Payroll fields | Named and typed already | You name them yourself |
| Which vs which | Pick when the document is a pay stub | Pick when it is anything else |
If your documents are pay stubs, this action is the shorter path: the payroll vocabulary is already built in. Reach for AI-Document Parser when the format has no dedicated action of its own.
How do I set up the node?
Add the PDF4me node to your n8n workflow, set Resource to AI, then choose AI-Process Pay Stub from AI Operations. For first-time setup, see the n8n Integration Guide.
Prerequisites: a PDF4me API credential, an n8n workflow, and a pay stub as a PDF, PNG, JPG, or JPEG.

What are the parameters?
The panel is short. Most of the work is choosing an input mode and naming the file correctly.
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| Resource | Options | Required | Selects the family of operations. Set it to AI to reveal the AI Operations dropdown. | AI |
| AI Operations | Options | Required | The specific AI action to run. Listed in the node as AI-Process Pay Stub. | AI-Process Pay Stub |
| Input Data Type | Options | Required | How the document reaches the node: Binary Data, Base64 String, or URL. The matching source field appears beneath it. | Binary Data |
| Input Binary Field | String | Conditional | Name of the binary property holding the file. Shown when Input Data Type is Binary Data. | data |
| Base64 Pay Stub Content | String | Conditional | The document as a base64 string. Shown when Input Data Type is Base64 String. | JVBERi0xLjQKJ... |
| Pay Stub URL | String | Conditional | A publicly reachable link to the document. Shown when Input Data Type is URL. | https://example.com/paystub.pdf |
| Document Name | String | Optional | Filename with its real extension, which is what drives format detection. Ships with a default. | pay_stub.png |
| Custom Fields | Collection | Optional | An add-item collection, empty by default. Use Add Custom Field to request values outside the standard schema. | shiftDifferential |
Binary Data, Base64 String, and URL each reveal their own source field, and only the one matching your chosen mode needs a value. Binary Data is the usual pick when a previous node fetched the file.
What does the node return?
The response wraps everything payroll-related inside payStubData and keeps job metadata alongside it.
| Field | Type | Description | Example |
|---|---|---|---|
| payStubData | Object | All extracted pay stub fields. Broken down in the table below. | { "grossPay": 1627.74, ... } |
| jobId | String | Identifier for the AI processing job, useful when investigating a specific run. | 00000000-0000-0000-0000-000000000000 |
| jobIdExt | String | External job identifier for third-party system integration, when applicable. | null |
| success | Boolean | Whether the extraction call completed. Note this reports the call, not the quality of the reading. | true |
| message | String | Status text, carrying error detail when something fails. | Pay stub data extracted successfully |
Inside payStubData
| Field | Type | Group | Description | Example |
|---|---|---|---|---|
| warnings | Array | Quality signal | Data quality issues met during extraction. Read this before trusting any figure. | ["Vision AI processing completed successfully"] |
| fallbackUsed | Boolean | Quality signal | Whether a secondary extraction method was needed. True is a review trigger. | false |
| rawOcrText | String | Quality signal | Raw OCR text from the document, when available. | "" |
| grossPay | Number | Earnings | Gross pay before deductions. | 1627.74 |
| netPay | Number | Earnings | Net pay after all deductions. | 1040.23 |
| payPeriod | String | Earnings | Date range the stub covers. | 07/10/2017 - 07/23/2017 |
| payDateStr | String | Earnings | Pay date as printed on the stub. | 08/04/2017 |
| PayDate | String | Earnings | Pay date. Note the capitalised key, which differs from payDateStr. | 08/04/2017 |
| commissionBonus | Number | Earnings | Commission or bonus amount. | 0 |
| federalIncomeTax | Number | Tax | Federal income tax withheld this period. | 182.98 |
| stateIncomeTax | Number | Tax | State income tax withheld. | 61 |
| socialSecurityTax | Number | Tax | Social Security tax withheld. | 0 |
| medicareTax | Number | Tax | Medicare tax withheld. | 22.12 |
| localCityTax | Number | Tax | Local or city tax withheld. | 0 |
| employeeName | String | Employee | Name of the employee. | Franklin St |
| employeeIdSsn | String | Employee | Employee ID or Social Security Number. Treat as sensitive. | 000000000 |
| employeeAddress | String | Employee | Employee address as printed. | 123 Franklin St, Chapel Hill, NC 27517 |
| jobTitle | String | Employee | Job title or position. | Admin Support Specialist |
| companyName | String | Employer | Employer name. | University of North Carolina |
| employerAddress | String | Employer | Employer address. | 103 South Building, Chapel Hill, NC |
| employerEin | String | Employer | Employer Identification Number, empty when not printed. | "" |
| regularHours | Number | Hours | Regular hours worked in the period. | 74.5 |
| overtimeHours | Number | Hours | Overtime hours worked. | 0 |
| regularRate | Number | Hours | Regular hourly rate. | 20.346846 |
| overtimeRate | Number | Hours | Overtime hourly rate. | 0 |
| totalHours | Number | Hours | Total hours worked in the period. | 80 |
| healthInsurance | Number | Deductions | Health insurance deduction. | 0 |
| retirement401k | Number | Deductions | Retirement contribution deduction. | 97.66 |
| otherBenefits | Number | Deductions | Other benefit deductions. | 0 |
| garnishments | Number | Deductions | Amount withheld for garnishments. | 0 |
| ytdGrossPay | Number | Year to date | Year-to-date gross pay. | 28707.21 |
| ytdNetPay | Number | Year to date | Year-to-date net pay. | 18396.25 |
| ytdFederalTax | Number | Year to date | Year-to-date federal tax. | 3319.78 |
| ytdStateTax | Number | Year to date | Year-to-date state tax. | 1126 |
| checkNumber | String | Payment | Check number or payment reference. | Advice #0000000002214873 |
| directDepositInfo | String | Payment | Direct deposit details as printed, usually with a masked account. | Checking XXXXXXX0000 |
| vacationSickTime | String | Payment | Vacation and sick balance text. | Vacation End Balance: 213.66 |
N8N Action Response
- JSON
- Confidence routing
{
"payStubData": {
"warnings": ["Vision AI processing completed successfully"],
"fallbackUsed": false,
"rawOcrText": "",
"grossPay": 1627.74,
"netPay": 1040.23,
"payPeriod": "07/10/2017 - 07/23/2017",
"payDateStr": "08/04/2017",
"federalIncomeTax": 182.98,
"stateIncomeTax": 61,
"socialSecurityTax": 0,
"medicareTax": 22.12,
"localCityTax": 0,
"employeeName": "Franklin St",
"employeeIdSsn": "000000000",
"jobTitle": "Admin Support Specialist",
"companyName": "The University of North Carolina at Chapel Hill",
"employerEin": "",
"regularHours": 74.5,
"overtimeHours": 0,
"regularRate": 20.346846,
"totalHours": 80,
"retirement401k": 97.66,
"garnishments": 0,
"ytdGrossPay": 28707.21,
"ytdNetPay": 18396.25,
"ytdFederalTax": 3319.78,
"ytdStateTax": 1126,
"checkNumber": "Advice #0000000002214873",
"commissionBonus": 0,
"PayDate": "08/04/2017"
},
"jobId": "00000000-0000-0000-0000-000000000000",
"jobIdExt": null,
"success": true,
"message": "Pay stub data extracted successfully"
}
Branch on the quality signals rather than on success, which only reports that the call completed:
// n8n IF node condition
const d = $json.payStubData;
const routine = d.warnings.length === 1
&& d.warnings[0].includes('completed successfully');
// true -> straight through to payroll
// false -> human review queue
return !d.fallbackUsed && routine && d.grossPay > 0;
The grossPay > 0 clause matters because an unread figure returns as 0, which is indistinguishable from a genuine zero without it.
Typical Setups
Practical Tips
- Treat the extracted stub as sensitive from the moment it lands.
employeeIdSsn, wage figures, and a home address arrive together in one object. Decide which of those your downstream systems genuinely need and drop the rest before storing anything. - Never branch on
successalone. It reports that the call completed, not that the reading was good.fallbackUsedandwarningsare the fields that tell you about quality. - Guard against ambiguous zeros. Because unread numbers come back as
0, a rule like "flag stubs where net pay exceeds gross" silently passes a stub whose gross was never read. Check that the figure is above zero first. - Watch the two pay-date keys.
payDateStrandPayDateboth appear in the response and the second is capitalised. Pick one and use it consistently, since a mismatch here is easy to miss in a mapping. - Use Custom Fields for employer-specific lines. Allowances, shift differentials, and union dues vary by organisation and are exactly what that collection exists for.
- Feed it the cleanest copy available. An original PDF or a flat scan gives the extraction more to work with than a phone photo taken at an angle.
Cheat Sheet
| Goal | Setting or field |
|---|---|
| Find the action in n8n | Resource = AI, AI Operations = AI-Process Pay Stub |
| Use a file from a previous node | Input Data Type = Binary Data, Input Binary Field = data |
| Process a hosted document | Input Data Type = URL, then Pay Stub URL |
| Get the format detected right | Document Name with the real extension |
| Capture a non-standard line | Add Custom Field under Custom Fields |
| Decide whether to trust a run | fallbackUsed plus warnings |
| Core payroll figures | grossPay, netPay, ytdGrossPay |
Common Questions
What is the action actually called in n8n?
In the node it is AI-Process Pay Stub. Set Resource to AI, then pick AI-Process Pay Stub from the AI Operations dropdown. The word "payslip" appears in the documentation URL and in common usage but not in the n8n interface itself, so search the dropdown for "Pay Stub".
How do I know whether an extraction is trustworthy?
Two fields carry that signal. The warnings array lists data quality issues the extraction ran into, and fallbackUsed indicates whether a secondary extraction method was needed. Treat any result where fallbackUsed is true, or where warnings contains more than the routine completion note, as needing human review before the numbers reach a payroll or lending decision.
Does this action make my payroll process compliant?
No. This action extracts data from a document. A pay stub contains wage figures and frequently an employee identifier or partial Social Security Number, so extracting it places that data inside whatever privacy and employment record obligations already apply to you. Those obligations are a property of your systems and jurisdiction, not of this node, and using it changes your position neither way. If you are unsure what applies, the US Department of Labor guidance on recordkeeping is a reasonable starting point for wage records.
What happens to fields the pay stub does not contain?
They come back as empty strings or zeros rather than being left out of the response. A 0 in socialSecurityTax or overtimeHours therefore means either a genuine zero on the document or a value that could not be read. Check the corresponding warnings entry rather than assuming the figure is real, particularly for any field you plan to calculate against.
Can I extract fields that are specific to my employer?
Yes. The Custom Fields collection in the node lets you add named keys beyond the standard schema, which is how you capture things like a shift differential, a regional allowance, or a union due that only appears on your organisation's stubs. Add one entry per value you want back.
Which file formats can it read?
PDF, PNG, JPG, and JPEG. Set Document Name to the filename with its true extension, because that is what tells the action which format it is dealing with. A photographed stub works, though a flat scan or an original PDF gives the extraction more to work with than a phone picture taken at an angle.
Related AI Actions in n8n
Same Task on Other Platforms
Use Cases
Payroll data entry
Read stubs arriving from a payroll provider or an employee upload and write the figures straight into a finance system, keeping manual keying for the exceptions the confidence signals flag.
Income and employment verification
Pull gross pay, net pay, employer name, and year-to-date totals for lending, tenancy, or benefits checks, so a reviewer works from structured values instead of reading each document.
Payroll reconciliation and audit
Compare what the stub says against what the HR or accounting system recorded, and surface only the rows where the two disagree.
Further Reading
- US Department of Labor: recordkeeping under the FLSA sets out what wage records employers are expected to keep.
- n8n: Work with files and images explains how binary files move between nodes, which is what the input fields refer to.