SanctuaryDOCS
Open App
Overview

Background Jobs

Access:Super Admin

SanctuaryOS runs a set of automated background jobs that keep your data current, generate alerts, and handle recurring tasks without manual intervention. These jobs are managed by the Tenant Scheduler, which dispatches work every hour based on each tenant's local timezone.

Getting Here

Navigation: Settings → System → Background Jobs

The Background Jobs settings page shows all scheduled tasks, their last run status, and allows you to manually trigger any job with the “Run Now” button.

How Scheduling Works

The master scheduler runs every hour on the hour. For each active tenant, it checks the tenant's local timezone (derived from the tenant or primary campus configuration, defaulting to America/Toronto) and dispatches the appropriate jobs based on the local hour and day of the week.

Every job execution is tracked in the JobRunLog table with a status of RUNNING, SUCCESS, or FAILED, along with duration and any error messages. This makes it easy to audit job history and diagnose failures.

Job Schedule Reference

Nightly Window (2am–5am local)

FieldTypeDescription
Serve Stats RecalculationDaily, 2amRecomputes serve counts (90-day, YTD, all-time), confirmation rates, and estimated hours for every active team member.
Care Milestone ScanDaily, 2amScans all members for upcoming birthdays, wedding anniversaries, baptism anniversaries, membership anniversaries, and salvation anniversaries within the configured lead-day window (default 30 days).
Care Snooze WakeupDaily, 3amReactivates snoozed care items whose snooze period has expired.
Bereavement AnniversariesDaily, 3amCreates care milestones for bereavement anniversary dates approaching within the lead-day window.

Morning Window (6am–8am local)

FieldTypeDescription
Service MaterialisationMonday, 6amCreates upcoming service instances from active service patterns for the next several weeks. Ensures your calendar always has services ready.
Monthly Statements1st of month, 6amAuto-generates giving statements for the previous month (if enabled in tenant configuration). Can optionally auto-email statements to donors.
Absence Alert ScanMonday, 7amScans attendance records to identify members who have missed a configurable number of consecutive services (default: 2). Creates, updates, or resolves absence alerts.
Care Follow-Up RemindersDaily, 7amSends reminder notifications for care items with upcoming or overdue follow-up dates.
Circles Join DigestMonday, 8amSends a weekly digest email to group leaders summarizing pending join requests.

Weekly Jobs (Monday)

FieldTypeDescription
Burnout ScanMonday, 1amIdentifies volunteers whose serve count in the last 90 days exceeds the team average by the configured threshold multiplier (default: 2x). Sends burnout alerts to team leaders.

Queue-Based Jobs (On Demand)

FieldTypeDescription
Statement GenerationOn demandProcesses statement runs via BullMQ. Triggered when a user creates a statement run from the Steward module.
ZIP GenerationOn demandPackages generated statement PDFs into downloadable ZIP files. Runs with concurrency of 3.
ZIP CleanupEvery 30 minutesDeletes expired ZIP files from storage to free disk space.
Circles Health ScoreOn demandRecalculates health scores for small groups. Triggered after attendance is logged, or can be run as a batch for all groups.

Subscription and Platform Jobs

FieldTypeDescription
Trial RemindersDaily, 9amSends email reminders to churches at 15, 8, 3, and 1 days before trial expiration.
Trial Expiration CheckDaily, 10amNotifies churches whose trial period has ended.
DunningDaily, 11amSends payment reminder emails to past-due accounts. Auto-suspends accounts past due for over 30 days.
Data RetentionDaily, 3amSends data retention warnings to cancelled tenants at 30, 7, and 1 days before the 1-year purge deadline. Deactivates tenants cancelled over 1 year ago.
Signup CleanupHourly (:30)Expires stale pending signups that have been in INITIATED or EMAIL_VERIFIED status for over 24 hours.
Onboarding SequenceDaily, 11amSends timed onboarding emails: welcome (day 0), import members (day 2), configure giving (day 5), setup services (day 8), invite team (day 12).
Escalation CheckEvery 6 hoursFinds volunteer confirmation requests that have timed out (default 48 hours) and auto-assigns the slot to the next available candidate.
Re-confirmationDaily, 10amSends "Still coming?" emails to confirmed volunteers whose service is within the next 24-48 hours.

Running Jobs Manually

From the Background Jobs settings page, click the Run Now button next to any job to trigger it immediately. The page will refresh after a few seconds to show the updated status. Manual runs are logged the same way as scheduled runs.

This is useful for testing, recovering from a missed schedule, or forcing a refresh after importing data.

Monitoring Job Health

Each job card on the settings page shows:

  • Status indicator — green (last run succeeded), red (last run failed), blue (currently running), gray (never run)
  • Schedule — the cron expression in human-readable form
  • Last run — relative timestamp (e.g., “2h ago”)
  • Duration — how long the last run took in milliseconds
  • Error details — hover over the warning icon to see the error message for failed jobs

Related Pages

PreviousStripe
NextAbsence Alerts