Skip to main content

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.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog

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

Extracting is not the same as being compliant
A stub carries wage figures and often an employee identifier. Pulling those into your systems brings them under obligations you already hold. This node does not change that position either way.
Missing values return as zero, not absent
An unread figure comes back as 0 or an empty string. A zero is therefore ambiguous, so never calculate against one without checking warnings.
The dropdown says Pay Stub, not Payslip
Set Resource to AI, then look for AI-Process Pay Stub under AI Operations. Searching the node for "payslip" will not find it.

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 Stubvs AI-Document Parser
Output shapeA fixed payroll schema, same keys every runWhatever you define per document type
Setup effortPick the action and goYou describe the fields you want
Best forStubs and payslips at volumeDocuments with no dedicated action
Payroll fieldsNamed and typed alreadyYou name them yourself
Which vs whichPick when the document is a pay stubPick 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.

The AI-Process Pay Stub parameter panel in n8n, showing Resource set to AI, the AI Operations dropdown, input fields, and the Custom Fields collection
The node panel. Custom Fields is an add-item collection that starts empty, not a list you type into.

What are the parameters?

The panel is short. Most of the work is choosing an input mode and naming the file correctly.

ParameterTypeRequiredDescriptionExample
ResourceOptionsRequiredSelects the family of operations. Set it to AI to reveal the AI Operations dropdown.AI
AI OperationsOptionsRequiredThe specific AI action to run. Listed in the node as AI-Process Pay Stub.AI-Process Pay Stub
Input Data TypeOptionsRequiredHow the document reaches the node: Binary Data, Base64 String, or URL. The matching source field appears beneath it.Binary Data
Input Binary FieldStringConditionalName of the binary property holding the file. Shown when Input Data Type is Binary Data.data
Base64 Pay Stub ContentStringConditionalThe document as a base64 string. Shown when Input Data Type is Base64 String.JVBERi0xLjQKJ...
Pay Stub URLStringConditionalA publicly reachable link to the document. Shown when Input Data Type is URL.https://example.com/paystub.pdf
Document NameStringOptionalFilename with its real extension, which is what drives format detection. Ships with a default.pay_stub.png
Custom FieldsCollectionOptionalAn add-item collection, empty by default. Use Add Custom Field to request values outside the standard schema.shiftDifferential
The three input modes are mutually exclusive

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.

FieldTypeDescriptionExample
payStubDataObjectAll extracted pay stub fields. Broken down in the table below.{ "grossPay": 1627.74, ... }
jobIdStringIdentifier for the AI processing job, useful when investigating a specific run.00000000-0000-0000-0000-000000000000
jobIdExtStringExternal job identifier for third-party system integration, when applicable.null
successBooleanWhether the extraction call completed. Note this reports the call, not the quality of the reading.true
messageStringStatus text, carrying error detail when something fails.Pay stub data extracted successfully

Inside payStubData

FieldTypeGroupDescriptionExample
warningsArrayQuality signalData quality issues met during extraction. Read this before trusting any figure.["Vision AI processing completed successfully"]
fallbackUsedBooleanQuality signalWhether a secondary extraction method was needed. True is a review trigger.false
rawOcrTextStringQuality signalRaw OCR text from the document, when available.""
grossPayNumberEarningsGross pay before deductions.1627.74
netPayNumberEarningsNet pay after all deductions.1040.23
payPeriodStringEarningsDate range the stub covers.07/10/2017 - 07/23/2017
payDateStrStringEarningsPay date as printed on the stub.08/04/2017
PayDateStringEarningsPay date. Note the capitalised key, which differs from payDateStr.08/04/2017
commissionBonusNumberEarningsCommission or bonus amount.0
federalIncomeTaxNumberTaxFederal income tax withheld this period.182.98
stateIncomeTaxNumberTaxState income tax withheld.61
socialSecurityTaxNumberTaxSocial Security tax withheld.0
medicareTaxNumberTaxMedicare tax withheld.22.12
localCityTaxNumberTaxLocal or city tax withheld.0
employeeNameStringEmployeeName of the employee.Franklin St
employeeIdSsnStringEmployeeEmployee ID or Social Security Number. Treat as sensitive.000000000
employeeAddressStringEmployeeEmployee address as printed.123 Franklin St, Chapel Hill, NC 27517
jobTitleStringEmployeeJob title or position.Admin Support Specialist
companyNameStringEmployerEmployer name.University of North Carolina
employerAddressStringEmployerEmployer address.103 South Building, Chapel Hill, NC
employerEinStringEmployerEmployer Identification Number, empty when not printed.""
regularHoursNumberHoursRegular hours worked in the period.74.5
overtimeHoursNumberHoursOvertime hours worked.0
regularRateNumberHoursRegular hourly rate.20.346846
overtimeRateNumberHoursOvertime hourly rate.0
totalHoursNumberHoursTotal hours worked in the period.80
healthInsuranceNumberDeductionsHealth insurance deduction.0
retirement401kNumberDeductionsRetirement contribution deduction.97.66
otherBenefitsNumberDeductionsOther benefit deductions.0
garnishmentsNumberDeductionsAmount withheld for garnishments.0
ytdGrossPayNumberYear to dateYear-to-date gross pay.28707.21
ytdNetPayNumberYear to dateYear-to-date net pay.18396.25
ytdFederalTaxNumberYear to dateYear-to-date federal tax.3319.78
ytdStateTaxNumberYear to dateYear-to-date state tax.1126
checkNumberStringPaymentCheck number or payment reference.Advice #0000000002214873
directDepositInfoStringPaymentDirect deposit details as printed, usually with a masked account.Checking XXXXXXX0000
vacationSickTimeStringPaymentVacation and sick balance text.Vacation End Balance: 213.66

N8N Action Response

{
"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"
}

Typical Setups

Payroll intake from email
A mail trigger picks up stubs from a payroll provider, this action reads each one, and the figures land in a finance sheet without manual keying.
Income verification for lending
An applicant uploads recent stubs. The action extracts grossPay, netPay, and the year-to-date totals, and the workflow flags anything that needs an underwriter to look.
Employee record reconciliation
Compare extracted netPay and deductions against what the HR system expects, and raise a ticket only where the two disagree.
Bulk historical digitisation
Loop a folder of archived stubs through the node to turn a filing cabinet of PDFs into queryable rows, with low-confidence results split off for checking.

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 success alone. It reports that the call completed, not that the reading was good. fallbackUsed and warnings are 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. payDateStr and PayDate both 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

GoalSetting or field
Find the action in n8nResource = AI, AI Operations = AI-Process Pay Stub
Use a file from a previous nodeInput Data Type = Binary Data, Input Binary Field = data
Process a hosted documentInput Data Type = URL, then Pay Stub URL
Get the format detected rightDocument Name with the real extension
Capture a non-standard lineAdd Custom Field under Custom Fields
Decide whether to trust a runfallbackUsed plus warnings
Core payroll figuresgrossPay, 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.

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

Get Help