Help Center Batch Processing Schedule a Batch Run

Schedule a Batch Document Run in Salesforce with Dochly

Updated June 2026 8 min read Batch Processing
Dochly has no built-in scheduler — recurring batch runs are built with a native Salesforce Schedule-Triggered Flow that gathers records and calls Dochly's bulk generation action automatically. Set up monthly invoice runs, weekly renewal notice batches, daily compliance document generation, and any other recurring workflow once, and they run reliably on schedule using standard Salesforce automation. This guide covers your scheduling options, the build process, real configuration examples, and how to manage an active schedule.

Why schedule batch runs

Manually re-running a batch Flow requires someone to remember to do it, verify the record count, and launch it. A Schedule-Triggered Flow removes the human dependency entirely — it runs at the right time every time, querying the latest data, without any action from your team.

Consistent timing

Invoices always go out on the 1st of the month. Renewal notices always go out on Mondays. No one forgets, no one is on holiday — the schedule runs regardless.

Always uses current data

The Get Records query inside the Flow re-runs at each scheduled trigger — so this month's closed deals automatically become this month's invoices, without updating any filter manually.

Off-peak processing

Schedule large batches at 6 AM before business hours. Processing during off-peak hours avoids API limit collisions with user activity and reduces the risk of a large run affecting system performance during the working day.

Notification-driven oversight

Add a completion or failure email step to the Flow (checking Dochly: Get Batch Status) so your team knows the run finished successfully — or immediately knows if something went wrong — without having to check manually.


Scheduling options

Salesforce's native Schedule-Triggered Flow supports a Start Date, Start Time, and a Frequency of Once, Daily, or Weekly. There is no built-in Monthly or custom-cron frequency in the Flow scheduler itself — for those cadences, add logic inside the Flow or pair it with Scheduled Apex:

Daily

Native Flow frequency. Runs every day at the configured Start Time. Best for: compliance document generation or any workflow where documents need to be generated every business day. Use with relative date filters like "Today" or "Yesterday" in the Get Records element.

Weekly

Native Flow frequency, recurring on the day of week matching the Start Date. Best for: renewal notice batches, weekly account statement generation, or any document that goes out on a fixed weekly cadence.

Monthly

Not natively selectable. The common pattern is a Daily-triggered Flow with a Decision element at the start that checks whether today matches the day of month you want (e.g. Day = 1), and exits without calling the bulk action on every other day.

Complex or custom cadences

For patterns Flow's scheduler can't express directly — first business day of the quarter, last Friday of the month, every 6 hours — pair the Flow with a Scheduled Apex class (System.schedule with a CRON expression) that invokes the Flow. This requires an Apex developer or admin comfortable with cron syntax.


Step-by-step: building a scheduled batch Flow

1

Create a Schedule-Triggered Flow

Go to Setup → Flows → New Flow → choose Schedule-Triggered Flow as the trigger type. This is a standard Salesforce Flow type — there is no separate "Scheduled Jobs" area inside the Dochly app.

2

Build the record source and bulk action call

Add the Get Records element and bulk action call exactly as you would for a manual batch run — the record-source query, the Id collection, the Template Id, and either Dochly: Generate Documents (Bulk - Collection) or Dochly: Generate & Email Documents (Bulk - Collection). See Run a batch job from a report for the full build pattern.

3

Configure the schedule

In the Flow's Start element, set:

  • Frequency: Once, Daily, or Weekly (native options)
  • Start Date: When the schedule becomes active — today or a future date
  • Start Time: The time of day the Flow runs, based on your org's default time zone (this isn't a per-Flow timezone setting)

For Monthly or custom cadences, add a Decision element right after the Start so the rest of the Flow (record query and bulk action) only executes on the days you actually want it to run.

4

Test in debug mode before activating

Before activating, open the Flow in Flow Builder and use Debug to trigger an immediate test run using current data. This verifies the full configuration — record query, document generation, storage, email delivery — without waiting for the first scheduled time.

Confirm the test run produces the expected documents. Check 2–3 records in Salesforce to verify files appeared correctly, and check the resulting DH_Generation_Batch__c record's Status reaches Completed. Fix any issues before activating.

5

Activate the Flow

Click Activate on the Flow version. It is now live and will trigger automatically at the next occurrence of the configured schedule. Like any other Schedule-Triggered Flow or Scheduled Apex job, it appears in the standard Salesforce Scheduled Jobs page (Setup → Scheduled Jobs) — this is ordinary Salesforce behavior, not a Dochly-specific feature.


Configuration examples

Monthly invoice run

Daily Flow + Decision
ScheduleDaily-triggered Flow at 07:00 AM; Decision element proceeds only when Today = 1st of month
Get Records filterStage = Closed Won AND Close Date = LAST_MONTH AND Invoice_Sent__c = FALSE
ActionDochly: Generate & Email Documents (Bulk - Collection), Template = Standard Invoice
Post-generationUpdate Invoice_Sent__c = TRUE

Weekly renewal notice batch

Weekly
ScheduleNative Weekly frequency, Start Date on a Monday, Start Time 09:00 AM
Get Records filterContract End Date = NEXT 60 DAYS AND Renewal_Notice_Sent__c = FALSE
ActionDochly: Generate & Email Documents (Bulk - Collection), Template = Contract Renewal Notice
Post-generationUpdate Renewal_Notice_Sent__c = TRUE

Quarterly compliance report

Scheduled Apex + Flow
ScheduleScheduled Apex cron: 0 0 6 1 1,4,7,10 ? (1st of Jan, Apr, Jul, Oct at 6 AM) invoking the Flow
Get Records filterCase Type = Regulatory AND Status = Closed AND Closed Date = LAST_N_DAYS:90
ActionDochly: Generate Documents (Bulk - Collection), Template = Regulatory Case Closure Summary
Post-generationUpdate Compliance_Doc_Generated__c = TRUE

Prevention fields for recurring runs

For any recurring scheduled Flow, add a prevention field to ensure each record is processed exactly once per cycle — not re-generated on every run. Without one, every trigger of a daily or weekly schedule would regenerate documents for all records that still match the Get Records filter.

The pattern

Add a checkbox field (e.g. Invoice_Sent__c) to the object. Add it to your Get Records filter as Invoice_Sent__c = FALSE. After the bulk action call succeeds (checked via Dochly: Get Batch Status), update Invoice_Sent__c = TRUE on the processed records. On each run, only records with the field still FALSE are included — already-processed records are automatically excluded.

Resetting for the next cycle

For monthly cycles, reset the prevention field at month-end: a separate Salesforce Flow triggered on the 1st of each month sets Invoice_Sent__c back to FALSE for all Closed Won records with a CloseDate in the previous month. This makes them eligible for the next run without manually managing the field.

Always test the prevention field pattern before activating a recurring schedule. Run your Flow twice in debug mode against a small test set — the second run should process zero records because all test records have the prevention field set to TRUE from the first run. This confirms the duplicate protection is working correctly.


Managing an active schedule

A scheduled batch run is just a Flow, so you manage it the same way you'd manage any other Schedule-Triggered Flow — there is no separate Dochly scheduling screen:

Deactivate without deleting

Setup → Flows → [Flow] → Deactivate on the active version. The Flow stops triggering but the configuration is preserved. Reactivate when needed — the next trigger is calculated from the reactivation time based on the Frequency and Start Time you configured.

Edit schedule or logic

Flows are versioned. Clone the active version, make your changes (schedule, filters, template), save as a new version, then Activate it — this automatically deactivates the previous version. You cannot edit an active version in place.

Run outside the schedule

There's no "Run Now" button for a Schedule-Triggered Flow. To trigger an ad hoc run, open the Flow in Flow Builder and use Debug — this runs it immediately without affecting the next scheduled trigger.

Review run history

Salesforce doesn't provide a built-in execution log for Schedule-Triggered Flows. Instead, every bulk action call creates a DH_Generation_Batch__c record with Total/Completed/Failed/Cancelled/Status — build a report on that object to audit that the schedule ran correctly and at the expected times. For failed Flow interviews (not batch failures), check Setup → Flows → [Flow] → Paused and Failed Flow Interviews.


Frequently asked questions

Native Daily and Weekly Flow schedules trigger on the exact day and time configured — including weekends. If your run should only happen on business days, add a Decision element at the start of the Flow that checks the day of the week and exits without calling the bulk action on Saturdays and Sundays. Flow's native scheduler doesn't support skipping specific days on its own — that logic has to live inside the Flow (or in a Scheduled Apex cron expression, if you're using that pattern).
Yes, multiple scheduled Flows can trigger at overlapping times. Each bulk action call runs in its own async context. For large batches scheduled at the same time, the combined API usage may approach org limits — stagger the Start Times by 30–60 minutes if they're large and would otherwise run simultaneously. Check a report on DH_Generation_Batch__c filtered to Status = In Progress during peak times to see concurrent activity.
No, zero records is a valid result — the run completes with a DH_Generation_Batch__c record showing Total = 0. This happens when all eligible records have already been processed (prevention field pattern working correctly) or when nothing matches the filter for that period. If you built a completion notification step, it will note the zero count. Review the DH_Generation_Batch__c history to confirm zero-record runs are expected for that time period.

Your scheduled batch Flow is now running automatically. Next in this series: Monitor and track batch document jobs in Dochly — understand the DH_Generation_Batch__c tracking record, the Dochly: Get Batch Status action, and org-wide batch visibility.

Dochly
Get Early Access Contact Us to Get Started with Dochly

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