Skip to content

Autopilot: Scheduled execution during business hours #5

@madhavcodez

Description

@madhavcodez

Feature

The autopilot orchestrator exists and works when triggered manually (POST /autopilot/run), but scheduled automatic execution is not yet wired up.

Current State

  • run_autopilot_cycle() runs full pipeline: ingest → score → research → create campaigns
  • ✅ Manual trigger via API and dashboard "Run Autopilot" button
  • ✅ APScheduler is initialized in the backend lifespan
  • ❌ Autopilot job not scheduled on the cron (currently only ingest + scoring jobs exist)
  • ❌ No business hours enforcement for automatic execution
  • ❌ No concurrency guard for overlapping cycles
  • ❌ No email/call execution in autopilot (only creates campaigns, doesn't send)

Desired Behavior

Every day at 9 AM and 3 PM (Pacific):
  1. Ingest new jobs from all sources
  2. Score all unscored matches (no cap)
  3. Deep research top 5 unresearched matches
  4. Auto-create campaigns for discovered contacts
  5. Generate outreach packages (call + email + LinkedIn)
  6. Execute pending emails
  7. Execute pending calls (if Twilio webhook configured)

Implementation

Update backend/app/services/scheduler.py:

scheduler.add_job(
    _run_autopilot, "cron",
    hour="9,15", minute=0,
    timezone="America/Los_Angeles",
    id="autopilot_job"
)

Labels

feature, autopilot, scheduler

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions