How I Built an AI-Powered Sales Pipeline in a Weekend
I built a prospecting engine that audits Shopify stores, scores leads, and writes personalized cold emails — all backed by real data. Here's exactly how.
By Mike Hodgen
The Problem With Cold Outreach
Most cold emails are garbage. Generic templates, vague promises, zero proof that the sender actually looked at your business. I know because I get them every day.
Generic vs. Data-Backed Email Comparison
"Hi Mike, I noticed your website could use some improvement." Delete.
"We help brands like yours grow 10x." Delete.
"Let's schedule a quick call to discuss synergies." Absolutely not.
When I decided to start reaching out to Shopify brands for my AI consulting work, I knew I needed something different. Every email had to prove I'd actually looked at their store. Not "I noticed your website" — more like "22 of your 83 products have descriptions under 50 words, and your blog hasn't posted in 4 months."
That's the kind of specificity that gets replies. The problem is, doing that research manually takes 20-30 minutes per store. At that rate, I could prospect maybe 10 brands per week.
So I built a system to do it in seconds.
What the Pipeline Actually Does
The system runs in five stages, loosely inspired by enterprise sales intelligence platforms but built for one person with Python and Claude.
Store Audit Scoring Breakdown
5-Stage AI Sales Pipeline Flow
Stage 1: Discovery. I import Shopify store URLs — individually or from CSV batches. The system normalizes domains, deduplicates, and adds them to a JSON pipeline.
Stage 2: Audit. This is where it gets interesting. Most Shopify stores expose a /products.json endpoint publicly. No admin token needed. The system fetches that, plus the homepage HTML, blog pages, and contact information. Then it scores everything:
- Product descriptions: word count distribution, how many are empty or thin
- Meta tags: SEO titles and descriptions present or missing
- Blog health: post frequency, content depth, heading structure
- Page structure: structured data, Open Graph tags, H1 usage
- Tech stack: which Shopify apps they're running (Klaviyo, Yotpo, Gorgias, etc.)
Each area gets a score. Problems get flagged with severity levels and estimated fix time. The scoring thresholds came from the same engine I built for our brand's SEO toolkit — battle-tested against 500+ real products.
Stage 3: Scoring. A composite algorithm ranks leads by opportunity. It factors in store size (product count on a log scale), number and severity of problems found, and estimated revenue tier. Bigger stores with more fixable problems rank highest.
Stage 4: Composition. Claude writes the outreach email, but it's not working from a blank page. The prompt includes the full audit data — every score, every problem, every specific number. The AI's job is to pick the most compelling finding, turn it into a useful tip, and write a 150-word email that sounds like one founder talking to another.
No "I noticed your website." Instead: "Quick one — 18 of your products have descriptions under 50 words. If you expanded your top 5 sellers with ingredient stories and sourcing details, Google would actually start indexing them."
Stage 5: Review and send. Every email is drafted first, never auto-sent. I review in either the CLI or a web dashboard, and the email renders in branded HTML that matches my site's design. Plain text version goes along for deliverability.
The Technical Stack
The whole thing is about 5,500 lines of Python, split between a CLI engine and a FastAPI web dashboard.
Technical Architecture: CLI + Web Dashboard + Shared JSON State
The CLI handles batch operations — importing 25 stores, auditing all of them, scoring and ranking. These are operations where a terminal is faster than clicking.
The web dashboard handles everything visual — a kanban pipeline board, lead detail panels with audit scores and progress bars, email composition with live Claude calls, and HTML email previews. It reads the same JSON state file as the CLI. No database, no sync issues.
For email composition, I use Claude Sonnet. For sending, Resend. For store analysis, it's requests and BeautifulSoup — nothing fancy. The entire dependency list is seven packages.
The key architectural decision was keeping the state in a single JSON file. For a personal sales pipeline with dozens to low hundreds of leads, this is simpler than spinning up a database. The file is human-readable, git-trackable, and both the CLI and web dashboard read from it.
What I Learned Building It
Public APIs are underrated. Most Shopify stores expose /products.json without authentication. That endpoint gives you product titles, descriptions, prices, images, variants, and tags. Combined with homepage HTML parsing, you can build a surprisingly detailed picture of a store's health without any privileged access.
Lead Scoring Algorithm: Problem Density vs Store Size
Some stores block it — about 20% in my testing returned empty results. Those need manual investigation or alternative data sources. But for the 80% that expose it, you get rich data for free.
AI-written emails need constraints, not creativity. The first version of my email prompts was too open-ended. Claude would write beautiful, persuasive emails that all sounded the same. The breakthrough was giving it a rigid structure: lead with a specific tip, one line of credibility, question CTA, sign off. Under 150 words. Reference at least one number from the audit.
Constraints made the output better, not worse. Every email now references real data from the prospect's store. That's the differentiator.
Scoring is more art than science. My first composite scoring formula ranked the biggest stores highest regardless of problems. A store with 250 products and zero issues scored higher than a store with 60 products and six fixable problems. I had to reweight toward problem density and opportunity — the stores most likely to need help, not the biggest ones.
Plain text beats HTML for cold email. I built branded HTML emails that match my website's design. They look great in preview. But for actual cold outreach, plain text performs better. It feels personal, doesn't trigger spam filters, and loads instantly on mobile. The HTML version is there for follow-ups and warm conversations.
The Results
I audited and scored 25 Shopify brands in one batch run. The whole process — fetching products, scraping homepages, analyzing blogs, scoring, ranking — took about 4 minutes. Doing that manually would have been a full day.
The top-ranked prospects had specific, quantifiable problems: thin product descriptions, missing meta tags, inactive blogs with potential. These aren't guesses. They're data points that become the opening line of a personalized email.
I haven't started sending yet — the system is built to draft and review first. But the pipeline is loaded, the emails are ready to compose, and every one will reference something real about the prospect's store.
Why This Matters Beyond My Use Case
Every business that does outbound sales faces the same problem: personalization doesn't scale. You either send generic templates to thousands (low response rate) or you research each prospect manually (doesn't scale).
AI changes that equation. Not by writing better generic emails — by doing the research at scale and writing emails that reference real findings. The prospect can tell the difference between "I noticed your website" and "your blog hasn't posted since October and your top products are invisible to Google."
The technical components aren't complex. Public API fetching, HTML parsing, a scoring algorithm, and an LLM with good prompts. The hard part is the same as any AI system: designing the right constraints, feeding it real data, and keeping a human in the loop for quality.
I built this for my own prospecting. But the pattern — automated research, structured scoring, AI-drafted outreach backed by real data — applies to any business that needs to find and qualify leads at scale.
Try It Yourself
The entire system runs locally from a Python CLI or a web dashboard. No external database, no complex infrastructure. If you're doing outbound sales and you're tired of generic templates, the approach is straightforward:
- Find public data about your prospects (APIs, websites, social profiles)
- Score and rank based on signals that matter to your business
- Feed real findings into AI-powered email composition
- Always draft first, send manually
The specificity is the moat. Anyone can send a thousand generic emails. Very few people send a thousand emails that each reference something real about the recipient's business.
That's what AI makes possible.
Get AI insights for business leaders
Practical AI strategy from someone who built the systems — not just studied them. No spam, no fluff.
Ready to automate your growth?
Book a free 30-minute strategy call with Hodgen.AI.
Book a Strategy Call