Merge multiple Excel files using n8n action
PDF4me Merge Excel Files stitches together any number of workbooks from your n8n workflow. Provide a document list (each with file content, filename, optional worksheet filters, and ordering), then pick an output format (XLSX, XLS, PDF, or CSV). PDF4me automatically handles worksheet name collisions by appending numeric suffixes.
Setup
Add the PDF4me “Merge Files” node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.
Prerequisites
- PDF4me API credentials
- n8n workflow access
Configuration
- Add the PDF4me node to the workflow
- Select the "Merge multiple Excel files" action
- Build the
Documentsarray and choose the output format

Parameters
Important: Parameters marked with an asterisk (***) are required. Each entry inside
Documentsmust includeFileContent(base64) andFilename.
| Parameter | Type | Description | Example |
|---|---|---|---|
| File Name*** | String | Logical name for the primary workflow file (used as reference). | merged.xlsx |
| Documents*** | Array | Array of merge items. Each item requires: • FileContent (Base64) – workbook bytes • Filename – e.g., north.xlsx• SortPosition – optional number; lower values merged first • WorksheetsToMerge – optional string array of worksheet names to include; empty = all sheets | [{"FileContent":"...","Filename":"north.xlsx","SortPosition":1,"WorksheetsToMerge":["Summary"]}] |
| Output Format | String | XLSX (default), XLS, PDF, or CSV. CSV exports only the first worksheet. | XLSX |
| Output File Name | String | Name (without extension) for the merged result. Default merged. | Quarterly_Report |
| Binary Data Output Name*** | String | Binary slot to store the merged document. | document |
Use
n8nexpressions or the Function node to assemble theDocumentsarray when merging dynamic file counts.
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| fileName | String | Merged workbook filename - The name of the output merged Excel file | merged-workbook.xlsx |
| fileSize | Number | File size in bytes - The size of the merged Excel file in bytes | 440413 |
| success | Boolean | PDF4me operation status - Boolean flag indicating the success or failure of the file merging process. PDF4me returns true for successful operations and false for any errors | true |
| outputFormat | String | Output file format - The format of the merged output file. Values: "XLSX", "XLS", "PDF", "CSV" | XLSX |
| filesCount | Number | Number of files merged - The total count of Excel files that were merged | 2 |
| filesMerged | Array | Array of merged file details - Array of objects containing information about each file that was merged, including filename, sortPosition, and worksheets | [{"filename": "file1.xlsx", "sortPosition": 1, "worksheets": "all"}] |
| message | String | Operation message - Descriptive message indicating the result of the file merging operation, including the number of files merged and output format | Successfully merged 2 Excel file(s) into XLSX format |
N8N Action Response
The PDF4me Merge multiple Excel files API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:
- JSON
- Table
- Schema
- Binary
JSON Response Format
The raw JSON response from the API:
[
{
"fileName": "merged-workbook.xlsx",
"fileSize": 440413,
"success": true,
"outputFormat": "XLSX",
"filesCount": 2,
"filesMerged": [
{
"filename": "file1.xlsx",
"sortPosition": 1,
"worksheets": "all"
},
{
"filename": "file2.xlsx",
"sortPosition": 1,
"worksheets": "all"
}
],
"message": "Successfully merged 2 Excel file(s) into XLSX format"
}
]
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| fileName | merged-workbook.xlsx |
| fileSize | 440413 |
| success | true |
| outputFormat | XLSX |
| filesCount | 2 |
| filesMerged | Array of merged file objects |
| message | Successfully merged 2 Excel file(s) into XLSX format |
Files Merged Array Details:
| Parameter | Value |
|---|---|
| filename | file1.xlsx |
| sortPosition | 1 |
| worksheets | all |
| Parameter | Value |
|---|---|
| filename | file2.xlsx |
| sortPosition | 1 |
| worksheets | all |
Schema View
The data structure and types of the response:
1 item
fileName: T merged-workbook.xlsx
fileSize: # 440413
success: ☑ true
outputFormat: T XLSX
filesCount: # 2
filesMerged: [] Array
[0]: {} Object
filename: T file1.xlsx
sortPosition: # 1
worksheets: T all
[1]: {} Object
filename: T file2.xlsx
sortPosition: # 1
worksheets: T all
message: T Successfully merged 2 Excel file(s) into XLSX format
Type Indicators:
T= String (Text)#= Number☑= Boolean[]= Array{}= Object
Binary Data View
The actual Excel document file data and metadata:
data
─────────────────────────────
File Name: merged-workbook.xlsx
File Extension: xlsx
Mime Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
File Size: 440 kB
Binary Data Access:
- n8n Binary Object:
$binary.data.data - Base64 Content: Available for direct use
- File Operations: Ready for download, email, or storage
Use Cases
- Regional report consolidation: Merge regional workbooks into one national report ordered by
SortPosition. - Department submissions: Combine department worksheets while only keeping specific tabs (e.g.,
Summary,KPIs). - Distribution-ready bundles: Merge multiple Excel sources then convert to PDF for leadership review.