Schedule a Batch Document Run in Salesforce with Dochly
Why schedule batch runs
Manual batch jobs require someone to remember to run them, verify the report, and click Launch. Scheduled jobs remove the human dependency entirely — they run at the right time every time, using the latest report data, without any action from your team.
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.
The report is re-queried at each scheduled run time — so this month's closed deals automatically become this month's invoices, without updating any report filter manually.
Schedule large jobs at 6 AM before business hours. Batch processing during off-peak hours avoids API limit collisions with user activity and reduces the risk of jobs affecting system performance during the working day.
Completion and failure notification emails mean your team knows the job ran successfully — or immediately knows if something went wrong — without having to check manually.
Schedule types
Dochly supports four schedule frequencies for batch document runs:
Runs every day at the configured time. Best for: compliance document generation, daily activity reports, or any workflow where documents need to be generated every business day. Use with relative date filters like "Today" or "Yesterday".
Runs on a specific day of each week. Best for: renewal notice batches, weekly account statement generation, or any document that goes out on a fixed weekly cadence. Common setting: every Monday at 9 AM.
Runs on a specific day of each month. Best for: invoice runs, monthly compliance documents, account summaries. Most common batch schedule. Common setting: 1st of month at 7 AM or last day of month at 11 PM.
Full cron expression for any schedule not covered by the above — e.g. first business day of each quarter, last Friday of each month, every 6 hours. Requires familiarity with cron syntax. Use for complex recurring patterns.
Step-by-step: creating a scheduled batch job
Open Scheduled Jobs in Dochly
Go to Dochly app → Batch Jobs → Scheduled Jobs tab → click New Scheduled Job. The scheduled job configuration panel is the same as the manual job panel with an additional Schedule section.
Configure the job (report, template, output)
Complete the standard job configuration as you would for a manual batch run — name, source report, template, output format, storage, and delivery settings. These settings apply every time the schedule triggers. See Run a batch job from a report for full configuration details.
Configure the schedule
In the Schedule section, set:
- Frequency: Daily, Weekly, Monthly, or Custom cron
- Day: Day of week (Weekly) or day of month (Monthly)
- Time: Hour and minute in 24-hour format — e.g. 07:00 for 7 AM
- Timezone: Your org's primary timezone — ensures the job runs at the expected local time
- Start date: When the schedule becomes active — today or a future date
- End date: Optional. Leave blank for indefinite recurring jobs. Set for time-limited campaigns.
Test with Run Now before activating
Before activating the schedule, click Run Now to trigger an immediate test run using the current report data. This verifies the full configuration — 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. Fix any issues before activating the schedule.
Activate the schedule
Click Activate. The schedule is now live and will trigger automatically at the next occurrence of the configured time. The scheduled job detail page shows the next 5 upcoming run times for verification.
The job also appears in Salesforce Setup → Apex Jobs → Scheduled Jobs — you can see its exact next run datetime there alongside any other scheduled Apex.
Schedule configuration examples
Monthly invoice run
MonthlyWeekly renewal notice batch
WeeklyQuarterly compliance report
Custom cronPrevention fields for recurring jobs
For any recurring scheduled job, configure a prevention field to ensure each record is processed exactly once per cycle — not re-generated on every run. Without a prevention field, every run of a monthly invoice schedule would regenerate invoices for all records that still match the report filter.
Add a checkbox field (e.g. Invoice_Sent__c) to the object. Add a report filter: Invoice_Sent__c = FALSE. Configure a post-generation field update to set Invoice_Sent__c = TRUE. On each run, only records with the field as FALSE are included — already-processed records are automatically excluded.
For monthly cycles, reset the prevention field at month-end: a 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 Now twice 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 active schedules
All active scheduled jobs are visible in Dochly → Batch Jobs → Scheduled Jobs. From here you can:
Click Deactivate on a scheduled job to pause it. The job stops triggering but all configuration is preserved. Reactivate when needed — the next trigger will be at the next occurrence of the configured schedule after reactivation.
Deactivate the job, edit any settings (schedule time, report, template, delivery), then reactivate. You cannot edit a running job — deactivate first. Changes take effect on the next scheduled run after reactivation.
Trigger an immediate run of the scheduled job outside of its schedule — useful for ad hoc processing or verifying a configuration change before the next scheduled run. Does not change the schedule — the next scheduled run still occurs at its regular time.
Every run of a scheduled job is logged with start time, end time, record count, success count, and failure details. Access via the job detail page → Run History tab. Use this to audit that the job ran correctly and at the expected times.
Frequently asked questions
Scheduled batch jobs are now running automatically. Next in this series: Monitor and track batch document jobs in Dochly — understand the job history log, per-record status, failure analysis, and org-wide batch visibility tools.
Rated 5 stars · Native Salesforce app · Free to install