Skip to main content

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:

  1. Add PDF4me node to workflow
  2. Select "Merge Word Documents" action
  3. Configure input parameters (see below)
Merge Word Documents

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.

ParameterTypeDescriptionExample
Documents***ArrayArray 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***StringDocument Filename
• Original filename of the document
• Must include proper file extension (.docx, .doc)
• Used for reference and processing
"document1.docx"
Documents[].DocContent***Base64Document 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***NumberMerge 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[].FormatModeStringFormatting Mode
• KeepSourceFormatting - Preserves original formatting (default)
• KeepDifferentStyles - Keeps different styles, merges similar ones
• UseDestinationStyles - Uses formatting from the destination document
"KeepSourceFormatting"
Merge Options Time ZoneStringDocument 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 LevelStringDocument 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

ParameterTypeDescriptionExample
fileNameStringMerged Word document filename - The name of the output merged Word document filemerged_document.docx
fileSizeNumberFile size in bytes - The size of the merged Word document in bytes15605
successBooleanPDF4me operation status - Boolean flag indicating the success or failure of the document merging operation. PDF4me returns true for successful operations and false for any errorstrue
documentsMergedNumberNumber of documents merged - The total count of documents that were successfully merged into the final document2
documentNamesArrayArray of merged document names - List of filenames of all documents that were merged, in the order they were merged["ab.docx", "xyz.docx"]
messageStringOperation message - Descriptive message indicating the result of the merge operation, including the number of documents mergedSuccessfully 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 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"
}
]

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

Get Help