Series 02 Episode 04 🚀 n8n in Practice 🚀

Illustration of an email attachment turned into a table and uploaded to the cloud

A client sends an invoice as a PDF or a price list in Excel. You want to pull the data out of the file and save it to a spreadsheet, but the next node insists there's no file at all. In episode 04 of Series 01 we said a file lives in binary. Now it's time to actually work with it.

  1. Where the file comes from: in Gmail (the Get operation or Gmail Trigger) turn on Download Attachments — attachments land in binary as attachment_0, attachment_1 and so on. In HTTP Request, set Options: Response → Response Format: File, and the file ends up in the data field.
  2. Extract From File: pulls data out of a file into JSON. You pick an operation, e.g. Extract From PDF, Extract From XLSX or Extract From CSV, and in Input Binary Field you enter the name of the field holding the file, e.g. attachment_0.
  3. Convert to File: works the other way around — it turns items into a file, e.g. Convert to CSV or Convert to XLSX. You can email the result right away or save it.
  4. Saving: Google Drive (Upload) or Read/Write Files from Disk on your own server. In both you point to the binary field the file should come from.

Watch out for:

  • The most common mistake is the wrong binary field name. Before you type “data”, open the Binary tab in the OUTPUT panel and check what the field is really called.
  • A scanned PDF is an image, not text. Extract From PDF will return empty text — this is where you need OCR or an AI model.
  • Large files are kept in memory by default. On your own instance, set N8N_DEFAULT_BINARY_DATA_MODE=filesystem so a workflow with hundreds of PDFs doesn't take n8n down.

Rule of thumb: before you connect the next node, check the Binary tab to see that the file is there and what its field is called.

Upcoming meetups and workshops are listed in the Events section.

← Back to the knowledge baseShare on LinkedIn (opens in a new tab)