# Dynamic Document Generation Engine

Generate documents instantly or at scale from live Salesforce data, then apply security, preview, and merging controls to every output.

> Kind: Guide · Updated: Jul 30, 2026

CloudFiles Dynamic Document Generation Engine creates documents in real time or through high-volume automations using dynamic Salesforce data. It applies post-generation controls and consolidates multiple files into one secure, ready-to-send package.

The engine spans four areas — generating a single document on demand, generating documents in bulk through background processing, protecting and previewing documents right after they're created, and merging multiple files into one consolidated PDF. See the Document Generation features overview for how this engine fits alongside template design and data personalization.

## Instant &amp; On-Demand Generation

Generate documents instantly from Salesforce records, screen flows, or actions - delivering data-filled outputs on the spot with no delays. Learn more in the Instant & On-Demand Generation guide.

- One-Click Record Generation: Trigger document creation directly from the CloudFiles widget on any Salesforce record for a quick, simple, Salesforce-native way to generate a polished document instantly.
- Automated Generation (Flows & Apex): Create documents through Record-Triggered Flows, Screen Flows, or Apex actions using real-time data and runtime variables, adding live document creation into any Salesforce automation or guided process.

## Bulk &amp; Background Generation

Create hundreds or thousands of documents asynchronously using scalable background processing — ideal for statements, reports, invoices, and operational batches. Learn more in the Bulk & Background Generation guide.

- Bulk Generation: Generate hundreds or thousands of documents asynchronously from list views, flows, or record collections, automating large-scale document runs in a single step without slowing down users.
- Batch Processing: Executes document generation through distributed batch jobs that handle large data volumes efficiently without hitting Salesforce limits, ensuring reliable, high-performance document creation even at massive scale.

## Post-Generation Controls

Apply security, access, retention, and preview rules immediately after documents are generated to keep them protected, compliant, and easy to review. Learn more in the Post-Generation Controls guide.

- Security & Access Controls: Apply PDF security such as password protection, print/copy restrictions, and lock PDF, plus retention timers that control who can view or download a document after generation - enterprise-grade protection that keeps access strictly in your control.
- Real-Time Preview & Download: Instantly returns a PreviewURL and DownloadURL for generated files, with expiration settings, access rules, and view-only modes, so users can review or retrieve documents immediately without delays.

## Unified Document Merging

Combine multiple templates, PDFs, or external files into a single, consolidated document package. Learn more in the Unified Document Merging guide.

- Unified Document Merging: Merges outputs from multiple templates, previously generated files, uploaded PDFs, or files stored in Salesforce or external systems (SharePoint, S3, Google Drive) into one consolidated PDF - creating complete, professional document packages such as proposals, contracts, and annexures that are ready to share.
