Scheduler architecture

Mongo-backed scheduled email and calling campaign launches.

Campaign scheduling is stored on campaign documents, not in a separate queue. A backend cron checks due campaigns every minute and launches them through the same services used by manual launch.

Runtime flow

The Scheduler page composes existing email and calling campaign APIs. Cancelling a schedule calls the campaign-specific unschedule endpoint and returns the item to draft/immediate mode.

Campaign scheduler lifecycle
Rendering architecture diagram...

Implementation map

Frontend

/scheduler plus schedule controls inside /email-campaigns and /calling-campaigns.

Backend

CampaignSchedulerService, EmailCampaignsService.findDueScheduled/launchCampaign, CallingCampaignsService.findDueScheduled/launchCampaign.

Data

EmailCampaign uses status and scheduledAt; CallingCampaign uses status, scheduleType, scheduledAt, and timezone.

Failure behavior

Failed launches are logged and unscheduled where possible so the cron does not retry forever every minute.