#16. Scheduled Background Jobs
iSyncSF includes a set of background jobs that keep the system running smoothly. These scheduled jobs handle OAuth token refresh, metadata cache updates, stale job resumption, and audit log cleanup — all configurable with standard Salesforce CRON expressions.
Purpose: Scheduled jobs handle automated maintenance and operational tasks that keep the application healthy without user intervention. They resume paused sync jobs, refresh OAuth tokens, update metadata caches, and clean up old data to prevent storage overuse. Without these jobs, paused syncs would stay paused, tokens would expire, and data storage would grow indefinitely. Where It Fits: Scheduled jobs are configured during initial setup (Setup Assistant -> Scheduled Jobs tab) and run continuously in the background. They are the "operations layer" of the application. Users typically configure them once and forget about them unless they need to adjust schedules or retention periods.
#16.1 System Jobs
| Job | Schedule | Purpose |
|---|---|---|
| Sync Job Manager | Every hour | Resumes paused sync jobs (max 5 concurrent) |
| Metadata Cache Refresh | Bi-weekly (1st & 15th) | Refreshes object relationship metadata cache |
| OAuth Token Refresh | Every hour | Refreshes expiring OAuth tokens for connected orgs |
#16.2 Cleanup Jobs
| Job | Schedule | Retention | Purpose |
|---|---|---|---|
| Audit Log Cleanup | Daily at 2 AM | 90 days | Purges old sync audit log records |
| Application Log Cleanup | Daily at 3 AM | 60 days | Purges old application log records |
| Job Record Cleanup | Weekly Sunday at 4 AM | 180 days | Purges old sync job records |
#16.3 Managing Jobs
What Users Can Do: - Schedule/reschedule any job with a custom CRON expression - Change retention periods for cleanup jobs - Abort running scheduled jobs - Apply recommended default settings with one click - View job status, next fire time, and previous fire time
#Available Scheduled Jobs
iSyncSF includes the following schedulable background jobs:
- OAuth Token Refresh: Proactively refreshes OAuth tokens for all connected orgs before they expire. Recommended to run every 1-2 hours.
- Metadata Cache Refresh: Updates the cached schema information for connected orgs. Run daily or after schema changes in connected orgs.
- Stale Job Resumption: Detects sync jobs that were interrupted (e.g., by an org restart) and automatically resumes them. Run every 15-30 minutes.
- Application Log Cleanup: Deletes application log records older than the configured retention period. Run daily or weekly.
- Audit Log Cleanup: Deletes audit log records older than the configured retention period. Run weekly or monthly depending on storage needs.
#CRON Expression Examples
Salesforce CRON expressions use the format: Seconds Minutes Hours Day_of_month Month Day_of_week Optional_year. Common examples:
0 0 * * * ?— Every hour0 0 2 * * ?— Daily at 2:00 AM0 0 0 ? * MON— Every Monday at midnight0 0 */2 * * ?— Every 2 hours0 30 1 * * ?— Daily at 1:30 AM
#Concurrency Limits
Salesforce limits the number of concurrent batch and scheduled jobs. iSyncSF uses sequential job chaining (one batch completes before the next starts) to stay within these limits. If you see errors about exceeding the concurrent batch job limit, check for other packages or custom jobs that may be consuming the available slots, and consider scheduling iSyncSF jobs during off-peak hours.