Generate Documents (Multiple) using n8n action
PDF4me Generate Documents (Multiple) creates multiple personalized documents from templates using batch data through n8n automation workflows. Process templates (Word, HTML, PDF) via n8n triggers, binary data, base64 strings, or public URLs with arrays of JSON/XML data to generate bulk customized documents with intelligent data merging, variable replacement, batch processing, formatting preservation, and multiple output formats (PDF, Word, Excel, HTML). This solution is ideal for bulk invoicing, mass mailings, personalized certificates, batch reports, multi-recipient documents, and high-volume document generation workflows that require template-based batch creation with accurate data integration and seamless integration.
Setup
Add the PDF4me "Generate Documents (Multiple)" 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 "Generate Documents (Multiple)" action
- Configure input parameters (see below)
/generate document multiple.webp)
Parameters
Complete list of parameters for the Generate Documents (Multiple) action. Configure these parameters to control multiple document generation from templates.
Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.
| Parameter | Type | Description | Example |
|---|---|---|---|
| Template File Input Type*** | String | Template Input Format Selection • Choose the format of your template file data input • PDF4me supports multiple input types • Options: Binary Data, Base64 String, or URL | Binary Data |
| Template Binary Property | String | Template Binary Data Reference (Required if Binary Data) • Specify the property name for accessing binary template data • Should match the binary data property name in your workflow • Required when Template File Input Type is "Binary Data" | data |
| Base64 Template Content | String | Base64 Encoded Template Input (Required if Base64 String) • Provide template file data as base64 encoded string • PDF4me automatically decodes and processes the template content • Required when Template File Input Type is "Base64 String" | UEsDBBQABgAI... |
| Template File URL | String | Public Template URL Input (Required if URL) • Provide a public/open permission URL to the template file • PDF4me downloads and processes the template from the provided URL • Required when Template File Input Type is "URL" | https://abc.com/tem.docx |
| Template File Name*** | String | Template Filename Specification • Specify the name of the template file with proper extension • Supports .docx, .html, .pdf file types • Helps with file identification and processing order | template.docx |
| Template File Type*** | String | Template File Type Selection • Choose the type of template file being processed • PDF4me supports different template types with specific requirements • Options: Word (.docx), HTML (.html), PDF (.pdf) | Word |
| Document Data Input Type*** | String | Data Input Format Selection • Choose the format of your document data input • PDF4me supports multiple input types • Options: Binary Data, Base64 String, or URL | Binary Data |
| Document Data Type*** | String | Data Format Selection • Choose the format of your document data • PDF4me supports JSON and XML data formats • Used for template processing and field population | JSON |
| Document Data Text | String | Manual Data Input • Manually enter the data for the template in JSON or XML format • For multiple documents, provide an array of data objects • Required only if data file is not mapped through other methods | [{"name": "John Doe", "email": "[email protected]"}, {"name": "Jane Smith", "email": "[email protected]"}] |
| Document Data File | String | Data File Binary Reference (Required if Binary Data) • Specify the property name for accessing binary data file • Should match the binary data property name in your workflow • Required when Document Data Input Type is "Binary Data" | data |
| Base64 Data Content | String | Base64 Encoded Data Input (Required if Base64 String) • Provide data file content as base64 encoded string • PDF4me automatically decodes and processes the data content • Required when Document Data Input Type is "Base64 String" | UEsDBBQABgAI... |
| Document Data URL | String | Public Data URL Input (Required if URL) • Provide a public/open permission URL to the data file • PDF4me downloads and processes the data from the provided URL • Required when Document Data Input Type is "URL" | https://exm.com/abc.json |
| Output Type*** | String | Output Format Selection • Choose the file format of the generated documents • PDF4me supports multiple output formats • Options: PDF, Word (.docx), Excel (.xlsx), HTML | PDF |
| Output File Name*** | String | Output Filename Specification • Specify the base name for the generated documents • PDF4me automatically appends numbers or identifiers • Creates unique filenames for each document | generated_document |
| Binary Data Output Name*** | String | Binary Data Mapping • Define the variable name for accessing generated documents binary data • Used in subsequent workflow actions • Essential for workflow data flow | data |
| File Meta Data | String | Additional Metadata • Additional metadata for fields in JSON format • Can include custom properties, formatting instructions, processing hints • Optional for advanced template processing | {"batchId": "BATCH001", "department": "Sales", "priority": "High"} |
Advanced Options
The following parameters are available in the Advanced Options section and are optional:
| Parameter | Type | Description | Example |
|---|---|---|---|
| Custom Profiles | String | Custom Configuration Profiles • Set additional options using custom profiles • JSON-like format containing predefined parameters • Supports outputDataFormat, preserveMetadata, etc. • Optional for specialized requirements | { "outputDataFormat": "base64", "preserveMetadata": true, "optimizeForPrinting": false, "compressionLevel": "medium" } |
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| success | Boolean | PDF4me bulk document generation operation status indicator - Boolean flag indicating the success or failure of the bulk document generation process. PDF4me returns true for successful operations and false for any errors, enabling robust error handling in automated workflows | true |
| message | String | PDF4me bulk document generation operation status message - Human-readable status message providing details about the bulk document generation process result. Includes success confirmation or error details for troubleshooting | Documents generated successfully |
| fileName | String | PDF4me generated documents filename - The complete filename of the successfully generated documents with proper file extension. PDF4me ensures unique naming and validates file format compliance for seamless integration with downstream processes | generated_documents.zip |
| mimeType | String | PDF4me output MIME type - MIME type of the generated documents based on the selected output format. For multiple documents, this may be a ZIP file containing all generated documents | application/zip |
| fileSize | Number | PDF4me generated documents file size in bytes - The exact size of the generated documents in bytes, provided by PDF4me for storage planning, bandwidth optimization, and file transfer monitoring. Essential for enterprise document management and workflow automation | 125430 |
| docName | String | PDF4me documents name reference - The name of the generated documents for reference and tracking purposes. This matches the fileName for consistency in document management workflows | generated_documents.zip |
| documentsGenerated | Boolean | PDF4me bulk document generation completion confirmation - Boolean flag confirming that the bulk document generation operation has been successfully completed. Useful for verifying that all documents were generated correctly | true |
| documentsCount | Number | PDF4me generated documents count - The number of individual documents that were successfully generated from the template and data. Useful for tracking generation completeness and batch processing results | 25 |
| templateProcessed | Boolean | PDF4me template processing confirmation - Boolean flag confirming that the template was successfully processed and data was merged correctly for all documents. Useful for verifying template processing effectiveness | true |
N8N Action Response
The PDF4me Generate Documents (Multiple) 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:
[
{
"success": true,
"message": "Documents generated successfully",
"fileName": "generated_documents.zip",
"mimeType": "application/zip",
"fileSize": 125430,
"docName": "generated_documents.zip",
"documentsGenerated": true,
"documentsCount": 25,
"templateProcessed": true
}
]
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| success | true |
| message | Documents generated successfully |
| fileName | generated_documents.zip |
| mimeType | application/zip |
| fileSize | 125430 |
| docName | generated_documents.zip |
| documentsGenerated | true |
| documentsCount | 25 |
| templateProcessed | true |
Schema View
The data structure and types of the response:
1 item
success: ☑ true
message: AB Documents generated successfully
fileName: AB generated_documents.zip
mimeType: AB application/zip
fileSize: # 125430
docName: AB generated_documents.zip
documentsGenerated: ☑ true
documentsCount: # 25
templateProcessed: ☑ true
Type Indicators:
AB= String#= Number☑= Boolean
Binary Data View
The actual generated documents file data and metadata:
data
─────────────────────────────
File Name: generated_documents.zip
File Extension: zip
Mime Type: application/zip
File Size: 122.5 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
Bulk Document Generation and Mass Personalization
- Automatically generate hundreds of personalized invoices, contracts, and business documents from templates using customer data from CRM systems or databases for large-scale operations
- Process employee onboarding documents by generating personalized offer letters, contracts, and welcome packages for entire departments or new hire batches using employee information from HR systems
- Create customized reports and presentations by merging data from various sources into professional document templates for different stakeholders across multiple projects or departments
Template-Based Content Management at Scale
- Generate marketing materials and promotional documents from templates using dynamic product information, pricing data, and customer-specific content for large marketing campaigns or product launches
- Process legal documents and compliance materials by generating personalized contracts, agreements, and legal forms using client data and case information for multiple clients or cases simultaneously
- Create educational materials and training documents by generating personalized certificates, course materials, and learning resources using student and course data for entire classes or training programs
Business Process Automation and Workflow Integration
- Integrate bulk document generation into business workflows by automatically creating documents based on workflow triggers, form submissions, or data updates for high-volume operations
- Process batch document generation for large-scale operations like mass mailings, report generation, or document distribution using bulk data sources from multiple systems or databases
- Automate the creation of standardized documents across different departments and teams while maintaining consistency and reducing manual effort for enterprise-wide document management