All modules
Module 18 · business · intermediate
Lead Enrichment and Scoring
After this module you can turn a bare email address into a researched, scored lead (what the company does, what tools they use, whether they're growing, how well they fit your offer) without paying for a data provider.
What it does
POST /webhook/leads/enrich with {email, website?, name?, company?}:
- Works out the website (given, or guessed from a business email domain).
- Fetches the homepage and extracts signals: page title and description, tech stack (WordPress, Shopify, HubSpot, Google Analytics, Wix, Squarespace, Webflow, Intercom, Stripe), online booking (Calendly, Acuity…), hiring, emails, phones, social profiles and address.
- Scores the lead against your ICP in Settings with transparent points (target industry +25, business email +15, booking +10, hiring +10, tech fit +10…).
- Optionally adds an AI profile: summary, industry, size guess, fit score and a specific pitch angle. If AI is unavailable, the response falls back to rules and says why.
- Saves the enriched lead to a Google Sheet (upsert by email) and branches hot leads to a sales alert.
?dry_run=true returns the enrichment without AI or saving; ?ai=false skips AI only.
Demo websites included. workflow/learner-demo-sites.json serves three fake company homepages (a dental clinic, a SaaS company, a personal blog) at /webhook/course-18-demo-sites/demo-sites/<site>, so you can learn and test without scraping real sites.
Flow
Enrich Lead → Settings → Normalize Lead → Valid? ─no→ 400
└yes→ Has Website? ─yes→ Fetch Website (never errors) ─┐
└no─────────────────────────────────┴→ Extract Signals → Rule Score → Use AI? ─yes→ AI Profile ─┐
└no──────────────┴→ Combine → Dry Run?
Dry Run? ─yes→ Respond Enriched
└no─→ Save to Sheet (continue on error) → Save Result → Respond + Hot Lead? → Alert Sales
Verification status (n8n 2.43.6)
- 21/21 checks without credentials or internet against the demo sites: dental clinic → hot 100 with all signals found; SaaS → warm 65; blog + Gmail → cold 10; 404 site and an unresolvable domain handled; validation 400; AI fallback and unsaved-sheet reporting.
- Not run with OpenAI, Google Sheets, or real company websites. Real sites vary a lot (JavaScript-rendered pages, bot protection); see the lesson's limits.
WITH_CREDS=1 ./test/test.shcovers the credentialed path.
Files
| File | Tier | Purpose |
|---|---|---|
| lesson.md | Free | Step-by-step build |
| workflow/starter.json | Free | Input, validation and the website fetch |
| workflow/learner.json | Learner | Finished enrichment workflow |
| workflow/learner-demo-sites.json | Learner | Three demo company websites for testing |
| workflow/code/ | Learner | Readable copies of the Code nodes |
| exercises.md | Learner | Practice tasks |
| solutions.md | Learner | Exercise solutions |
| notes.md | Private | Learning log |
| sell/ | Private | Offer, video script, blog post |