Skip to content

Leads: schedule the campaign tick (pg_cron) - #125

Merged
ralyodio merged 1 commit into
masterfrom
feat/outreach-cron
Jul 26, 2026
Merged

ralyodio merged 1 commit into
masterfrom
feat/outreach-cron

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Adds the pg_cron job that drives outreach campaigns. Without it the machinery existed but only moved when someone clicked Run now.

  • crawlproof-outreach, */15 * * * *, same pattern as crawlproof-scan-watches (reads site_url / cron_secret from public.cron_config)
  • Bounded per tick: 15 discovered, 8 researched, 5 sends
  • Will not send from a campaign with auto_send off (the default) — those discover, scan, research and draft, logging every message as a dry run

Applied to production and verified active = true. There are currently 0 campaigns, so the tick is a no-op until one is created.

🤖 Generated with Claude Code

The campaign machinery existed but nothing drove it — campaigns only moved
when someone clicked "Run now", which makes it manual outreach with extra
steps. This is the pg_cron job that closes the loop.

Every 15 minutes, matching scan-watches. The tick is cheap and usually idle:
it selects only active campaigns and each is bounded per tick (15 discovered,
8 researched, 5 sends). Faster would not help, because the slow step is the
scan worker and the daily caps are the real throttle.

A tick will not send from a campaign with auto_send off, which is the
default. Those discover, scan, research and draft, logging every message as
a dry run — turning sending on stays a separate deliberate act, still gated
on a CAN-SPAM postal address.

Applied to production; verified scheduled and active.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 07a283e into master Jul 26, 2026
7 checks passed
@ralyodio
ralyodio deleted the feat/outreach-cron branch July 26, 2026 18:02
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant