Set Up Batch Document Processing in Salesforce with Dochly
What batch processing is
Batch processing in Dochly takes a Salesforce report — which defines a set of records — and generates a personalised document for every record in that report simultaneously. Each document is unique, populated with the live data from its individual Salesforce record, and stored back on that record automatically.
The key difference from single document generation is scale and automation: instead of opening each record and clicking Generate, batch processing handles the entire set in one operation, running in the background while your team continues working.
Manual generation
- Open each Salesforce record individually
- Click Generate Document on every record
- 50 invoices = 50 separate clicks and waits
- Easy to miss records or generate inconsistently
- Requires user presence throughout
Batch processing
- One report defines all target records
- One click (or scheduled) starts the entire run
- 50 invoices = same time as 500 invoices
- Consistent output — same template, same settings
- Runs in background — no user presence needed
When to use batch vs single generation
You need to generate the same document type for more than 5–10 records at once. The records share a common filter (same month, same status, same region). The operation is recurring — monthly invoices, quarterly reports, annual renewals. Speed and consistency matter more than per-document customisation at send time.
Generating one document for a specific record in an active deal workflow — e.g. a sales rep generating a proposal for a customer they're about to call. The document requires per-send customisation (specific signer, custom message, override settings). The record count is small enough to handle manually.
Common use cases
Invoice run for all Closed Won deals
Generate and send invoices for every Opportunity closed this month in a single end-of-month batch operation.
Contract renewal pack for all active accounts
Generate personalised renewal agreements for every active Account contract expiring in the next 90 days.
Policy acknowledgement distribution
Generate and send policy documents to all Contacts who haven't acknowledged an updated terms or compliance notice.
Employee document batch
Generate onboarding packets, handbook acknowledgements, or benefit summaries for all employees who joined this quarter.
Account statement generation
Generate quarterly account summaries for all active Accounts, storing each statement on the Account record automatically.
Bulk data export to PDF/Word
Generate formatted reports from any Salesforce report — converting CRM data into branded, distributable documents at any scale.
Prerequisites
Confirm these are in place before configuring batch processing settings:
Dochly must be installed from AppExchange and the connection status must be green. Batch Processing requires a connected Dochly instance — Setup Wizard must have been completed successfully. See Install Dochly from AppExchange.
Batch job configuration requires the Dochly Admin permission set. Verify it's assigned: Setup → Users → [Your User] → Permission Set Assignments. The Dochly User permission set is not sufficient for configuring batch jobs.
Batch jobs require an Active Dochly template to generate from. Confirm at least one template is set to Active status in Dochly → Templates before configuring a batch job. Draft templates cannot be used in batch runs.
Batch jobs use Salesforce reports as their record source. You need a report saved in a shared or public folder that returns the records you want to generate documents for. The report must include the Record ID column.
Setup walkthrough
Confirm permissions and access
Open the Dochly app → Batch Jobs. If you can see the Batch Jobs tab and the New Job button, your permissions are correct. If the tab is missing or greyed out, confirm the Dochly Admin permission set is assigned to your user.
Also confirm the users who will run batch jobs (if different from you) have at minimum the Dochly User permission set — they can run pre-configured jobs but cannot create or modify job configurations without Dochly Admin.
Prepare the source Salesforce report
Before creating a batch job, prepare the Salesforce report that will define which records get documents. The report must meet these requirements:
- Report type is based on the same object as your template's primary object
- The Record ID column is included
- Filters use relative date values where applicable ("This Month", "Last 90 Days") so the report stays relevant on re-runs without manual updates
- The report is saved in a Public or shared folder — not a personal folder
- The report is a Tabular or Summary report type — Matrix reports are not supported as batch sources
Run the report and verify the row count is as expected. Every row becomes one document generation — confirm there are no unexpected records in the results before using the report as a batch source.
Configure output settings
Go to Dochly → Batch Jobs → Settings (or configure per-job in the New Job panel). Set the default output configuration:
Batch Jobs → Output Settings
RequiredPDF (recommended for most batch jobs), DOCX, or XLSX. PDF is the most compatible format for storage, sharing, and email delivery. Set per-job to override the default.
Recommended: PDFConfigure the file name pattern for generated documents. Use merge fields for dynamic names — e.g. {{Account.Name}} — Invoice — {{CloseDate | date: "YYYY-MM"}}. Clear file names make documents easy to find in the Files related list.
How many documents to generate simultaneously. Higher concurrency = faster completion but more Salesforce API usage. For large jobs (>500 records), start with medium concurrency to avoid API limit errors. Adjust based on org limits.
Recommended: Medium (default) for most orgsConfigure delivery and storage
Batch Jobs → Storage & Delivery
RequiredWhere generated documents are stored. Attach to originating record is the standard setting — stores each PDF on the Salesforce record it was generated from, in that record's Files related list.
Recommended: Attach to originating recordOptionally email each generated document to the record's associated contact. Set the recipient field (e.g. Contact.Email), email subject, and body. Each recipient receives their own personalised document — not a shared attachment.
Optional — enable for customer-facing batch runsOptionally update a Salesforce field on each processed record when generation completes — e.g. set Invoice_Sent__c = TRUE. Use this as a prevention field to stop the same records being processed in the next batch run.
Recommended: configure a prevention checkbox fieldConfigure notifications
Set who receives notifications about batch job progress and completion. Go to Dochly → Batch Jobs → Settings → Notifications:
- Completion email: Sent to the configured admin address when the job finishes — shows total processed, success count, failure count, and a link to the full log
- Failure alerts: Sent immediately when any record fails to generate — allows prompt investigation without waiting for the full job to complete
- Progress notifications: Optional — send updates at milestones (25%, 50%, 75% complete) for long-running jobs
Run a test batch with 5 records
Before running a full production batch, test with a small subset. Filter your source report to return only 3–5 records (use a specific Account name or date range to limit scope). Run the batch job and verify:
- Documents generate and attach to each record's Files list
- File names match the configured naming convention
- Email delivery works if enabled — check that test recipients receive the email
- Post-generation field updates are applied correctly
- The job log shows success for all test records
Once the test confirms correct behaviour, update the report to its full production filter set and run the full batch.
Batch size and governor limits
Dochly batch processing runs outside the Salesforce transaction context — using asynchronous Apex and Salesforce Bulk API — which means it avoids the most restrictive Governor Limits that affect synchronous operations. However, some limits still apply.
Up to 500 records: runs smoothly with default settings. 500–2,000 records: use medium or low concurrency to spread API calls. Over 2,000 records: split into multiple jobs across different time windows, or use Dochly's scheduled batch feature to spread load across days.
50 records: approximately 1–3 minutes. 500 records: approximately 10–20 minutes. 5,000 records: approximately 1–3 hours depending on template complexity and concurrency setting. Large jobs run in the background — close the browser and come back to check the job log.
Salesforce limits outbound emails to 5,000 per day for most orgs. If your batch run emails documents to more than 5,000 recipients in a day, split the run across multiple days or use Salesforce's Mass Email feature for very large volumes.
Each generated document consumes Salesforce File storage. A 200KB PDF × 1,000 records = ~200MB of storage. Monitor Salesforce storage usage (Setup → Storage → File Storage) before running large batches to avoid hitting org storage limits.
Frequently asked questions
Batch processing is now configured and ready to run. Next in this series: Run a batch document job from a Salesforce report — create your first batch job, configure the report source, and launch the generation run.
Rated 5 stars · Native Salesforce app · Free to install