Add Attachment to PDF in n8n
Add Attachment to PDF is a PDF4me node action in n8n that embeds one or more files inside a PDF, so a spreadsheet, image, archive, or second PDF travels with the document instead of alongside it. Use it to bundle supporting evidence with a contract, ship raw data next to a report, or package certificates with a compliance filing.
What this node does
PDF4me: Add Attachment To PDF takes a host PDF from Binary Data, a Base64 String, or a URL, then embeds each file you list under Attachments inside it as a separate object. Unlike merging, the attached files keep their own format and filename and can be opened or saved out individually by the recipient. Each attachment can come from a different source, so a binary file from an earlier node and a file fetched from a URL can be embedded in the same run.
Authenticating Your API Request
Every PDF4me node in n8n requires a valid Credential to connect with. Create or select one that holds your PDF4me API key so the workflow can authenticate attachment requests securely.
Important Facts You Should Not Miss

PDF4me Add Attachment To PDF parameters panel in n8n, with the Attachments collection empty before the first entry is added
Attaching vs Merging vs Zipping
Three ways to deliver several files as one thing, with different consequences for the recipient.
| Approach | What the recipient gets | Best fit |
|---|---|---|
| Add Attachment to PDF | One PDF that opens normally, with the extra files available in the attachments panel | Supporting material that must stay in its original format, such as a spreadsheet or an archive |
| Merge PDFs | One continuous document where all pages read in sequence | Content that genuinely belongs together as a single readable document |
| Zip the files together | An archive that must be unpacked before anything can be read | Bulk transfer where nothing needs to be readable without extracting first |
What Parameters Does Add Attachment to PDF Need?
Required: Action, Input Data Type, the field matching that input type, Output File Name, Document Name, and at least one entry under Attachments. Binary Data Output Name and Custom Profiles carry working defaults.
| Parameter | Required | What it does | Example |
|---|---|---|---|
| Action | Required | Selects the PDF4me node action to run. Choose Add Attachment To PDF. | Add Attachment To PDF |
| Input Data Type | Required | Format of the host PDF input. Choose Binary Data (from a previous node), Base64 String, or URL. | Binary Data |
| Input Binary Field | Conditional | Name of the binary property on the incoming n8n item that holds the host PDF. Required when Input Data Type is Binary Data. Defaults to data. | data |
| Base64 Document Content | Conditional | Base64-encoded content of the host PDF. Required when Input Data Type is Base64 String. | JVBERi0xLjQK... |
| File URL | Conditional | Publicly reachable HTTPS URL to the host PDF. Required when Input Data Type is URL. | https://example.com/contract.pdf |
| Output File Name | Required | Filename for the PDF returned with the files embedded. Include the .pdf extension. | document_with_attachments.pdf |
| Document Name | Required | Filename of the source PDF, used for reference and tracking on the request. | document.pdf |
| Attachments | Required | Collection of files to embed. Click Add Attachment once per file, then fill in the per-attachment fields listed below. | One entry per embedded file |
| Binary Data Output Name | Optional | Name of the binary property the output item exposes. Defaults to data. | data |
| Custom Profiles | Optional | Advanced Options field for extra processing settings, supplied in a JSON-like format. Leave blank unless you have a specific profile to apply. | { "preserveMetadata": true } |
Fields Inside Each Attachment Entry
Every entry you create with Add Attachment exposes its own set of fields.
| Parameter | Required | What it does | Example |
|---|---|---|---|
| Attachment Content Type | Required | How this particular attachment is supplied. Choose Binary Data, Base64 Content, or File URL. Each entry can differ. | Binary Data |
| Attachment Name | Required | Filename the embedded file will carry inside the PDF. Include the correct extension so readers can open it after extraction. | supporting_data.xlsx |
| Binary Field Name | Conditional | Name of the binary property holding this attachment. Required when Attachment Content Type is Binary Data. | data |
| Base64 Content | Conditional | Base64-encoded content of this attachment. Required when Attachment Content Type is Base64 Content. | SGVsbG8gV29ybGQ= |
| File URL | Conditional | Publicly reachable HTTPS URL to this attachment. Required when Attachment Content Type is File URL. | https://example.com/certificate.pdf |
Output Fields
A successful run returns one n8n item carrying the PDF with its embedded files.
| Field | Type | What it contains |
|---|---|---|
Binary (data) | Binary | The PDF with all listed files embedded, under Binary Data Output Name (default data). |
fileName | String | Generated filename, matching Output File Name. |
mimeType | String | MIME type of the output, always application/pdf. |
fileSize | Number | Size of the returned PDF in bytes, including the embedded files. |
attachmentCount | Number | Number of attachments successfully embedded. Compare it against your expected count to catch a silently skipped file. |
success | Boolean | True when the attachment operation completed, false on failure. Use it to branch error handling. |
message | String | Human-readable status message, carrying success confirmation or error detail. |
How Do I Set Up Add Attachment to PDF in n8n?
- Add PDF4me to your n8n workflow and choose the Add Attachment To PDF action.
- In Credential to connect with, select your PDF4me credential or click Create New Credential and paste your API key.
- Set Input Data Type to Binary Data (default), Base64 String, or URL and supply the matching host PDF field.
- Under Attachments, click Add Attachment once for each file, then set its Attachment Content Type, Attachment Name, and matching source field.
- Set Output File Name (must end in
.pdf) and Document Name for the source file. - Execute the node and route the returned PDF onward, checking
attachmentCountagainst the number of files you expected.
Typical Setups
Workflow ExamplesCommon n8n workflow patterns using Add Attachment to PDF.
- An invoice PDF is generated from billing data.
- Add Attachment to PDF embeds the matching receipts and the approval record.
- One file goes to accounts payable with its whole evidence trail inside it.
- A scheduled analytics report is rendered to PDF.
- Add Attachment to PDF embeds the underlying CSV export as a named attachment.
- Readers get the narrative and can pull the raw numbers out when they want to verify them.
- A contract is produced from a template on signature request.
- Add Attachment to PDF embeds certificates and schedules pulled from URLs.
- The counterparty receives a single self-contained document to sign.
- A Loop Over Items node gathers evidence files for a filing period.
- Add Attachment to PDF embeds each one into the cover filing document.
- The bundle is archived, and Extract Attachment From PDF can unpack it later on request.
Practical Tips
Cheat Sheet
| Field | Value |
|---|---|
| Action | Add Attachment To PDF |
| Input Data Type | Binary Data |
| Input Binary Field | data |
| Output File Name | document_with_attachments.pdf |
| Document Name | document.pdf |
| Attachments | One entry per file, added with Add Attachment |
| Attachment Content Type | Binary Data |
| Attachment Name | supporting_data.xlsx |
| Binary Data Output Name | data |
| Credentials | PDF4me API credential |