n8n's Extract From File returns empty text on a scanned PDF. parserkit reads it and checks the totals for $0.02 a page, 50 pages free. A 1-page scan comes back in about 23 seconds, well inside the 60 second wait.

Parse invoices and scanned PDFs in n8n

Import the workflow below and its HTTP Request node posts each form upload or emailed PDF to parserkit, polls on 202, waits out a 429 and resends, then hands you checked JSON. Pick your own credentials after the import.

IntegrationsUpdated

n8n

Set it up in n8n

  1. Add your key as a credential

    In n8n, create a Header Auth credential. Set Name to Authorization and Value to Bearer followed by your parserkit API key.

  2. Post the file

    Add an HTTP Request node: Method POST, URL https://api.parserkit.com/v1/parse?wait=60, Authentication Generic Credential Type, then Header Auth. Turn on Send Body, pick Form-Data, add an n8n Binary File field named file that reads the input field data, and a Form Data field preset set to invoice.

    Parse with parserkit (node)
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.parserkit.com/v1/parse?wait=60",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {"parameterType": "formBinaryData", "name": "file", "inputDataFieldName": "data"},
            {"name": "preset", "value": "invoice"}
          ]
        },
        "options": {"response": {"response": {"fullResponse": true, "neverError": true}}}
      },
      "name": "Parse with parserkit",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "credentials": {
        "httpHeaderAuth": {"id": "REPLACE_WITH_YOUR_CREDENTIAL", "name": "parserkit API key"}
      }
    }
  3. Keep every answer

    Under Options, Response, turn on Include Response Headers and Status and Never Error. The next node then sees statusCode, the headers and the JSON under body, also on a 429 or a 400.

  4. Route on the answer

    A Switch sends queued and running to GET /v1/jobs/{id}?wait=60 and back to the Switch, succeeded to an IF on verification_status, a 429 to a wait of Retry-After seconds and a resend, and anything else to Stop and Error with the error code and message.

  5. Use the fields

    The parsed fields sit under $json.body.data, for example $json.body.data.grand_total. Let verified jobs go on to your next step and send the rest to a person.

Example

A scanned invoice through the workflow's form

Here is a real run: a 1-page scanned invoice uploaded through the workflow's form. It came back verified in about 23 seconds.

POSTapi.parserkit.com/v1/parse?wait=60

curl
curl "https://api.parserkit.com/v1/parse?wait=60" \
  -H "Authorization: Bearer $PARSERKIT_API_KEY" \
  -F file=@invoice-hollins-scan-0531.pdf \
  -F preset=invoice
response.jsonverified
{
  "id": "job_zmrzd5b93jktqyltviju",
  "status": "succeeded",
  "source": "api",
  "preset": "invoice",
  "file": {
    "name": "invoice-hollins-scan-0531.pdf",
    "bytes": 199598,
    "kind": "pdf"
  },
  "pages": 1,
  "digital_pages": 0,
  "ocr_pages": 1,
  "repaired_fields": 0,
  "cost_usd": 0.02,
  "verification_status": "verified",
  "duplicate": null,
  "outputs": [
    {
      "name": "output.json",
      "bytes": 12841
    },
    {
      "name": "output.xlsx",
      "bytes": 10439
    },
    {
      "name": "output.csv",
      "bytes": 747
    },
    {
      "name": "quickbooks.csv",
      "bytes": 678
    },
    {
      "name": "xero.csv",
      "bytes": 1450
    }
  ],
  "webhook_status": null,
  "error": null,
  "created_at": "2026-11-07T09:19:49.363Z",
  "finished_at": "2026-11-07T09:20:12.018Z",
  "data": {
    "invoice_number": "HB-0531",
    "issue_date": "2026-11-04",
    "due_date": "2026-12-04",
    "currency": "USD",
    "vendor": {
      "name": "Hollins Brook Plumbing & Heating"
    },
    "customer": {
      "name": "Dana Whitcomb"
    },
    "line_items": [
      {
        "description": "Labor, licensed plumber, hours",
        "quantity": 3.5,
        "unit_price": 95,
        "total": 332.5
      },
      {
        "description": "Pipe insulation, 6 ft",
        "quantity": 6,
        "unit_price": 4.25,
        "total": 25.5
      }
    ],
    "subtotal": 583.3,
    "tax_total": 9.65,
    "grand_total": 592.95,
    "amount_due": 442.95
  },
  "verification": {
    "status": "verified",
    "math_balanced": true,
    "coverage": {
      "values": 46,
      "checked": 46
    },
    "checks": [
      {
        "kind": "line_total",
        "path": "line_items[0].total",
        "status": "pass",
        "expected": 332.5,
        "actual": 332.5,
        "difference": 0,
        "message": "quantity x unit price"
      },
      {
        "kind": "sum",
        "path": "grand_total",
        "status": "pass",
        "expected": 592.95,
        "actual": 592.95,
        "difference": 0,
        "message": "the line totals + tax"
      }
    ]
  },
  "warnings": []
}

Real response from . Trimmed to 2 of 6 line items and 2 of 11 checks, with addresses, bounding boxes and file links left out.

What the workflow does with each answer

Answers the API gave in our runs, and the Switch branch each one takes.

What the workflow does with each answer
AnswerWhat it meansBranch
200, status succeededDone inside the 60 second waitSucceeded, then Verified? on verification_status
202, status queued or runningStill working; Location and Retry-After 2 come with itStill running: GET /v1/jobs/{id}?wait=60, then the Switch again
200 from the GET, status runningStill working after that waitStill running, once more
429 RATE_LIMITED2 jobs already running on an account without added credit; no job was madeBusy, retry: wait Retry-After seconds, send the file again
400, 401, 413, 415 or 422A bad request, key, size or file; the body names the codeFailed: Stop and Error with the code and message
200, status failedThe job failed and costs 0Failed

Source: parserkit errors and limits

Why Extract From File comes back empty

n8n's docs list Extract From PDF as "Extract fields from Portable Document Format files." On our 1-page scanned invoice it returned numpages 1 and an empty text field. On a text PDF it returned plain lines of text, with no fields and no table.

That happens because Extract From PDF reads each page's text layer with pdf.js getTextContent and does no OCR. (Also, if you add the Max Pages option and leave it at 0, the node returns empty text even on a text PDF.) To get checked JSON from scans and text PDFs, send the binary file to parserkit with an HTTP Request node instead.

Extract From PDF on our scan, n8n 2.46.6
{
  "numpages": 1,
  "numrender": 1,
  "info": {
    "PDFFormatVersion": "1.4",
    "Language": null,
    "EncryptFilterName": null,
    "IsLinearized": false,
    "IsAcroFormPresent": false,
    "IsXFAPresent": false,
    "IsCollectionPresent": false,
    "IsSignaturesPresent": false,
    "Creator": "Chromium",
    "Producer": "Skia/PDF m147",
    "CreationDate": "D:20261021090000+00'00'",
    "ModDate": "D:20261021090000+00'00'"
  },
  "text": "",
  "version": "6.3.289"
}

PDFs from email

In the email branch, the Email Trigger (IMAP) node has Download Attachments turned on, which saves files as binary fields attachment_0, attachment_1, and so on. The Code node splits those out into one item per PDF before sending them to the HTTP Request node. In our email run, the trigger picked up a message with a 1-page invoice PDF attached, and the parse came back verified in about 17 seconds, for $0.02.

One item per PDF (Code node)
// One item per PDF: works for the form upload and for email attachments
const out = [];
for (const item of $input.all()) {
  for (const file of Object.values(item.binary ?? {})) {
    if (file.mimeType !== 'application/pdf') continue;
    out.push({
      json: { file_name: file.fileName, subject: item.json.subject ?? null, from: item.json.from ?? null },
      binary: { data: file },
    });
  }
}
return out;

Limits that shape the workflow

The numbers behind the Switch and the waits:

  • The POST waits up to 60 seconds. Past that you get 202 and poll GET /v1/jobs/{id}?wait=60, which answers 200 while the job runs.
  • 2 jobs run at once until you add credit, 12 after. A third gets 429 with Retry-After and no job is made, so sending the file again is safe.
  • Files go up to 25 MB as multipart and 100 MB by file_url or /v1/uploads, up to 250 pages a job.
  • The HTTP Request node waits 5 minutes when no Timeout is set, so the 60 second wait fits.
  • Failed jobs and exact duplicates cost 0. Codes and retry rules are in errors and limits.

Import the workflow

The workflow has two triggers (a form upload and an IMAP email trigger), a Code node that makes one item per PDF, the HTTP Request node, a Switch on the answer, an IF on verification_status, a Wait for Retry-After branch, and a Stop and Error node. After you import it, pick your own Header Auth credential in the two HTTP Request nodes and your IMAP credential in the email trigger.

parserkit-n8n-workflow.json
{
  "name": "parserkit: parse PDFs from a form or email",
  "nodes": [
    {
      "id": "7b0e8a52-6a0c-4f0e-9a51-1d2a3c4b5e01",
      "name": "Upload a PDF",
      "webhookId": "5d9c3b1e-0f4a-4c8e-b6d2-7a1e9f3c2b10",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.3,
      "position": [0, 0],
      "parameters": {
        "formTitle": "Parse a PDF with parserkit",
        "formDescription": "Upload an invoice, receipt or bank statement as a PDF, scans too.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Document",
              "fieldType": "file",
              "multipleFiles": false,
              "acceptFileTypes": ".pdf",
              "requiredField": true
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "7b0e8a52-6a0c-4f0e-9a51-1d2a3c4b5e02",
      "name": "New email (IMAP)",
      "type": "n8n-nodes-base.emailReadImap",
      "typeVersion": 2.1,
      "position": [0, 220],
      "parameters": {
        "postProcessAction": "read",
        "format": "resolved",
        "dataPropertyAttachmentsPrefixName": "attachment_",
        "options": {}
      },
      "credentials": {
        "imap": {"id": "REPLACE_WITH_YOUR_CREDENTIAL", "name": "Your mailbox (IMAP)"}
      }
    },
    {
      "id": "7b0e8a52-6a0c-4f0e-9a51-1d2a3c4b5e03",
      "name": "One item per PDF",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [240, 100],
      "parameters": {
        "jsCode": "// One item per PDF: works for the form upload and for email attachments\nconst out = [];\nfor (const item of $input.all()) {\n  for (const file of Object.values(item.binary ?? {})) {\n    if (file.mimeType !== 'application/pdf') continue;\n    out.push({\n      json: { file_name: file.fileName, subject: item.json.subject ?? null, from: item.json.from ?? null },\n      binary: { data: file },\n    });\n  }\n}\nreturn out;"
      }
    },
    {
      "id": "7b0e8a52-6a0c-4f0e-9a51-1d2a3c4b5e04",
      "name": "Parse with parserkit",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [480, 100],
      "parameters": {
        "method": "POST",
        "url": "https://api.parserkit.com/v1/parse?wait=60",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {"parameterType": "formBinaryData", "name": "file", "inputDataFieldName": "data"},
            {"name": "preset", "value": "invoice"}
          ]
        },
        "options": {"response": {"response": {"fullResponse": true, "neverError": true}}}
      },
      "credentials": {
        "httpHeaderAuth": {"id": "REPLACE_WITH_YOUR_CREDENTIAL", "name": "parserkit API key"}
      }
    },
    {
      "id": "7b0e8a52-6a0c-4f0e-9a51-1d2a3c4b5e05",
      "name": "Job status",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [720, 100],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ ['queued', 'running'].includes($json.body.status) }}",
                    "rightValue": "",
                    "operator": {"type": "boolean", "operation": "true", "singleValue": true},
                    "id": "c1"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Still running"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.body.status === 'succeeded' }}",
                    "rightValue": "",
                    "operator": {"type": "boolean", "operation": "true", "singleValue": true},
                    "id": "c2"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Succeeded"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.statusCode === 429 }}",
                    "rightValue": "",
                    "operator": {"type": "boolean", "operation": "true", "singleValue": true},
                    "id": "c4"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Busy, retry"
            }
          ]
        },
        "options": {"fallbackOutput": "extra", "renameFallbackOutput": "Failed"}
      }
    },
    {
      "id": "7b0e8a52-6a0c-4f0e-9a51-1d2a3c4b5e06",
      "name": "Wait for the job",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [960, -60],
      "parameters": {
        "url": "=https://api.parserkit.com/v1/jobs/{{ $json.body.id }}?wait=60",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {"response": {"response": {"fullResponse": true, "neverError": true}}}
      },
      "credentials": {
        "httpHeaderAuth": {"id": "REPLACE_WITH_YOUR_CREDENTIAL", "name": "parserkit API key"}
      }
    },
    {
      "id": "7b0e8a52-6a0c-4f0e-9a51-1d2a3c4b5e07",
      "name": "Verified?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [960, 100],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "leftValue": "={{ $json.body.verification_status }}",
              "rightValue": "verified",
              "operator": {"type": "string", "operation": "equals"},
              "id": "c3"
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "7b0e8a52-6a0c-4f0e-9a51-1d2a3c4b5e08",
      "name": "Use the data",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [1200, 20],
      "parameters": {}
    },
    {
      "id": "7b0e8a52-6a0c-4f0e-9a51-1d2a3c4b5e09",
      "name": "Send to a person",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [1200, 180],
      "parameters": {}
    },
    {
      "id": "7b0e8a52-6a0c-4f0e-9a51-1d2a3c4b5e10",
      "name": "Stop with the API error",
      "type": "n8n-nodes-base.stopAndError",
      "typeVersion": 1,
      "position": [960, 260],
      "parameters": {
        "errorMessage": "={{ $json.body.error ? $json.body.error.code + ': ' + $json.body.error.message : 'job ' + $json.body.id + ' ended as ' + $json.body.status }}"
      }
    },
    {
      "id": "7b0e8a52-6a0c-4f0e-9a51-1d2a3c4b5e11",
      "name": "Wait for Retry-After",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [960, 420],
      "parameters": {
        "amount": "={{ Number($json.headers['retry-after'] ?? 10) }}",
        "unit": "seconds"
      }
    },
    {
      "id": "7b0e8a52-6a0c-4f0e-9a51-1d2a3c4b5e12",
      "name": "Take the file again",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [1200, 420],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "return { json: {}, binary: $('One item per PDF').item.binary };"
      }
    }
  ],
  "connections": {
    "Upload a PDF": {"main": [[{"node": "One item per PDF", "type": "main", "index": 0}]]},
    "New email (IMAP)": {"main": [[{"node": "One item per PDF", "type": "main", "index": 0}]]},
    "One item per PDF": {
      "main": [[{"node": "Parse with parserkit", "type": "main", "index": 0}]]
    },
    "Parse with parserkit": {"main": [[{"node": "Job status", "type": "main", "index": 0}]]},
    "Job status": {
      "main": [
        [{"node": "Wait for the job", "type": "main", "index": 0}],
        [{"node": "Verified?", "type": "main", "index": 0}],
        [{"node": "Wait for Retry-After", "type": "main", "index": 0}],
        [{"node": "Stop with the API error", "type": "main", "index": 0}]
      ]
    },
    "Wait for Retry-After": {
      "main": [[{"node": "Take the file again", "type": "main", "index": 0}]]
    },
    "Take the file again": {
      "main": [[{"node": "Parse with parserkit", "type": "main", "index": 0}]]
    },
    "Wait for the job": {"main": [[{"node": "Job status", "type": "main", "index": 0}]]},
    "Verified?": {
      "main": [
        [{"node": "Use the data", "type": "main", "index": 0}],
        [{"node": "Send to a person", "type": "main", "index": 0}]
      ]
    }
  },
  "settings": {"executionOrder": "v1"}
}

FAQ

Common questions

Why does n8n's Extract From File return empty text for a scanned PDF?

Extract From File's Extract From PDF operation reads the page's text layer using pdf.js getTextContent and does no OCR. A scanned PDF has no text layer, so the node returns numpages 1 and an empty text field. Even on a text PDF, adding the Max Pages option and leaving it at 0 makes it return empty text. parserkit reads the scan with OCR and returns the fields with every total checked.

How do I parse PDF email attachments in n8n?

Turn on Download Attachments in the Email Trigger (IMAP) node so it saves attachments to binary fields named attachment_0, attachment_1, and so on. Use the Code node in our workflow to split those into one item per PDF, and send each one from an HTTP Request node as multipart/form-data using an n8n Binary File field.

What happens when a job takes longer than 60 seconds?

POST /v1/parse waits up to 60 seconds, and if a job is still running it answers 202 with a Location header and Retry-After 2. Our workflow then calls GET /v1/jobs/{id}?wait=60 in its Wait for the job node, which holds the answer up to 60 seconds while the job runs. We tested this with ?wait=0: the POST answered 202 with status queued, Location /v1/jobs/{id} and Retry-After 2, and the GET that followed returned the job succeeded and verified.

What does a 429 from parserkit mean in this workflow?

A 429 RATE_LIMITED error with Retry-After 10 means your account hit its limit of running jobs. We got this when we sent a third job while 2 were running; an account starts with 2 jobs at once, and accounts that added credit run up to 12 at once. A 429 never creates a job, so sending the file again after waiting is safe.

What does it cost?

It costs $0.02 a page, and $0.01 a page past 5,000 pages in a UTC month. Your first 50 pages are free, and failed jobs and exact duplicates cost 0.

Start free

Send us your worst scan

Your first $1 is free: 50 pages with every check and export, no card.

Crumpled receipts and a printed bank statement with one line marked in green highlighter, on a dark desk