Batch Processing Troubleshooting — Common Errors and Fixes in Dochly
First checks before troubleshooting
Most batch outcomes are visible in the tracking record's Total/Completed/Failed/Cancelled/Status fields, or via the Dochly: Get Batch Status action. Start there before digging further — a Failed vs. Completed With Errors status already narrows down whether the problem is with the run itself or with specific records.
Run the Get Records element on its own in Flow debug mode (or the equivalent Salesforce report/list view, if you modeled the query on one) and confirm it returns the expected records. Many batch issues trace back to a query that has changed, a sharing-rule restriction, or unexpected records in the result.
If generation is failing on multiple records, test the template individually: open a record from the failing set and use Dochly's single-record Generate Document action. If single generation also fails, the issue is in the template — not the batch/Flow configuration.
Dochly Setup tab → Connection Status must show green. An expired or disconnected connection causes every bulk action call to fail at the API call stage. Re-authenticate if the status shows yellow or red.
Flow won't start or stays queued
- Salesforce async Apex queue is at capacity — too many concurrent async jobs across the org
- Another large Dochly bulk action call is consuming available async workers
- Salesforce is experiencing a platform delay — check trust.salesforce.com for org-level incidents
- Check Setup → Apex Jobs → Scheduled and Queued jobs — if the queue is full with other jobs, wait for them to clear before yours picks up
- Check trust.salesforce.com for any active incidents on your Salesforce instance
- If the queue is clear and it still hasn't started after 15 minutes, abort the stuck Apex job from Setup → Apex Jobs and re-run the Flow — occasionally async submissions get stuck and a fresh call resolves it
- The Dochly Admin permission set is not assigned to your user — building Flows that use Dochly's actions requires it
- No Active templates exist in the org — some action pickers hide actions that have no valid configuration target
- Dochly connection is disconnected — actions may not resolve without an active connection
- Setup → Users → [Your User] → Permission Set Assignments — confirm Dochly Admin is listed
- Dochly → Templates — confirm at least one template has status Active (not Draft)
- Dochly Setup tab → Connection Status — reconnect if the status is not green
Record-source and Id collection errors
- You passed a collection of full sObject records instead of a collection of record Ids
- The Id collection variable is null or empty because the Get Records element returned zero rows
- The Id collection exceeds the 2,000-record cap for a single call
- Add an Assignment (in a loop) or a formula to extract just the Id field into a Text Collection before calling the bulk action
- Add a Decision element to skip the bulk action call (and log/notify instead) when the Id collection is empty
- If the collection can exceed 2,000, split it into chunks and call the action once per chunk
- Filter criteria reference a field or value that changed (e.g. a picklist value was renamed)
- The Flow's running user/context doesn't have sharing access to the records — a difference from when you tested it as yourself
- If you modeled the query on a Salesforce report, the report's own filters were changed independently and the two are now out of sync
- Test the Get Records element in Flow debug mode with the exact running-user context the Flow will use in production
- Check sharing rules and org-wide defaults for the object if the Flow runs as a specific user or "without sharing"
- If you're keeping a report in sync with the Flow query for reference, re-check both after any filter change
Generation failures on specific records
- A required merge field in the template is blank on the failing records but populated on the successful ones
- A formula field referenced in the template throws an error on specific records due to a data edge case (e.g. division by zero, null parent reference)
- A conditional logic branch references a field that is null on only some records
- Identify the failed records by comparing your Id collection against which records now have a new file in their Files list (see "Investigating per-record failures" in the monitoring guide)
- Open one of the failing records in Salesforce — compare its field values to a successfully generated record to spot the difference (blank vs populated)
- For merge fields that may be blank: add a default value filter in the template:
{{Field__c | default: "N/A"}} - For formula field errors: check the formula on the affected records in Salesforce — formula errors show as #Error in the record. Fix the formula or the underlying data
- Build a new Id collection of just the failed records and call the bulk action again
- The Dochly integration user's profile or permission set doesn't have Read access to a field used in the template
- Salesforce sharing rules restrict the Dochly integration user, or the Flow's running user, from accessing certain records
- Field-level security was changed after the template was built — a field that was accessible is now restricted
- Setup → Object Manager → [Object] → Fields → [Field] → Field Accessibility — confirm the relevant profile has Read access
- Setup → Sharing Settings — confirm the org-wide default or sharing rules allow access to the affected records
- For org-wide changes: check the user/profile the Flow runs as, and verify it still includes all required object and field permissions
Email delivery failures
- Emails landed in spam or were filtered by the recipient's email security system
- Org-level Salesforce email deliverability is set to "System email only" — blocking outbound customer-facing email
- The daily Salesforce email limit (5,000 emails/day for most orgs) was hit during the run — emails after the limit are dropped silently
- The email delivery field (e.g. Contact.Email) contained an invalid or inactive address
- You called Dochly: Generate Documents (Bulk - Collection) instead of the Generate & Email variant — the plain action never sends email
- Confirm your Flow calls Dochly: Generate & Email Documents (Bulk - Collection), not the plain generation action
- Setup → Deliverability → confirm Access Level is "All email" (not "System email only")
- Setup → Email Log Files → generate a log for the run's date/time window and check for delivery failures or bounces per address
- For large batches approaching 5,000 emails: split into multiple runs on different days, or use Salesforce Mass Email or Marketing Cloud for high-volume sends
- Ask recipients to check spam/junk folders and whitelist the sending domain
- The email field is empty on those specific records — contact data is incomplete
- The wrong email field is configured as the delivery recipient — e.g. Account.Email instead of Contact.Email
- Populate the email field on each failed record — or update via a mass update if many records are affected
- Check the delivery field the Generate & Email action is configured to use on the template/record — confirm the correct email field is being referenced
- Add an "Email is not blank" filter to your Get Records element to exclude records without email addresses from future runs
Scheduled Flow not triggering
- The Flow version was deactivated (accidentally or by another admin) before the trigger time
- The Start Time was set assuming a timezone different from your org's default — Schedule-Triggered Flows use the org default time zone
- The underlying scheduled Apex job was aborted — check Setup → Scheduled Jobs
- Salesforce had a platform incident at the exact trigger time — check trust.salesforce.com for the relevant date/time
- Setup → Flows → [Flow] — confirm the version you expect is Active
- Setup → Scheduled Jobs — confirm the Flow's scheduled entry appears and its next scheduled run time is correct
- If the scheduled entry is missing: deactivate and reactivate the Flow to recreate it
- Double-check the Start Time against your org's default time zone (Setup → Company Information), not your personal user timezone
Duplicate documents generated
- No prevention field is configured — the same records are included in every run because the Get Records filter doesn't exclude already-processed records
- A manual Flow run was launched on top of a scheduled run that also fired — both processed the same records
- The prevention field was reset prematurely before the next cycle was intended to start
- Add a prevention checkbox field on the object and filter your Get Records element on that field being FALSE. Update it to TRUE after generation succeeds. See Schedule a batch document run for the full prevention-field pattern
- For existing duplicates: delete the older file versions from the affected records' Files lists. Sort by Created Date to identify which is the correct (most recent) version to keep
- If using a scheduled Flow: avoid also running the same Flow manually against the same record set on the same day
Storage and file errors
- The Salesforce org has reached its File Storage limit — no more files can be created
- A very large batch run was started without checking available storage first
- Setup → Storage Usage → check available File Storage. If near the limit, free space by archiving or deleting older files before re-running
- Estimate required storage before large runs: average document size (KB) × number of records = total storage needed. Confirm this is available before launching
- Consider using an external storage destination (e.g. SharePoint or Google Drive via Dochly integrations, if configured) for large-volume runs to avoid consuming Salesforce file storage
Quick-reference error table
| Symptom | Most likely cause | Fix |
|---|---|---|
| Status stays Queued >10 min | Apex queue full or Salesforce platform delay | Check Apex Jobs queue; check trust.salesforce.com; abort and re-run if needed |
| Bulk actions missing from Flow Action picker | Missing Dochly Admin permission or no Active template | Assign Dochly Admin permission set; set a template to Active |
| Bulk action errors on Id collection | Passed full records instead of Ids, or empty/oversized collection | Build a proper Id collection; cap at 2,000 per call |
| Get Records returns zero/unexpected rows | Filter criteria changed, or running-user sharing access differs | Debug the Get Records element with the production running-user context |
| Generation error on some records | Blank required field or formula error on specific records | Open failing record; fix missing data; re-run targeted Id collection |
| Insufficient access errors | Dochly integration user missing field/record access | Check field-level security and sharing rules |
| Emails not received | Deliverability off; daily limit hit; spam filtering; wrong action used | Confirm Generate & Email action used; check Setup Deliverability and Email Log |
| Email field blank errors | Contact.Email empty on specific records | Populate email field; filter it out of future Get Records queries |
| Scheduled Flow didn't fire | Flow deactivated; timezone mismatch; scheduled Apex aborted | Check Flow is Active and its entry in Setup → Scheduled Jobs |
| Duplicate documents on records | No prevention field; Flow ran twice against same records | Add a prevention checkbox field with a post-generation update |
| Storage limit errors mid-run | Salesforce File Storage at capacity | Check and free storage before running; use external storage for large volumes |
Support checklist — what to include when contacting Dochly support
If the issue persists after working through the relevant sections, include this information when contacting support for the fastest resolution.
- 1The Flow name (or the DH_Generation_Batch__c record Id) and its current Status (Queued / In Progress / Completed / Completed With Errors / Failed / Cancelled)
- 2A screenshot or export of the DH_Generation_Batch__c record showing Total, Completed, Failed, and Cancelled
- 3The exact error reason (if any) captured from 2–3 of the failing records, from a fault path or your own logging
- 4The Salesforce Record ID of one specific failing record — so support can investigate the data on that record
- 5The template name and whether single-record generation also fails for the same record
- 6The Get Records filter criteria you used and whether it returns the expected records when tested independently in Flow debug mode
- 7For scheduled Flow issues: the schedule configuration (Frequency, Start Date/Time) and the exact time the Flow was expected to run vs when it actually ran (or didn't)
- 8Whether this is a new issue (worked before and broke) or has never worked — and any recent changes (template edits, permission changes, Flow edits, Salesforce releases) that may coincide
Frequently asked questions
Batch Processing series complete
You've covered the full Dochly Batch Processing series — setup, running batches from a Flow, scheduling recurring runs, monitoring and tracking results, and troubleshooting every common error. Your batch document workflows are now production-ready.
Not on AppExchange yet — contact us and we'll set you up