Invoice OCR scanning - it does work in Chat GPT and Zapier but doesn't work in N8N

Describe the problem/error/question

My ChatGPT is able to scan my PDF invoices and then put some info about them in Google Spreadsheet but I don’t know how to use it in N8N. I made such an automation in Zapier but cannot create it in N8N.

Here is my automation in Zapier:

I want to create same functionality in N8N.
My workflow is here:

Tried to use AI Agent connected with OpenAI Chat Model (latest 4o) and also tried to chat with a model directly but it acts like it can’t scan PDF files - gives me some random invoice output data (invoice number, net value, etc.)

Is it because the API? As far I know Zapier use Responses API and N8N use Chat Completions API.

My invoices are PDFs - some of them are original PDFs from suppliers and some of them are PDF scanned by Adobe Scan.

Is there something else I can try?

Hi there, i think on the ai agents, theres an option you need to enable first

I believe the option is “Automatically Passthrough Binary Data” try turning tht on

Did you turn on the Automatically Passthrough Binary Images? Cause if you try to do the OCR with image, you can try to activate that option.

Nothing changed.
It still cannot scan proper invoice data.

What type of the data? Is your data a PDF file, Image, or what?

Yes, PDF file.

Yes it is PDF file with text in it (it is not a scan).

Try with directly using OpenAI node instead of using AI Agent node

I had to add another step - extract from PDF. Now it works fine.

Is it possible to skip Extract from PDF step? Can ChatGPT in N8N handle it?

As what I said before. If you just working with OpenAI and not using memory etc., you can use directly to OpenAI node. There’s so much option when you type OpenAI in node search bar.

  1. After the “Download file” node, add a PDF Extract node (community node) if your invoices are native PDFs with selectable text.
  • If that node isn’t available, use a Function node with the pdf-parse package to extract the text.
  1. For scanned/image-based PDFs, use Tesseract OCR (community node) or an HTTP Request node to send the file to an OCR API like:
  • OCR.Space
  • Google Vision OCR
  • AWS Textract
    (You’ll need to send the file as base64 or form-data, depending on API requirements.)
  1. Take the extracted text and pass it to the AI Agent or OpenAI Chat Model like this:
    4.Prompt:*
    "You are reading raw text from an invoice. Extract and return the invoice number, issue date, supplier name, and total amount from the text below:\n\n[PASTE TEXT HERE]"
  2. Use a “Set” node or Structured Output Parser to format the extracted values from the response.
  3. Send that clean data to the “Append row in sheet” node.

The key is: OpenAI in n8n can’t read the PDF itself. You must extract the text or OCR it first, then pass the clean text to the model.

That’s the point!
Thank you.
Problem solved.