Simple PDF Comparison workflow for HR/Payroll

I want to build a workflow that I can upload 2 pdfs that have payroll data from 2 different systems. I want to cross reference the employee name on both and make sure the pay period amount is the same. If it’s not, I want to see the discrepancies.

I can successfully upload my 2 PDFs and run the code js snippet. It gets stuck on Extract to PDF node with “DOMMatrix is not defined”.

CURRENT WORKFLOW:

{
“nodes”: [
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 2,
“position”: [
0,
-20
],
“id”: “6210e47b-b485-4e62-8396-e4f98c12c7a5”,
“name”: “AI Agent”
},
{
“parameters”: {
“model”: {
“__rl”: true,
“mode”: “list”,
“value”: “gpt-4.1-mini”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [
0,
160
],
“id”: “a462e049-1f94-47b3-a8ab-eed566329ce5”,
“name”: “OpenAI Chat Model”,
“credentials”: {
“openAiApi”: {
“id”: “8qW4TpVQnWr2FGMx”,
“name”: “n8n free OpenAI API credits”
}
}
},
{
“parameters”: {},
“type”: “@n8n/n8n-nodes-langchain.memoryBufferWindow”,
“typeVersion”: 1.3,
“position”: [
100,
160
],
“id”: “79ad9b65-81d0-4827-a157-8af7fa3485b7”,
“name”: “Simple Memory”
},
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.chatTrigger”,
“typeVersion”: 1.1,
“position”: [
-260,
-180
],
“id”: “f90df22f-1930-47d8-9845-6d86d5b3a0d7”,
“name”: “When chat message received”,
“webhookId”: “37ede2d0-1808-439b-acfd-cff41ad1c0f0”
},
{
“parameters”: {
“operation”: “pdf”,
“options”: {}
},
“type”: “n8n-nodes-base.extractFromFile”,
“typeVersion”: 1,
“position”: [
-260,
-20
],
“id”: “bdc04d0a-65e2-4a86-b89b-19cdecb5f264”,
“name”: “Extract From Payroll”
},
{
“parameters”: {
“operation”: “pdf”,
“options”: {}
},
“type”: “n8n-nodes-base.extractFromFile”,
“typeVersion”: 1,
“position”: [
-260,
140
],
“id”: “cbcf7f88-6330-4a27-8a8a-401faea3eddb”,
“name”: “Extract from Timesheet”
},
{
“parameters”: {
“httpMethod”: “POST”,
“path”: “6adb8aae-0323-4725-afd1-5873f1fe81f7”,
“options”: {
“binaryPropertyName”: “data”,
“rawBody”: true
}
},
“type”: “n8n-nodes-base.webhook”,
“typeVersion”: 2,
“position”: [
-820,
60
],
“id”: “57902f50-edd6-451a-8bc9-944661183a76”,
“name”: “Webhook for Upload 2 PDFs”,
“webhookId”: “6adb8aae-0323-4725-afd1-5873f1fe81f7”
},
{
“parameters”: {
“jsCode”: “console.log(Object.keys(items[0].binary || {}));\nreturn items;\n”
},
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [
-640,
60
],
“id”: “a3de4da8-6bff-47e4-8b4e-f04a176ecd6d”,
“name”: “Code Log”
},
{
“parameters”: {
“jsCode”: “const binary = items[0].binary;\n\nif (!binary.data0 || !binary.data1) {\n throw new Error("Missing data0 or data1");\n}\n\nreturn [\n {\n json: { label: "payroll" },\n binary: { data: binary.data0 },\n },\n {\n json: { label: "timesheet" },\n binary: { data: binary.data1 },\n },\n];\n”
},
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [
-460,
60
],
“id”: “1b731827-c561-472c-8485-08210cd876f2”,
“name”: “Code for both PDFs”
}
],
“connections”: {
“OpenAI Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “AI Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Simple Memory”: {
“ai_memory”: [
[
{
“node”: “AI Agent”,
“type”: “ai_memory”,
“index”: 0
}
]
]
},
“When chat message received”: {
“main”: [
[
{
“node”: “AI Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“Extract from Timesheet”: {
“main”: [

]
},
“Webhook for Upload 2 PDFs”: {
“main”: [
[
{
“node”: “Code Log”,
“type”: “main”,
“index”: 0
}
]
]
},
“Code Log”: {
“main”: [
[
{
“node”: “Code for both PDFs”,
“type”: “main”,
“index”: 0
}
]
]
},
“Code for both PDFs”: {
“main”: [
[
{
“node”: “Extract From Payroll”,
“type”: “main”,
“index”: 0
},
{
“node”: “Extract from Timesheet”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “2d042e1752a13da8a6b013861aed876aabff3f80673b01cf1127cc581e05cf8a”
}
}

Hey @Sphere_X hope all is well and welcome to the community.

Please see Getting "DOMMatrix is not defined" error in Extract from PDF node - #2 by jabbson

Thanks Jabbson, I did see that after I first ran into the error. The bug report mentions hosted version numbers so I was unclear as to if the same bug is present on the online version. It would appear so. =)