How to Batch-Generate Documents in Salesforce: List Views and Reports (2026)
Salesforce batch document generation is the process of generating a separate, personalised document for each of multiple Salesforce records in a single triggered action. Instead of generating documents one at a time from individual records, you select a group of records from a list view or report and the tool processes all of them simultaneously.
For teams generating more than a handful of documents per week, the difference between single-record and batch generation is the difference between a process that scales and one that does not. A monthly invoice run for 300 accounts that takes six hours manually takes under five minutes with salesforce batch document generation. For a detailed look at the business case, see our post on why generating documents one by one is burning out your ops team.
This guide covers how salesforce batch document generation works, how to trigger it from list views and reports, how to automate it with Flows, and how to get the best performance at scale.
What is Salesforce batch document generation?
Salesforce batch document generation is the simultaneous creation of multiple documents from multiple Salesforce records using a single generation action. Each record in the batch produces its own unique document, populated with that record’s specific field values, related record data, and line items.
The process is asynchronous. When you trigger salesforce batch document generation from a list view, the tool queues the job and processes it in the background. Your browser does not lock or wait. The documents generate in parallel, and each finished document is automatically attached to its corresponding Salesforce record as a Salesforce File — typically as a PDF. For a full guide on the PDF generation step, see how to generate PDFs from Salesforce.
The template used for batch generation is identical to the one used for single-record generation. There is no separate batch template. The same document template you use to generate a contract from a single Opportunity record is the template used to generate contracts for 200 Opportunities in a batch run.
When should you use Salesforce batch document generation?
Salesforce batch document generation is the right approach whenever you need to produce the same document type for more than one record at a time. The efficiency gain compounds with volume: generating 10 documents manually might be acceptable, but generating 100 or 300 manually is not.
Monthly invoice runs
Generate invoices for all active accounts at the start of each billing cycle. Select the accounts in a list view or trigger via a scheduled Flow. All invoices generate and attach to their records automatically.
Renewal campaigns
Generate renewal notices for all contracts expiring within the next 30 days. Filter a list view by contract end date, select all, and batch generate personalised renewal letters for every account simultaneously.
HR cohort onboarding
When onboarding a group of new hires, generate offer letters, NDA packages, and onboarding documents for all candidates in a single batch run rather than processing each individually.
Compliance certifications
Generate annual compliance certificates, policy acknowledgement documents, or data processing agreements for all relevant accounts or contacts in one batch, triggered by a scheduled Flow on a set date.
Read more: Generating Thousands of Documents One by One Is Burning Out Your Ops Team
How to batch-generate documents from a Salesforce list view
Generating documents in batch from a Salesforce list view is the most common way teams trigger salesforce batch document generation manually. It requires no admin setup beyond the initial template configuration any user with the document generation permission can run a batch job from any list view.
Select the records in the list view, click the batch generation button, choose a template, and the tool processes all selected records asynchronously in the background.
Open the Salesforce list view
Navigate to the object list view that contains the records you want to generate documents for. Apply any filters needed to scope the list to the correct records: by account type, contract status, expiry date, or any other field relevant to the batch run.
Select the records
Use the list view checkboxes to select the records you want to include in the batch. Select all records on the current page, or use Select All to include every record matching the current filter. Most tools handle pagination automatically during batch processing.
Click the batch generation button
Click the document generation button in the list view action bar. If multiple templates are associated with the object, you will be prompted to select the correct template for this batch run. Confirm the selection and submit.
Monitor the batch job
The batch job runs asynchronously. You can navigate away from the list view while processing continues in the background. Most tools provide a batch status screen or notification that shows how many documents have been processed, how many remain, and whether any records encountered errors.
Verify the generated documents
Once the batch job completes, each generated document appears in the Files related list on its corresponding Salesforce record. Spot-check a representative sample to confirm every merge field resolved correctly and the output looks as expected.
For best results, always test the template against a single record before running a large batch. Any merge field errors that produce blank output on one record will produce the same blank output on every record in the batch.
How to generate documents in batch from a Salesforce report
Report-based salesforce batch document generation is useful when the records you need to process do not map cleanly to a single list view. Salesforce reports can cross objects, apply complex filter logic, and aggregate records from multiple sources in ways that list views cannot replicate.
The process for report-based batch generation is similar to list view batch generation with one additional step: the document generation tool reads the report output to identify the record IDs to process, then runs the batch using those IDs as the source list.
A common example is generating renewal notices using a report that shows all Opportunities with a Close Date in the next 30 days and a Stage of Negotiation or higher. The report pulls those specific records across any number of accounts, and the batch generation tool processes them all in one run.
Report-based batch generation requires the document generation tool to have access to Salesforce report objects. Confirm your tool supports this before building a workflow that depends on it. Dochly supports report-triggered generation via Salesforce Flow using the report results as the record source.
Automating Salesforce batch document generation with Flows
Automating salesforce batch document generation with a scheduled Salesforce Flow removes the manual trigger entirely. The Flow runs at a set time, identifies the records to process, and triggers the batch generation job without any user action.
A scheduled Flow for monthly invoice generation works like this: the Flow fires on the first of each month, queries all active account records with a billing status of Active, loops through the results, and calls the document generation action for each record. The tool processes the generation asynchronously and attaches the invoice to each account record by the time the team starts work.
For record-triggered batch scenarios, a Flow can also fire when a group of records is updated simultaneously. When a sales manager closes 20 Opportunities at once by updating Stage to Closed Won in a list view, a record-triggered Flow fires for each one and generates the corresponding contract document automatically.
A scheduled Salesforce Flow queries the relevant records and triggers batch generation automatically at the configured time — no manual intervention required.
Salesforce batch document generation: performance and scale
Salesforce batch document generation processes jobs asynchronously using Apex Batch, which means document generation does not count against your synchronous governor limits and does not block user activity while running.
Performance depends on three factors: template complexity, the number of related records being queried per document, and the total batch size. A simple invoice template with minimal related data generates faster than a complex contract template with multiple related objects and conditional sections.
| Batch size | Simple template | Complex template | Recommended trigger |
|---|---|---|---|
| 1–20 records | Under 1 min | 1–3 min | Manual list view button |
| 21–100 records | 1–3 min | 3–7 min | List view or scheduled Flow |
| 101–300 records | 3–6 min | 7–15 min | Scheduled Flow |
| 300+ records | 5–10 min | 15–30 min | Scheduled Flow with chunking |
For very large batches, the document generation tool typically splits the job into smaller Apex Batch chunks of 50–100 records each. These chunks process in parallel, which keeps the total processing time within acceptable limits even for batches of several hundred records.
Best practices for Salesforce batch document generation
Following these four practices ensures your salesforce batch document generation workflows run cleanly at scale and produce consistent output across every record in the batch.
Test the template before running a large batch. Generate a single test document from a representative record before triggering a batch run. Any merge field errors, blank fields, or formatting issues that appear on the test document will appear on every record in the batch. Fix template issues before running at scale.
Use descriptive file naming with merge fields. Configure a file naming convention that includes identifying information from the record, such as Account Name and document date. A batch of 200 invoices named Invoice_AccountName_Date.pdf is usable. A batch of 200 files named Invoice.pdf is not.
Monitor the first batch run of a new template. After setting up a new template for batch use, watch the first production batch run and spot-check 5–10 generated documents across different record types. This catches edge cases that did not appear in testing.
Schedule large batch jobs for off-peak hours. For batch runs exceeding 100 records, schedule the Flow to run overnight or early in the morning. This avoids any potential impact on user-facing Salesforce performance during business hours and ensures the documents are ready for the team when they start work.
Frequently asked questions about Salesforce batch document generation
Salesforce batch document generation transforms high-volume document workflows from a manual, hours-long process into a background task that completes while your team does other work. Whether you are running monthly invoices, quarterly renewals, or one-time compliance campaigns, batch generation handles it at scale without additional headcount.
For the full context on how document generation works in Salesforce, see our guide on how to generate PDFs from Salesforce, or visit Dochly batch processing to see the feature in detail.