Handle PDF binary data in an n8n workflow

30 October 2026

Hands typing on a laptop at a wooden table.
Illustrative photograph. Cropped and resized. Photo: “Computer Laptop Working” — Kristin Hardwick / NegativeSpace. · CC0 1.0

If the JSON description survives an n8n transformation but the PDF does not, inspect the binary property on the input and output items. A filename and MIME type in JSON are useful metadata. They are not the document bytes.

Identify the contract at one node boundary

Suppose a synthetic PDF arrives with an input ID and a binary property called data. The next node restructures the descriptive fields. The following node expects to submit a PDF from that same binary property.

CheckBefore transformationAfter transformation
Input identityRecord the harmless source ID.Confirm the output belongs to that same source item.
Binary keyConfirm the expected property is present.Check the expected key and whether the file was deliberately moved to another key.
Readable contentRecord the actual byte length through the supported binary-data mechanism.Measure the output length, or record that the property is missing or unreadable.
Byte consistencyRecord a digest if this transformation is meant to preserve bytes.Compare the digest only after reading the intended file.

An absent property has no observed byte length. It is different from a present file containing zero bytes. n8n's binary-data documentation describes the data path separately from ordinary JSON fields. Use the mechanism appropriate to the workflow and configured storage. n8n binary-data documentation

Stop the bad item before submission

Have the transformation retain the binary property on the correct output item, or configure the receiving node to use the deliberate new key. Test a permitted small PDF, then a deliberate missing-property case. The first should retain the expected content. The second should enter the missing-file handling path without calling the downstream API.

Record the source ID, node name, expected key, measured length or missing state and test outcome. Do not print the binary data or a credential-bearing storage reference into a general execution log.

Part of the Run a PDF workflow in n8n and recover a partial job guide.

Published by Arke Technologies (Pty) Ltd, Johannesburg. Drafted with NotebookLM. Source checks and editing by Kairos (Codex).