Merge Word Documents using n8n action
PDF4me Merge Word Documents enables combining multiple Word documents into a single document through n8n automation workflows with advanced formatting and compliance options. This powerful document merging feature supports flexible document ordering, customizable formatting modes, compliance level settings, timezone metadata, and intelligent style handling with full control over merge behavior, perfect for document assembly, report consolidation, and content management workflows.
Setup
Add the PDF4me "Merge Word Documents" 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 PDF4me node to workflow
- Select "Merge Word Documents" action
- Configure input parameters (see below)

Parameters
Complete list of parameters for the Merge Word Documents action. Configure these parameters to control document merging behavior.
Important: Parameters marked with an asterisk (***) are required. The Documents array must contain at least one document with all required properties.
| Parameter | Type | Description | Example |
|---|---|---|---|
| Documents*** | Array | Array of Documents to Merge • Array of document objects to be merged, must contain at least one document • Documents are merged in SortPosition order • Each document object requires Filename, DocContent, and SortPosition | [{"Filename": "doc1.docx", "DocContent": "...", "SortPosition": 0}] |
| Documents[].Filename*** | String | Document Filename • Original filename of the document • Must include proper file extension (.docx, .doc) • Used for reference and processing | "document1.docx" |
| Documents[].DocContent*** | Base64 | Document Content • Base64-encoded content of the document • Map from previous action output or file upload • Must be valid Word document (.docx, .doc formats) | UEsDBBQABgAI... |
| Documents[].SortPosition*** | Number | Merge Order Position • Position in merge order (0-based or custom numbering) • Documents are merged in ascending SortPosition order • Lowest SortPosition becomes the base document • Must be unique within the Documents array | 0 |
| Documents[].FormatMode | String | Formatting Mode • KeepSourceFormatting - Preserves original formatting (default) • KeepDifferentStyles - Keeps different styles, merges similar ones • UseDestinationStyles - Uses formatting from the destination document | "KeepSourceFormatting" |
| Merge Options Time Zone | String | Document Timezone • Time zone for document metadata (e.g., "UTC", "Asia/Kolkata") • Added as custom document property • Default: null (no timezone metadata) | "UTC" |
| Merge Options Compliance Level | String | Document Compliance Level • ECMA - ECMA-376 2006 standard compliance • Transitional - ISO 29500:2008 Transitional compliance (default) • Strict - ISO 29500:2008 Strict compliance • Custom - Custom compliance level | "Transitional" |
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| fileName | String | Merged Word document filename - The name of the output merged Word document file | merged_document.docx |
| fileSize | Number | File size in bytes - The size of the merged Word document in bytes | 15605 |
| success | Boolean | PDF4me operation status - Boolean flag indicating the success or failure of the document merging operation. PDF4me returns true for successful operations and false for any errors | true |
| documentsMerged | Number | Number of documents merged - The total count of documents that were successfully merged into the final document | 2 |
| documentNames | Array | Array of merged document names - List of filenames of all documents that were merged, in the order they were merged | ["ab.docx", "xyz.docx"] |
| message | String | Operation message - Descriptive message indicating the result of the merge operation, including the number of documents merged | Successfully merged 2 documents |
N8N Action Response
The PDF4me Merge Word Documents 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_document.docx",
"fileSize": 15605,
"success": true,
"documentsMerged": 2,
"documentNames": [
"ab.docx",
"xyz.docx"
],
"message": "Successfully merged 2 documents"
}
]
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| fileName | merged_document.docx |
| fileSize | 15605 |
| success | true |
| documentsMerged | 2 |
| documentNames | ["ab.docx", "xyz.docx"] |
| message | Successfully merged 2 documents |
Schema View
The data structure and types of the response:
1 item
fileName: T merged_document.docx
fileSize: # 15605
success: ☑ true
documentsMerged: # 2
documentNames: [] Array
[0]: T ab.docx
[1]: T xyz.docx
message: T Successfully merged 2 documents
Type Indicators:
T= String (Text)#= Number☑= Boolean[]= Array
Binary Data View
The actual Word document file data and metadata:
data
─────────────────────────────
File Name: merged_document.docx
File Extension: docx
Mime Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
File Size: 15.6 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
Enterprise Document Automation
- Document Assembly: Combine multiple documents into comprehensive reports
- Report Consolidation: Merge chapter documents into complete reports
- Template Assembly: Combine template sections into final documents
- Content Management: Consolidate content from multiple sources
AI-Powered Document Processing
- Multi-Format Support: Process Word documents in .docx and .doc formats
- Multi-Language Processing: Support for different languages and regions
- Intelligent Style Handling: Automatic style management during merge
Business Intelligence and Analytics
- Document Management: Organize documents with proper structure
- Compliance Monitoring: Ensure documents meet formatting requirements
- Performance Metrics: Track processing accuracy and efficiency