Skip to main content

Function: runDueCandidateFollowUps()

runDueCandidateFollowUps(svc): Promise<{ completed: number; drafted: number; processed: number; }>

Defined in: src/server/services/followUp.ts:72

Process candidate follow-up enrollments that are due: materialize the next step's task, draft an outbound_emails row (status='draft') for email steps using the candidate template, then advance the enrollment to the next step (or complete it). Nothing auto-sends — a human approves the draft. Idempotent enough for a cron: due-date gating + per-step advancement avoid double-materialization.

Parameters

svc

SupabaseClient

Returns

Promise<{ completed: number; drafted: number; processed: number; }>