Merge Salesforce Files in Flow
Create an ordered PDF from exact file versions and optionally pad it for duplex printing.
Read as Markdown · Open in the interactive guide
Combine an approval letter and a schedule already stored in Salesforce Files. This Flow action creates a new File and returns its IDs, so a later step can attach it to a record or offer it to the user.
- In a sandbox, open the bundled Portwood: PDF Merge Demo in Flow Builder. It ships as a draft. Debug it with two small unsigned PDFs you can read.
- Supply Content Version IDs as an ordered Text collection, or Content Version IDs (Text) as a single value separated by spaces, commas, semicolons or line breaks. Choose one input. Use exact version IDs beginning with
068. A document ID beginning with069identifies the file across revisions and cannot select the source revision. - Set Document Title. Set Related Record ID to link the new File there. Leave it blank for a standalone File.
- Turn on Pad Odd Documents for duplex printing. Every odd-length source gets a trailing blank, including the last source. Repeating an ID repeats that PDF.
- Branch on Success. Keep Content Version ID for that output revision and Content Document ID to open or link the File. Display Error Message on failure and connect a fault path.

One one-page letter followed by one two-page schedule produces three pages normally, or four with padding. Flip through the result and verify the first page of the schedule comes after the blank.
The action accepts 2–100 source versions and checks their combined input size before reading them. The budget is at most 384 KiB synchronously and 768 KiB asynchronously. Available Apex heap can lower it. Each repeated input counts again. Encrypted or signed PDFs, XFA, and scripted/calculation forms are rejected. For a signed agreement, assemble its final contents before requesting signatures.
For an interactive desktop download, see Document packets.
The sandbox-generated duplex packet uses two one-page sources. The welcome letter is on page 1, the flattened acceptance form is on page 3, and pages 2 and 4 are blank.
If the input box in the bundled demo shows only a comma, its two sample Files are missing or unavailable to you. You can have your own Flow look up each Content Version with Get Records. Match Content Document ID to the File you selected and Is Latest to True, then use that version’s Id in your ordered list.
For a familiar first run, use the downloaded sample letter and acceptance form from the recipe library. Upload the two PDFs to Files and use their version IDs in the sample Flow.