Skip to main content

Function: autoEnrollByTriggers()

autoEnrollByTriggers(svc, companyId, todayIso): Promise<AutoEnrollResult>

Defined in: src/server/services/facility-cadence.ts:88

Auto-enroll prospects into sequences whose enrollment_trigger fires:

  • new_signal → prospect facilities with an active target-role job signal,
  • score_tier1 → prospect facilities currently in Tier 1. Only prospects (never active clients) are enrolled, and a facility already in ANY active cadence is skipped (no double cadences). Idempotent and bounded by AUTO_ENROLL_CAP per run; stage_change is not wired. Tasks are materialized so the worklist fills immediately.

Parameters

svc

SupabaseClient

companyId

string

todayIso

string

Returns

Promise<AutoEnrollResult>