Optimize Word Document using n8n action
PDF4me Optimize Word Document enables optimizing Word documents for size and performance through n8n automation workflows with three different compression levels and comprehensive optimization techniques. This powerful document optimization feature supports file size reduction, image compression, content cleanup, formatting normalization, and personal information removal with full control over optimization aggressiveness, perfect for document preparation, storage optimization, and performance improvement workflows.
Setup
Add the PDF4me "Optimize Word Document" 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 "Optimize Word Document" action
- Configure input parameters (see below)

Parameters
Complete list of parameters for the Optimize Word Document action. Configure these parameters to control document optimization behavior.
Important: Parameters marked with an asterisk (***) are required. Optimization level determines the aggressiveness of optimization techniques applied.
| Parameter | Type | Description | Example |
|---|---|---|---|
| Input Data Type*** | String | Word Document Input Format Selection • Choose the format of your Word document data input • PDF4me supports multiple input types • Options: Binary Data, Base64 String, or URL | Binary Data |
| Input Binary Field*** | Binary | Binary Word File Input (Required if Binary Data) • Reference Word file (.docx, .doc) from previous n8n node or file upload • PDF4me processes binary Word files with automatic format detection • Required when Input Data Type is "Binary Data" | {{ $binary.data }} |
| Base64 Word Content*** | String | Base64 Encoded Word Input (Required if Base64 String) • Provide Word content (.docx, .doc) as base64 encoded string for secure transmission • PDF4me automatically decodes and processes the Word content • Required when Input Data Type is "Base64 String" | UEsDBBQABgAI... |
| Word Document URL*** | String | Public Word Document URL Input (Required if URL) • Provide a public/open permission URL to the Word file (.docx, .doc) to be processed • PDF4me downloads and processes the Word file from the provided URL • Required when Input Data Type is "URL" | https://abc.com/document.docx |
| Word Document Name*** | String | Word Document Input Filename • Specify the name of the input Word file with proper extension (.docx, .doc) • PDF4me uses this for format detection and processing optimization | document.docx |
| Optimization Level | String | Compression Level • Low - Minimal compression (~0-10%) - preserves most formatting and content • Medium - Moderate compression (~50-80%) - removes unused elements, compresses images (default) • High - Maximum compression (~80-90%) - aggressive removal of all unnecessary content • Controls aggressiveness of optimization techniques | "Medium" |
| Culture Name | String | Document Culture/Locale • Culture code for document processing (e.g., "en-US", "de-DE", "fr-FR") • Default: null (no culture-specific processing) | en-US |
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| fileName | String | Optimized Word document filename - The name of the output optimized Word document file | optimized_document.docx |
| fileSize | Number | File size in bytes - The size of the optimized Word document in bytes | 13231 |
| success | Boolean | PDF4me operation status - Boolean flag indicating the success or failure of the document optimization operation. PDF4me returns true for successful operations and false for any errors | true |
| originalFileName | String | Original Word document filename - The name of the input Word document file | document.docx |
| optimizationLevel | String | Optimization level applied - The optimization level that was applied to the document (e.g., "Low", "Medium", "High") | High |
| wordVersion | String | Word document version - The version of the Word document format (e.g., "2007", "2010", "2013") | 2007 |
| message | String | Operation message - Descriptive message indicating the result of the optimization operation | Word document optimized successfully |
N8N Action Response
The PDF4me Optimize Word Document 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": "optimized_document.docx",
"fileSize": 13231,
"success": true,
"originalFileName": "document.docx",
"optimizationLevel": "High",
"wordVersion": "2007",
"message": "Word document optimized successfully"
}
]
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| fileName | optimized_document.docx |
| fileSize | 13231 |
| success | true |
| originalFileName | document.docx |
| optimizationLevel | High |
| wordVersion | 2007 |
| message | Word document optimized successfully |
Schema View
The data structure and types of the response:
1 item
fileName: T optimized_document.docx
fileSize: # 13231
success: ☑ true
originalFileName: T document.docx
optimizationLevel: T High
wordVersion: T 2007
message: T Word document optimized successfully
Type Indicators:
T= String (Text)#= Number☑= Boolean[]= Array
Binary Data View
The actual Word document file data and metadata:
data
─────────────────────────────
File Name: optimized_document.docx
File Extension: docx
Mime Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
File Size: 13.2 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 Preparation: Optimize documents before distribution
- Storage Optimization: Reduce file sizes for storage efficiency
- Performance Improvement: Improve document loading and processing speed
- Content Cleanup: Remove unnecessary content and formatting
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 Optimization: Automatic optimization based on document content
Business Intelligence and Analytics
- Document Management: Organize documents with optimized file sizes
- Compliance Monitoring: Ensure documents meet size requirements
- Performance Metrics: Track processing accuracy and efficiency