跳到主要内容

AI-处理工资单 n8n

AI处理工资单 是一个 PDF4me AI 行动 n8n 读取工资单或工资条并按结构化方式返回其内容 JSON. 使用它可以从文档中提取总工资、净工资、税款预扣、工作时间、扣除项和年初至今的总计,而无需任何人重新输入。

此节点的功能

n8n 这看起来像是 资源: AIAI 运营: AI处理工资单将其作为二进制数据、base64 编码或其他形式提供。 URL 它返回一个 工资单数据 该对象涵盖收入、税款、雇员和雇主详细信息、工时、福利以及年初至今的总计,以及 警告备用方案 这样你就能判断结果的可信度了。

相关博客文章
目前尚无关于此功能的博客文章——敬请期待。
在此期间,您可以浏览 PDF4me 博客,查看适用于各平台的教程和工作流程。
访问博客

验证您的身份 API 要求

每一个 PDF4me 节点 n8n 需要有效 用于连接的凭证创建或选择一个可以容纳您的 PDF4me API 关键在于工作流程能够进行身份验证 AI 提取请求。

您不容错过的重要事实

提取信息并不等同于遵守规定。
存根包含工资数据,通常还包含员工标识符。将这些数据导入您的系统后,它们将归入您已有的负债项下。此节点不会改变这种状态。
缺失值返回零,而不是缺失值。
未读数字返回如下 0 或者空字符串。因此,零是不确定的,所以在未检查之前,切勿将其与零进行比较。 警告
下拉菜单显示的是“工资单”,而不是“工资条”。
资源AI然后查找 AI处理工资单 在下面 AI 操作。在节点中搜索“工资单”将找不到它。

AI-处理工资单与 AI文档解析器:我应该使用哪个?

两者都读取文档并返回结构化数据。区别在于数据模式是否预先确定。

AI处理工资单对比 AI-文档解析器
输出形状固定的工资核算方案,每次运行都使用相同的键无论你如何定义每个文档类型
准备工作选择操作并开始请描述您想要的字段
最适合大量存根和工资单未采取任何行动的文件
薪资字段已命名并已输入你给自己起名字。
哪个 vs 哪个选择文件是否为工资单。在其他情况下选择

如果您的文件是工资单,那么此操作最为便捷:工资相关的词汇表已内置。请直接使用 AI-文档解析器 当格式本身没有专门的操作时。

我该如何设置节点?

添加 PDF4me 节点到你的 n8n 工作流程,设置 资源AI然后选择 AI处理工资单AI 运营首次设置请参见 n8n 集成指南

先决条件: 一个 PDF4me API 凭证,一种 n8n 工作流程,以及工资单作为 PDFPNGJPG, 或者 JPEG

n8n 中的 AI 处理工资单参数面板,显示“资源”设置为“AI”、“AI 操作”下拉菜单、输入字段和“自定义字段”集合。
节点面板。“自定义字段”是一个初始为空的添加项集合,而不是一个需要手动输入内容的列表。

参数有哪些?

这个面板很简洁。大部分工作是选择输入模式和正确命名文件。

范围类型必需的描述例子
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

注意:这三种输入模式互斥。

二进制数据 Base64 String, 和 URL 每个节点都会显示各自的源字段,只有与您选择的模式匹配的字段才需要赋值。如果之前的节点已经获取过文件,则通常会选择二进制数据。

:::

该节点返回什么?

该回复包含了所有与薪资相关的内容。 payStubData 并同时保存工作元数据。

场地类型描述例子
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

工资单数据内部

场地类型团体描述例子
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 行动反应

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

典型配置

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.

实用技巧

  • 从拔出的牙根残端落地的那一刻起,就应将其视为敏感部位进行处理。 employeeIdSsn工资数据和家庭住址会同时出现在一个对象中。在存储任何内容之前,请确定下游系统真正需要哪些信息,并删除其余信息。
  • 永远不要分叉 success 独自的。 它报告的是通话已完成,而不是读数是否良好。 fallbackUsedwarnings 这些字段可以告诉你质量如何。
  • 谨防出现歧义的零值。 因为未读号码会返回为 0类似“标记净工资超过总工资的存根”这样的规则会悄悄地忽略那些从未读取过总工资的存根。请先检查该数字是否大于零。
  • 注意两个付款日期关键信息。 payDateStrPayDate 两者都出现在响应中,第二个字母首字母大写。请选择其中一个并始终使用,因为在映射过程中,字母不一致很容易被忽略。
  • 使用自定义字段添加特定于雇主的条目。 津贴、轮班津贴和工会会费因组织而异,而这正是该项收费的用途所在。
  • 给它提供最干净的副本。 原创 PDF 或者说,平面扫描比从侧面拍摄的手机照片能提供更多可供提取的信息。

速查表

目标设置或领域
找到动作 n8nResource = AIAI Operations = AI处理工资单
使用来自先前节点的文件Input Data Type = 二进制数据, Input Binary Field = data
处理托管文档Input Data Type = URL, 然后 Pay Stub URL
正确检测格式Document Name 带有真正的扩展
捕获非标准线在“添加自定义字段”下 Custom Fields
决定是否相信一次跑步fallbackUsedwarnings
核心工资总额grossPaynetPayytdGrossPay

常见问题

该操作实际名称是什么? n8n

在节点中 AI处理工资单。 放 资源AI然后选择 AI处理工资单AI 运营 下拉菜单。 word 文档中出现了“工资单”字样。 URL 在日常用法中,但不在…… n8n 界面本身,因此请在下拉菜单中搜索“工资单”。

如何判断提取结果是否可靠?

有两个场承载着该信号。 warnings 提取过程中遇到了数组列表数据质量问题,以及 fallbackUsed 指示是否需要二次萃取方法。处理任何结果。 fallbackUsedtrue或者在哪里 warnings 包含的内容不仅仅是例行的完成说明,还需要人工审核,才能将数据用于工资发放或贷款决策。

这样做是否使我的工资发放流程符合规定?

不。此操作是从文档中提取数据。工资单包含工资数字,通常还包含员工标识符或部分社会保障号码。 Number因此,提取这些数据会将数据置于您现有的隐私和雇佣记录义务框架内。这些义务属于您的系统和司法管辖区,而非本节点,使用这些数据不会改变您的任何立场。如果您不确定哪些规定适用,请参阅…… 美国劳工部关于记录保存的指导意见 是工资记录的一个合理起点。

工资单上缺少的字段会怎么样?

它们会以空字符串或零的形式返回,而不是被排除在响应之外。 0socialSecurityTax 或者 overtimeHours 因此,这意味着文档上的实际值为零,或者该值无法读取。请检查相应的 warnings 输入数值而不是假设数值是真实的,特别是对于任何你打算进行计算的字段。

我可以提取与我的雇主相关的特定字段吗?

是的。 自定义字段 节点中的集合允许您在标准模式之外添加命名键,这样您就可以捕获诸如轮班津贴、地区补助或工会会费等仅出现在您组织存根中的信息。每个您想要返回的值添加一个条目。

它可以读取哪些文件格式?

PDFPNGJPG, 和 JPEG。 放 文档名称 文件名必须包含文件的真实扩展名,因为扩展名才能告诉程序正在处理的文件格式。拍摄的存根照片可以,平面扫描件或原件也可以。 PDF 与从侧面拍摄的手机照片相比,这使得提取数据有更多可供处理的信息。

有关的 AI 行动 n8n

在其他平台上执行相同任务

用例

工资数据录入

读取工资发放机构或员工上传的工资单,并将数字直接写入财务系统,对于置信度信号标记的异常情况,则保留手动输入。

收入和就业情况核实

提取贷款、租赁或福利检查的总收入、净收入、雇主名称和年初至今的总额,以便审核人员可以根据结构化数值进行工作,而不是阅读每份文件。

工资核对和审计

将存根内容与人力资源或会计系统记录的内容进行比较,并仅显示两者不一致的行。

延伸阅读

获取帮助