Monitor and Track Batch Document Jobs in Dochly
Where to monitor batch runs
DH_Generation_Batch__c record
Created automatically for every bulk action call. Total, Completed, Failed, Cancelled, and Status fields give you the authoritative picture of a run.
Dochly: Get Batch Status action
Call this Flow action with a batchId to get total / completed / failed / cancelled / status / isFinished programmatically — the basis for polling, notifications, or a custom progress UI.
Reports on DH_Generation_Batch__c
Build a standard Salesforce report or list view on this object to see every batch run across the org, filterable by Status, and to spot long-running or stuck runs.
The target records themselves
Each successfully processed record has the generated document in its Files related list. Spot-check individual records here to confirm output — this is the ground truth for whether a specific record's document exists.
Notifications you build
Dochly doesn't send batch emails on its own. Add a Send Email step to your Flow (after checking Get Batch Status) if you want completion or failure alerts.
Salesforce Apex Jobs
Setup → Apex Jobs. Shows the async Apex execution behind a bulk action call, alongside any other async Apex in your org — useful for investigating Salesforce-level queue delays.
Batch status reference
The DH_Generation_Batch__c record's Status field takes one of six values:
Run is waiting to start
The bulk action call has been submitted and is waiting for asynchronous processing to begin. For orgs with many concurrent async jobs, queuing may take a few minutes before processing starts.
Records are actively being generated
Poll Dochly: Get Batch Status (or check the DH_Generation_Batch__c record directly) to see Completed/Failed/Cancelled counts increase as the run proceeds.
All records processed successfully
Every record in the Id collection was processed with no failures. Completed = Total, Failed = 0.
Run finished but some records failed
The run finished, but Failed > 0 — typically due to missing data or a template error on specific records. Successful records have documents; failed records do not.
The run itself failed
Processing did not complete — distinct from Completed With Errors, where the run finished but individual records failed. A Failed status usually points to a configuration problem (e.g. an invalid Template Id) rather than per-record data issues.
Run was stopped before completion
The underlying async Apex job was aborted (Setup → Apex Jobs) before finishing. Records already processed retain their documents; unprocessed records were skipped.
Reading the DH_Generation_Batch__c record
The DH_Generation_Batch__c record is the primary tool for verifying a batch run. Query it directly, view it as a Salesforce record, or call Dochly: Get Batch Status with its Id. Here's an example of what one looks like once a run finishes:
Investigating per-record failures
Because DH_Generation_Batch__c only reports aggregate counts, finding out exactly which records failed and why takes a bit more legwork:
The most reliable method: query or list-view your target Id collection and check each record's Files related list. Records with no new file are the ones that failed. Cross-reference the Failed count on DH_Generation_Batch__c to confirm you've found all of them.
If you need a persistent, queryable log of exactly which record failed and why, add a Fault path after the bulk action element in your Flow that writes the error details to a custom object (or a Task, or a Chatter post) — Dochly doesn't provide this out of the box.
Blank required merge fields, a formula field that errors on specific records, field-level security blocking the Dochly integration user from a field the template references, or a record that was deleted/merged between query time and generation time.
Once you've identified the failed record Ids (by comparing your original Id collection against which records now have a generated Files entry), build a new Id collection containing just those records and call the bulk action again after fixing the underlying data issue.
See Batch processing troubleshooting for the most common generation-failure causes and fixes.
Live progress with Get Batch Status
There's no auto-refreshing progress panel in Dochly. To track a run in progress, call Dochly: Get Batch Status with the batchId your Flow captured when it invoked the bulk action.
total, completed, failed, cancelled, status, and isFinished (a boolean). Use isFinished to decide whether to keep polling or move on to a completion step.
A common approach: a Wait element followed by a Get Batch Status call in a loop, exiting once isFinished is true — or a separate Scheduled-Trigger Flow that periodically checks open DH_Generation_Batch__c records. If you need a live UI, a Screen Flow with a Get Batch Status call on a refresh action is the closest equivalent to a "progress panel," and it's something you build, not something Dochly ships.
Building in notifications
Dochly has no notification settings screen. Add these directly to your Flow:
After confirming isFinished via Dochly: Get Batch Status, add a Send Email action with the Total/Completed/Failed/Cancelled counts and a link to the DH_Generation_Batch__c record. Send it whether the run finished cleanly or with errors.
Add a Decision element that checks Status = Failed (or Completed With Errors) and branches to an immediate alert email or Chatter post, rather than waiting for a scheduled completion check.
Reflecting status on your own records
Dochly's package doesn't automatically write status fields onto the records you process — the only status tracking it provides is the DH_Generation_Batch__c record itself. If you want per-record visibility in your own reports and dashboards, build it yourself as part of your Flow, as covered in Set up batch document processing:
Add your own field (e.g. Invoice_Sent__c) and set it to TRUE in a Flow step after the batch reaches a finished Status. Use it as a prevention filter for recurring runs and as a report filter for "records generated" dashboards.
Add your own field (e.g. Generated_Date__c) and populate it with the current datetime in the same post-batch Flow step, for time-to-generate reporting.
Once you've built these fields, add them to your Opportunity or Account reports to show which records have been processed by a given batch run.
Build a record-triggered Flow on your custom "generated" checkbox changing to TRUE — update the Opportunity Stage, create a Task, post to Chatter, or start the next step in your process.
Frequently asked questions
Batch monitoring gives you visibility into every generation run through the DH_Generation_Batch__c record and the Get Batch Status action. Final guide in this series: Batch processing troubleshooting — common errors and fixes in Dochly — diagnose and fix every batch processing issue from Flow errors to generation failures.
Not on AppExchange yet — contact us and we'll set you up