Skip to main content

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:

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

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.

ParameterTypeDescriptionExample
Template File Input Type***StringTemplate 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 PropertyStringTemplate 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 ContentStringBase64 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 URLStringPublic 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***StringTemplate 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***StringTemplate 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***StringData 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***StringData 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 TextStringManual 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 FileStringData 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 ContentStringBase64 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 URLStringPublic 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***StringOutput 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***StringOutput 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***StringBinary 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 DataStringAdditional 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:

ParameterTypeDescriptionExample
Custom ProfilesStringCustom 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

ParameterTypeDescriptionExample
successBooleanPDF4me 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 workflowstrue
messageStringPDF4me 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 troubleshootingDocuments generated successfully
fileNameStringPDF4me 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 processesgenerated_documents.zip
mimeTypeStringPDF4me 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 documentsapplication/zip
fileSizeNumberPDF4me 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 automation125430
docNameStringPDF4me documents name reference - The name of the generated documents for reference and tracking purposes. This matches the fileName for consistency in document management workflowsgenerated_documents.zip
documentsGeneratedBooleanPDF4me 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 correctlytrue
documentsCountNumberPDF4me 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 results25
templateProcessedBooleanPDF4me 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 effectivenesstrue

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 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
}
]

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

Get Help