Help Center Batch Processing Troubleshooting

Batch Processing Troubleshooting — Common Errors and Fixes in Dochly

Updated June 2026 10 min read Batch Processing
Batch processing in Dochly is built on Flow, not a dedicated console, so most issues trace back to the Flow's configuration rather than an in-app job screen. This guide covers every category of batch error — Flows that won't start, Id-collection and record-source errors, per-record generation errors, email delivery problems, scheduled Flows that don't trigger, duplicate documents, and storage failures. Each error includes the most likely causes and exact steps to fix it.

First checks before troubleshooting

Check the DH_Generation_Batch__c record first

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.

Verify the record-source query independently

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.

Test the template with a single record

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.

Confirm Dochly connection is active

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

DH_Generation_Batch__c stays in Queued status for more than 10 minutes
Symptom: the tracking record's Status stays Queued and never moves to In Progress; Completed/Failed/Cancelled stay at 0.
Most likely causes
  • 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
How to fix
  • 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
Dochly's bulk actions don't appear in the Flow Action picker
Symptom: When adding an Action element in Flow Builder, "Dochly: Generate Documents (Bulk - Collection)" or the Generate & Email variant isn't listed.
Most likely causes
  • 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
How to fix
  • 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

Bulk action fails immediately with a collection/type error
Symptom: The Flow throws a fault immediately when calling the bulk action — before any records are processed.
Most likely causes
  • 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
How to fix
  • 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
Get Records returns zero or unexpected records
Symptom: A query that used to return the right record set now returns nothing, or returns records you didn't expect.
Most likely causes
  • 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
How to fix
  • 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

Some records fail while others succeed (Completed With Errors)
Symptom: DH_Generation_Batch__c reaches Status = Completed With Errors, with Failed > 0. Successful records have documents; failed records do not.
Most likely causes
  • 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
How to fix
  • 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
Records fail with "Insufficient access" or "Field not accessible"
Symptom: Failures point to permission-related errors for specific records or fields.
Most likely causes
  • 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
How to fix
  • 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

Batch completes but recipients did not receive email
Symptom: DH_Generation_Batch__c shows Completed (or Completed With Errors), but customers report not receiving the email with the attached document.
Most likely causes
  • 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
How to fix
  • 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
Individual records fail with an email-related error
Symptom: Some records in the Id collection fail specifically around email delivery rather than document generation itself.
Most likely causes
  • 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
How to fix
  • 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

Scheduled batch Flow did not run at the expected time
Symptom: The scheduled time passed but no new DH_Generation_Batch__c record was created and no notification email was received.
Most likely causes
  • 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
How to fix
  • 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

Records have multiple copies of the same generated document
Symptom: A record's Files list contains 2 or more copies of a document that should only exist once — typically after a re-run or a scheduled Flow trigger.
Most likely causes
  • 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
How to fix
  • 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

Batch fails midway with "Storage limit exceeded" errors
Symptom: Processing starts but fails with storage errors after some records are generated. Later records show a file storage limit error.
Most likely causes
  • 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
How to fix
  • 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

SymptomMost likely causeFix
Status stays Queued >10 minApex queue full or Salesforce platform delayCheck Apex Jobs queue; check trust.salesforce.com; abort and re-run if needed
Bulk actions missing from Flow Action pickerMissing Dochly Admin permission or no Active templateAssign Dochly Admin permission set; set a template to Active
Bulk action errors on Id collectionPassed full records instead of Ids, or empty/oversized collectionBuild a proper Id collection; cap at 2,000 per call
Get Records returns zero/unexpected rowsFilter criteria changed, or running-user sharing access differsDebug the Get Records element with the production running-user context
Generation error on some recordsBlank required field or formula error on specific recordsOpen failing record; fix missing data; re-run targeted Id collection
Insufficient access errorsDochly integration user missing field/record accessCheck field-level security and sharing rules
Emails not receivedDeliverability off; daily limit hit; spam filtering; wrong action usedConfirm Generate & Email action used; check Setup Deliverability and Email Log
Email field blank errorsContact.Email empty on specific recordsPopulate email field; filter it out of future Get Records queries
Scheduled Flow didn't fireFlow deactivated; timezone mismatch; scheduled Apex abortedCheck Flow is Active and its entry in Setup → Scheduled Jobs
Duplicate documents on recordsNo prevention field; Flow ran twice against same recordsAdd a prevention checkbox field with a post-generation update
Storage limit errors mid-runSalesforce File Storage at capacityCheck 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.

  • 1
    The Flow name (or the DH_Generation_Batch__c record Id) and its current Status (Queued / In Progress / Completed / Completed With Errors / Failed / Cancelled)
  • 2
    A screenshot or export of the DH_Generation_Batch__c record showing Total, Completed, Failed, and Cancelled
  • 3
    The exact error reason (if any) captured from 2–3 of the failing records, from a fault path or your own logging
  • 4
    The Salesforce Record ID of one specific failing record — so support can investigate the data on that record
  • 5
    The template name and whether single-record generation also fails for the same record
  • 6
    The Get Records filter criteria you used and whether it returns the expected records when tested independently in Flow debug mode
  • 7
    For 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)
  • 8
    Whether 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

When a working batch starts failing without template changes, the issue is almost always in the data or environment: (1) A field that was always populated is now blank on some records — data quality has degraded; (2) A Salesforce release changed how a formula or flow populates data; (3) Field-level security or sharing rules were updated, restricting the Dochly integration user or the Flow's running user; (4) The Get Records filter or the source object's fields changed. Check each of these systematically and compare a failing record's data against a previously successful record.
The Get Records element runs at the moment the Flow actually executes, not when you last tested it. If it uses relative date filters and some records moved out of scope between your test and the real run (e.g. a deal was re-opened and no longer matches "Closed Won"), the bulk action processes fewer records than your earlier test showed. This is expected behaviour — the run correctly processes only the records that match at run time. Re-test the same query to see the current count.
Yes — the most reliable approach is to build a new Id collection containing only the failed record Ids (found by comparing your original Id collection against which records now have a generated file in their Files list), then call the bulk action again with just that collection. If you have a prevention field configured, successful records from the original run won't be re-included because their prevention field is already TRUE — only the failures (which never had the field set) will match your Get Records filter on the next run.

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.

Dochly
Get Early Access Contact Us to Get Started with Dochly

Not on AppExchange yet — contact us and we'll set you up