LeadRefinery — How the Platform Works

The dial gate

Traced at commit 51a6cfa · libs/temporal/src/activities/dial-gate.ts · refusal counts from dial_gate_audit, 2026-09-09

Summary

  1. The gate runs 13 checks before each dial.
  2. The checks run in a fixed order.
  3. The gate stops at the first refusal.
  4. The cheapest and most decisive checks run first.
  5. All 13 checks read one database snapshot.
  6. The gate evaluates the checks at dial time. It does not use the result from schedule time.
  7. The gate writes every verdict to the audit record.
  8. Check 11 refuses more dials than checks 13, 6 and 7 together. Caller-ID health stops most traffic, not compliance.
Thirteen checks in the order they run, drawn as a single line down the page. In order: dialable state, the stop list, consent, scrub freshness, the client's exclusion list, geography, jurisdiction, holidays, per-client frequency, platform-wide frequency, caller-ID availability, provider capacity, and the safety breaker. Beside each is how many dials it has actually refused. The caller-ID check has refused 354,514, marked as more than the next three combined; the breaker 90,462; geography 79,055; jurisdiction 50,886; scrub freshness 40,836; the stop list 36,047; state 6,958; frequency 772; the rest none yet. The breaker is annotated as skipped for rehearsals. All thirteen read one database snapshot. The line ends in two boxes: the phone rings, and every verdict is written down and kept for ten years.
The 13 checks and the refusals of each check.

The 13 checks

  1. state_check — refuses a lead that is not in a dialable state. 6,958 refusals.
  2. suppression_check — refuses a stopped person. 36,047 refusals. See Opt-outs.
  3. consent_check — refuses a lead with no consent record. No refusals yet.
  4. scrub_freshness — refuses a number with an old do-not-call scrub. 40,836 refusals.
  5. exclusion_check — refuses a number on the exclusion list of the client. No refusals yet.
  6. geo_check — refuses a number outside the permitted area. 79,055 refusals.
  7. jurisdiction_check — refuses a dial that breaks a state rule or a federal rule. 50,886 refusals.
  8. holiday_check — refuses a dial on a holiday at the location of the person. No refusals yet.
  9. frequency_check — refuses too many attempts from one client. 772 refusals.
  10. global_freq_check — refuses too many attempts from all clients. No refusals yet.
  11. did_check — refuses a dial when no healthy caller ID is free. 354,514 refusals.
  12. provider_capacity — refuses a dial at the concurrency limit. No refusals yet.
  13. breaker_check — refuses a dial when a safety breaker is open. 90,462 refusals.

Read the counts correctly. “No refusals yet” usually means that the condition has not occurred. It does not mean that the check is inactive.

Rules

  1. The order is a design decision. Do not change the order without a decision.
  2. Check 2 is early so that a stopped person is never assessed for consent, list freshness or capacity.
  3. All 13 checks use one transaction and one security context.
  4. Each check formerly opened its own transaction. Each check then read different data.
  5. One snapshot makes the recorded inputs explain the recorded verdict.
  6. A person can stop a lead on Tuesday that the pacer scheduled on Monday. Eligibility from schedule time is always old.

Exception for rehearsals

  1. Check 13 returns early for a rehearsal.
  2. Without this exception, a rehearsal cannot test the other checks while a breaker is open.
  3. A breaker has been open since 4 September. All current measurements come from rehearsal traffic.
  4. The system records breakerBypassedForDryRun on the attempt.
  5. This record prevents confusion between a rehearsal and a live dial.

Opt-outs — check 2 in full, and the two mechanisms that write the records it reads.