Introduction
In this test drive, you will explore how CloudFiles Document Generation, integrated with Salesforce Flows, can automatically merge multiple Salesforce files into a single PDF document.
This setup allows users to upload multiple files into a record, select specific files for merging, and generate a single consolidated file. The merged output is automatically saved as a child Result Document record.
Note: The file types supported for merging are PDF, DOCX, Images (PNG and JPEG).
All of this is powered by Salesforce flows and the flow actions from CloudFiles. The test drive takes less than a minute to complete.
Instructions
Follow the steps below to test the setup:
- Go to the Split or Merge Documents tab and create a new record. No additional input is required β just save it.
- Upload a few files using the standard Files related list on the record.

- Click the 'Merge Files' button. This will launch a screen flow.
- From the screen, select the files you want to merge and click 'Merge'.

- CloudFiles will combine the selected files and generate a new Result Document record.
- You can find the final merged file attached to this new child record.

Implementation
This test drive is implemented using a Salesforce screen flow, powered by the Merge Documents (Sync) flow action.
The screen flow performs the following steps:
- Collects all ContentDocumentIds from files attached to the parent record.
- Displays a list of those files on a screen where users can select which ones to merge.
- Passes the selected content documents to the Merge Documents (Sync) action.
- Retrieves the final merged file (as a ContentVersion).
- Creates a Result Document child record and attaches the merged PDF to it.

Beyond This Test Drive
The Merge Documents (Sync) action from CloudFiles isnβt limited to just this test driveβit can be reused across a variety of Salesforce flows and automation scenarios. Whether you're working with screen flows, record-triggered flows, or scheduled flows, this action can help automate document packaging tasks across teams.
Below are few ways this action can be leveraged in broader enterprise use cases:
Screen Flows for On-Demand Document Packaging
Use the merge action in guided screen flows where users interactively select files to merge, rename output, or trigger downstream steps.
Example: A sales rep merges a quote, terms sheet, and case study into a single proposal PDF to send to a prospectβright from an Opportunity screen flow.
Auto-Merge on Record Save (Record-Triggered Flows)
Trigger the document merge automatically when certain conditions are metβlike when a record reaches a specific stage or status.
Example: When an HR record reaches "Ready to Offer," the system automatically merges the offer letter, NDA, and job description into a single hiring packet.
Scheduled Flows for Batch Document Compilation
Run scheduled flows that periodically merge documents (daily, weekly, monthly) for operational tasks.
Example: A scheduled flow merges all invoices generated during the week into a single summary PDF for monthly archiving or email delivery.
Post-Signature Document Bundling
After a contract is signed via eSignature, use the merge action to combine the signed contract, terms, and client documents into a single client archive package.
Example: In a service onboarding flow, once DocuSign completes a contract, merge the signed file with the onboarding checklist and welcome doc.
Merge External Files Before Upload or Storage
Combine files from external sources (e.g., SharePoint, Google Drive) into a single document before uploading to Salesforce or an external archive.
Example: A legal team merges uploaded draft contracts from SharePoint into one file before pushing to Salesforce for final review.
Dynamic File Assembly Based on Related Records
Use flow logic to dynamically gather and merge files based on related objects or metadata conditions.
Example: For a project record, gather all linked project phase reports, then merge and attach them as a consolidated report for clients.
With its synchronous execution and tight Salesforce integration, the CloudFiles Merge Documents (Sync) provides a fast, reliable way to automate multi-file operationsβreducing manual effort while improving document accessibility and consistency.