Athens, Greece

Og Lead Gen Pipeline Claude Code

How We Built a Full Lead Generation Pipeline in 3 Days Using Claude Code

A diagnostic quiz that scores leads, generates personalized PDF reports, sends emails, logs to CRM, and runs a 21-day drip sequence. All automated. All built in 3 days with an AI coding agent.

We had a problem.

Proxima runs a consulting business. We help companies automate their operations. But our own lead generation was surprisingly manual. Someone fills out a form. We get an email. We respond when we get to it. Maybe we follow up. Maybe we forget.

Sound familiar?

Three days ago, we decided to fix it. Not with a 6-month project. Not with an agency. With Claude Code, an AI coding agent, and a clear plan.

The result: a fully automated pipeline that captures leads, scores them, generates a personalized 4-page PDF report, sends it via email, logs everything to a CRM, alerts our team in real time, and kicks off a 21-day nurture sequence. Zero manual steps.

Here’s exactly how we built it.

What We Built: The Full Pipeline

The system starts with a diagnostic quiz on our website. A visitor answers 10 questions about their business operations. Takes about 90 seconds.

Behind the scenes, the quiz calculates a score across 6 dimensions: tool complexity, data flow, operational pain, business visibility, AI readiness, and change history. It identifies their biggest bottleneck, estimates how many hours they’re losing per week, and assigns a lead temperature (hot, warm, or nurture).

The moment they submit, seven things happen automatically:

  1. Instant results page. The visitor sees a personalized diagnosis with their score, findings, and cost estimate. No waiting, no “we’ll email you.”
  2. PDF report generated. A 4-page branded report gets built on the fly: cover page, executive summary with dimension bars, key findings, and three personalized recommendations.
  3. Email delivered. The report lands in their inbox within 60 seconds, attached as a PDF.
  4. Team notification. Our Google Chat gets a message with the lead’s name, score, company, and temperature. Hot leads get flagged for an immediate call.
  5. CRM logged. Every field gets written to our lead pipeline. Score, level, bottleneck, persona, timestamp. All searchable.
  6. List segmentation. The contact gets added to the right email list based on their result level.
  7. Drip sequence started. A 4-email nurture series kicks off over 21 days. Day 3: educational content. Day 7: case study. Day 14: cost-of-waiting analysis. Day 21: final CTA.

All of this runs without anyone touching anything.

Diagnostic quiz pipeline diagram showing automated flow from quiz to PDF report to email to CRM to drip sequence
The complete pipeline: from quiz submission to 21-day nurture, fully automated.

The Tech Stack (Nothing Exotic)

Here’s what powers the pipeline:

  • Frontend: A self-contained HTML/CSS/JS quiz page hosted on WordPress. No React, no framework. Just clean vanilla JavaScript with smooth animations.
  • Backend orchestration: n8n (open-source workflow automation) running on our own server. One webhook receives the quiz data and routes it through 9 nodes.
  • PDF generation: Playwright (headless browser) renders an HTML template to a 4-page A4 PDF. Runs on a lightweight Node.js render server.
  • Email delivery: SMTP via n8n’s native email node. PDF attached as binary.
  • CRM: Google Sheets. Simple, but it works at our scale.
  • Notifications: Google Chat webhook.
  • List management: Mailjet for email segmentation and drip sequences.

No proprietary tools. No expensive SaaS subscriptions. Total infrastructure cost: what we were already paying for our VPS.

How Claude Code Made This Possible in 3 Days

Here’s the part that would have taken weeks without an AI coding agent.

Claude Code is Anthropic’s CLI tool for code generation and editing. You describe what you want. It reads your codebase, understands the context, and writes the code. Not snippets. Full, working implementations.

Day 1: Quiz Design and Frontend

We started with a strategy document. The quiz needed to feel empathetic, not evaluative. “Someone describing your Monday morning” rather than “a consultant grading you.”

Claude Code took the strategy doc, our brand guidelines (colors, fonts, tone), and our 12 buyer personas, and generated a complete quiz frontend. 56KB of self-contained HTML with:

  • 10 questions with custom card-based UI
  • Animated progress indicators
  • Smart scoring logic across 6 dimensions
  • Persona detection based on role + bottleneck answers
  • An email gate with consent management
  • A full results page with dimension bars, cost estimates, and personalized findings
  • Webhook submission to our automation server

The entire frontend was generated, tested, and published to WordPress in one session.

Day 2: Backend Automation

This is where it got interesting.

We described the pipeline we wanted. Claude Code wrote a Python script that builds the entire n8n workflow via API. Not clicking through a UI. Programmatically constructing 9 nodes with their parameters, credentials, and connections:

  • Webhook receiver
  • Data parsing and enrichment (scoring logic, persona mapping, lead temperature calculation)
  • Response node (instant OK back to the frontend)
  • Google Sheets integration (append row with all fields)
  • Google Chat notification (color-coded by lead temperature)
  • HTTP request to the PDF render server
  • Email builder (HTML template + PDF binary attachment)
  • SMTP sender
  • Mailjet list sync

It also extended our existing Node.js render server with a new /render-pdf endpoint. The PDF generator takes the quiz results and builds a branded 4-page HTML document, then uses Playwright to render it as a PDF.

Every node was wired up, tested, and activated. We hit the webhook with test data and watched the entire chain execute.

Day 3: Email Sequences and End-to-End Testing

The final day was about the drip engine. We had an existing email automation workflow. Claude Code read the existing code, understood the sequence mapping pattern, and extended it with quiz-specific email sequences. Four emails, each matched to the lead’s score and context.

Then: end-to-end testing. Real quiz submissions from the live website, through the webhook, through every automation step, to a real email with a real PDF attachment. We traced every execution in n8n to confirm all 9 nodes passed.

The entire build, from strategy to live production, took about 3 working days. Without an AI coding agent, this would have been a 2-3 week project.

What Made It Work: Lessons for Building Your Own

If you’re thinking about building something similar, here’s what we learned.

Start with the strategy, not the code

The diagnostic quiz works because we spent time on the empathy mapping first. We mapped 12 buyer personas, identified their specific pain points, and wrote questions that make them say “that’s me.” The technology just delivers the strategy.

Use what you already have

We didn’t buy a new quiz platform, a new CRM, or a new email service. We used WordPress, n8n, Google Sheets, and Mailjet. All tools we were already running. The AI coding agent wired them together in ways we hadn’t thought to do manually.

Automate the whole chain, not just one step

A quiz that collects data but requires manual follow-up is a leaky bucket. The value comes from the complete chain: instant results, instant email, instant team alert, automatic nurture. Every manual step is a place where leads fall through cracks.

AI coding agents are force multipliers

Claude Code didn’t replace our judgment. We designed the strategy, chose the tools, and defined the user experience. What it did was compress the implementation. Writing 56KB of frontend code, building a 9-node workflow, generating PDF templates, extending a render server, and debugging the entire chain. Tasks that require focus and time, but not necessarily human creativity at every line.

The honest assessment: Claude Code handled about 80% of the code generation. We handled the architecture decisions, the testing, and the edge cases. That ratio is what makes it a 3-day project instead of a 3-week one.

The Numbers So Far

We just launched, so the data is early. But the pipeline itself demonstrates what’s possible:

  • 90 seconds average quiz completion time
  • Under 60 seconds from submission to email with PDF in inbox
  • 4-page branded PDF generated on the fly per lead
  • Zero manual steps from quiz to CRM to nurture sequence
  • 3 days from concept to live production

Try It Yourself

Want to see the pipeline in action? Take our diagnostic quiz. It takes 90 seconds, and you’ll get a personalized report about where your business is actually losing time.

No sales pitch. Just data.

And if the results make you want to talk, let’s talk.

Share the Post:

Related Posts

Learn how we helped 100 top brands gain success