DEV Community

RyanCwynar
RyanCwynar

Posted on • Originally published at ryancwynar.com

Building a Lead Machine That Never Sleeps

Every founder knows the pain of lead generation. You spend hours researching, qualifying, and adding prospects to your CRM. Then you wake up the next day and do it again.

I got tired of that cycle. So I built an automated system that finds and qualifies leads around the clock—while I'm sleeping, eating, or working on other things.

Here's how it works and what I learned building it.

The Architecture

The system runs on a simple loop:

  1. Scheduled triggers fire every few hours across different campaigns
  2. Search queries target specific business types in specific locations
  3. Qualification logic filters out businesses that don't fit
  4. Database insertion adds qualified leads with all relevant contact info
  5. Notification alerts me when interesting prospects are found

Each campaign has its own criteria. A "receptionist" campaign targets dental offices and law firms that might need call handling. A "reviews" campaign finds medical practices that could benefit from reputation management. The system adapts its search and qualification logic per campaign.

The 80% Solution Philosophy

Here's the key insight: a mediocre system that runs 24/7 beats a perfect system you never build.

My prospect finder isn't particularly sophisticated. It uses basic search APIs, simple pattern matching for phone numbers and websites, and straightforward qualification rules. It misses some good leads and occasionally adds some marginal ones.

But it runs constantly. In the past week, it's added over 80 qualified prospects across multiple campaigns—while I did exactly zero manual prospecting.

Technical Implementation

The stack is intentionally boring:

  • Cron jobs trigger the searches at set intervals
  • Brave Search API for finding businesses (affordable and effective)
  • Web scraping to extract contact details when needed
  • PostgreSQL for storing prospects with campaign tags
  • Simple deduplication based on phone numbers and domains

The qualification logic is the interesting part. For each business type, I defined:

  • Must-haves: Phone number, website, location match
  • Nice-to-haves: Reviews presence, certain keywords in description
  • Disqualifiers: Chain businesses, already in database, certain red flags

The system scores each prospect and only adds those above a threshold. The threshold is intentionally low—I'd rather review and remove a few bad leads than miss good ones.

Rate Limits and Resilience

The biggest technical challenge? API rate limits. Search APIs don't like being hit constantly.

Solution: spread the load. Instead of running one massive search session, I run many small sessions throughout the day. Each session adds just a few prospects, staying well under rate limits. The aggregate effect is substantial.

The system also handles failures gracefully. If a search fails or returns no results, it logs the issue and moves on. No crashes, no alerts unless something is consistently broken.

What I'd Do Differently

If I rebuilt this from scratch:

  1. Better deduplication - Currently too simple, misses some variants
  2. Lead scoring ML - Train a model on which leads actually convert
  3. Multi-source enrichment - Cross-reference with LinkedIn, industry databases
  4. Automated outreach sequences - Connect directly to email/calling systems

But that's the trap. I could spend months building the perfect system, or I could ship the 80% solution and iterate.

I shipped. Now I have data. The next version will be smarter because I know which leads actually respond.

The Compound Effect

The real power isn't any single day's results. It's the compound effect over time.

80 prospects this week. 80 more next week. In a month, that's 300+ qualified leads I didn't manually find. In a quarter, over a thousand.

Meanwhile, the system keeps running. I wake up to notifications: "Added 4 new dental practices to the receptionist campaign." No effort required.

Takeaway

Stop thinking about lead generation as a task. Start thinking about it as a system.

Build something simple that runs continuously. Make it resilient to failures. Iterate based on real data.

The best automation isn't smart. It's relentless.

Top comments (0)