artenis.alija
ende
n8n workflowsOpen-source project

n8n B2B Lead Generation Pipeline

Eleven n8n workflows that source leads from Google Maps, research each company with an LLM, verify contacts and run a four-touch email sequence with reply handling.

Source repositories

n8n workflows

Each diagram is drawn from the workflow’s own JSON. Download a file and import it in n8n (Workflows → Import from file), then attach your own credentials — every credential and instance ID has been removed.

01 — Sourcing (GMaps daily)

10 nodes · 10 connections

Download JSON
Daily 03:00 TriggerCRONDaily 03:00 TriggerLoad Niche Queries{ }Load Niche QueriesSplit QueriesLOOPSplit QueriesScrape Google MapsHTTPScrape Google MapsFlatten Results{ }Flatten ResultsSplit ResultsLOOPSplit ResultsCheck Domain ExistsPGCheck Domain ExistsIs New Domain?IFIs New Domain?Insert New LeadPGInsert New LeadAlready Exists (skip)—Already Exists (ski…
  • Trigger
  • Code
  • Logic
  • HTTP
  • Database

02 — Enrichment (every 10 min)

17 nodes · 17 connections

Download JSON
Every 10 MinCRONEvery 10 MinFetch 5 New LeadsPGFetch 5 New LeadsSplit LeadsLOOPSplit LeadsAttach Timestamp{ }Attach TimestampRead RPM WindowPGRead RPM WindowCheck Throttle{ }Check ThrottleIs Throttled?IFIs Throttled?Skip (rate limited)—Skip (rate limited)Scrape WebsiteHTTPScrape WebsiteExtract Signals{ }Extract SignalsBuild Groq Prompt{ }Build Groq PromptCall Groq 8BHTTPCall Groq 8BParse Groq Response{ }Parse Groq ResponseUpdate Lead RowPGUpdate Lead RowPrepare Contacts{ }Prepare ContactsInsert ContactsPGInsert ContactsUpdate RPM CounterPGUpdate RPM Counter
  • Trigger
  • Database
  • Logic
  • Code
  • HTTP

02b — Qualification Gate

13 nodes · 16 connections

Download JSON
Every 10 Min (+2 offset)CRONEvery 10 Min (+2 of…Fetch Enriched LeadsPGFetch Enriched LeadsSplit LeadsLOOPSplit LeadsEnglish Check{ }English CheckEnglish Pass?IFEnglish Pass?Disqualify: Not EnglishPGDisqualify: Not Eng…Compute Size ScoreHTTPCompute Size ScoreAttach Size Score{ }Attach Size ScoreSize Pass?IFSize Pass?Disqualify: Too SmallPGDisqualify: Too Sma…Fit Score >= 4?IFFit Score >= 4?Disqualify: Low FitPGDisqualify: Low FitSet QualifiedPGSet Qualified
  • Trigger
  • Database
  • Logic
  • Code
  • HTTP

02c — Opportunity Research (70B)

12 nodes · 12 connections

Download JSON
Every 15 MinCRONEvery 15 MinFetch Qualified No ResearchPGFetch Qualified No …Split LeadsLOOPSplit LeadsRead RPM WindowPGRead RPM WindowCheck Throttle{ }Check ThrottleIs Throttled?IFIs Throttled?Skip (throttled)—Skip (throttled)Build 70B Research Prompt{ }Build 70B Research …Call Groq 70BHTTPCall Groq 70BParse + Validate{ }Parse + ValidateStore Research ArtifactPGStore Research Arti…Update RPM CounterPGUpdate RPM Counter
  • Trigger
  • Database
  • Logic
  • Code
  • HTTP

03 — Contact Discovery + Email Verify

18 nodes · 19 connections

Download JSON
Every 15 MinCRONEvery 15 MinFetch Leads Needing ContactsPGFetch Leads Needing…Split LeadsLOOPSplit LeadsLoad Existing C-LevelPGLoad Existing C-Lev…Count C-Level Contacts{ }Count C-Level Conta…Has 2+ C-Level?IFHas 2+ C-Level?Google: LinkedIn C-Level SearchHTTPGoogle: LinkedIn C-…Registry LookupHTTPRegistry LookupMerge + Dedupe Contacts{ }Merge + Dedupe Cont…Split ContactsLOOPSplit ContactsGenerate Email Permutations{ }Generate Email Perm…Split Permutations{ }Split PermutationsVerify Email via ReacherHTTPVerify Email via Re…Score Email Result{ }Score Email ResultPick Best Email{ }Pick Best EmailAssign Primary Contact{ }Assign Primary Cont…Upsert ContactPGUpsert ContactSkip (enough contacts)—Skip (enough contac…
  • Trigger
  • Database
  • Logic
  • Code
  • HTTP

04a — Outreach Touch 1 (Day 0)

22 nodes · 23 connections

Download JSON
Weekdays 09:00CRONWeekdays 09:00Read Send StatePGRead Send StateCheck Daily Cap{ }Check Daily CapAt Cap?IFAt Cap?Stop (daily cap reached)—Stop (daily cap rea…Fetch Sendable LeadsPGFetch Sendable LeadsBuild Touch 1 Prompt{ }Build Touch 1 PromptGenerate EmailHTTPGenerate EmailParse Email Output{ }Parse Email OutputNEEDS_HUMAN?IFNEEDS_HUMAN?Telegram: NEEDS_HUMAN AlertHTTPTelegram: NEEDS_HUM…Validate: No-Money + No-AI-Tells{ }Validate: No-Money …Validation Passed?IFValidation Passed?Can Regen?IFCan Regen?Increment Regen Counter{ }Increment Regen Cou…Telegram: Escalate Validation FailHTTPTelegram: Escalate …Append Signature{ }Append SignatureSend via GmailMAILSend via GmailInsert email_sendsPGInsert email_sendsUpdate Lead: ContactedPGUpdate Lead: Contac…Increment Send CounterPGIncrement Send Coun…Telegram: Email SentTGTelegram: Email Sent
  • Trigger
  • Database
  • Code
  • Logic
  • HTTP
  • Messaging

04b — Outreach Touch 2 (Day +4)

14 nodes · 17 connections

Download JSON
Weekdays 09:05CRONWeekdays 09:05Fetch Touch 2 Ready LeadsPGFetch Touch 2 Ready…Split LeadsLOOPSplit LeadsBuild Touch 2 Prompt{ }Build Touch 2 PromptGenerate Touch 2HTTPGenerate Touch 2Parse Output{ }Parse OutputNEEDS_HUMAN?IFNEEDS_HUMAN?Validate{ }ValidateValidation Passed?IFValidation Passed?Can Regen?IFCan Regen?Increment Regen{ }Increment RegenAppend Signature{ }Append SignatureSend via GmailMAILSend via GmailInsert email_sendsPGInsert email_sends
  • Trigger
  • Database
  • Logic
  • Code
  • HTTP
  • Messaging

04c — Outreach Touch 3 (Day +9, secondary contact)

12 nodes · 14 connections

Download JSON
Weekdays 09:10CRONWeekdays 09:10Fetch Touch 3 Ready LeadsPGFetch Touch 3 Ready…Split LeadsLOOPSplit LeadsBuild Touch 3 Prompt{ }Build Touch 3 PromptGenerate Touch 3HTTPGenerate Touch 3Parse Output{ }Parse OutputNEEDS_HUMAN?IFNEEDS_HUMAN?Validate{ }ValidateValidation Passed?IFValidation Passed?Append Signature{ }Append SignatureSend via GmailMAILSend via GmailInsert email_sendsPGInsert email_sends
  • Trigger
  • Database
  • Logic
  • Code
  • HTTP
  • Messaging

04d — Outreach Touch 4 (Day +14, soft close)

7 nodes · 7 connections

Download JSON
Weekdays 09:15CRONWeekdays 09:15Fetch Touch 4 Ready LeadsPGFetch Touch 4 Ready…Split LeadsLOOPSplit LeadsBuild Soft Close (Fixed Template){ }Build Soft Close (F…Send via GmailMAILSend via GmailInsert email_sendsPGInsert email_sendsUpdate Lead: Closed No ResponsePGUpdate Lead: Closed…
  • Trigger
  • Database
  • Logic
  • Code
  • Messaging

05 — Reply Handler

33 nodes · 35 connections

Download JSON
Gmail Push WebhookHOOKGmail Push WebhookDecode Pub/Sub Message{ }Decode Pub/Sub Mess…Fetch Gmail HistoryHTTPFetch Gmail HistoryExtract New Message IDs{ }Extract New Message…Split MessagesLOOPSplit MessagesFetch Full MessageHTTPFetch Full MessageExtract Reply Body{ }Extract Reply BodyMatch to LeadPGMatch to LeadLead Matched?IFLead Matched?Unmatched Reply (ignore)—Unmatched Reply (ig…Build Classification Prompt{ }Build Classificatio…Classify Reply (8B)HTTPClassify Reply (8B)Parse Classification{ }Parse ClassificationIs Unsubscribe?IFIs Unsubscribe?Auto-Reply: UnsubscribeMAILAuto-Reply: Unsubsc…Mark Closed LostPGMark Closed LostRead reply_modePGRead reply_modeBuild Draft Reply Prompt{ }Build Draft Reply P…Use Fixed Template?IFUse Fixed Template?Draft Reply (70B)HTTPDraft Reply (70B)Parse Draft{ }Parse DraftPrepare Telegram Approval{ }Prepare Telegram Ap…Phase B?IFPhase B?Auto-sendable Class?IFAuto-sendable Class?Send to Telegram for ApprovalHTTPSend to Telegram fo…Insert email_repliesPGInsert email_repliesUpdate Lead: RepliedPGUpdate Lead: RepliedTelegram Callback WebhookHOOKTelegram Callback W…Action is Send or Edit?IFAction is Send or E…Fetch Reply RecordPGFetch Reply RecordPrepare Approved Send{ }Prepare Approved Se…Send Approved ReplyMAILSend Approved ReplyMark Reply SentPGMark Reply Sent
  • Trigger
  • Code
  • HTTP
  • Logic
  • Database
  • Messaging

06 — Booking to Brief (Telegram)

14 nodes · 13 connections

Download JSON
Cal.com Booking WebhookHOOKCal.com Booking Web…Parse Cal.com Payload{ }Parse Cal.com Paylo…Fetch Lead by EmailPGFetch Lead by EmailFetch Email ThreadPGFetch Email ThreadBuild Brief Prompt{ }Build Brief PromptGenerate Brief (70B)HTTPGenerate Brief (70B)Extract Brief{ }Extract BriefSend Brief to TelegramTGSend Brief to Teleg…Insert BookingPGInsert BookingUpdate Lead: BookedPGUpdate Lead: BookedCompute Reminder Wait{ }Compute Reminder Wa…Wait Until 1h Before MeetingWAITWait Until 1h Befor…Send ReminderTGSend ReminderMark Reminder SentPGMark Reminder Sent
  • Trigger
  • Code
  • Database
  • HTTP
  • Messaging
  • Logic

Project overview

A complete outbound system built from n8n workflows and PostgreSQL. Leads are sourced daily, enriched from their websites, filtered by an LLM qualification gate, and researched by a 70B model that finds the most painful manual workflow at each company. Outreach runs over 14 days, replies are drafted for human approval in Telegram, and a booked call produces a briefing.

What I built

  1. 01

    Sourcing, enrichment, qualification and research run as separate scheduled workflows sharing one Postgres state machine.

  2. 02

    Contact discovery finds the primary decision-maker and verifies the address before anything is sent.

  3. 03

    Four outreach touches on days 0, 4, 9 and 14; the booking link appears only in the last one or after a reply shows interest.

  4. 04

    A reply handler classifies responses and drafts answers that a human approves from Telegram before they go out.

Implementation notes

Each stage is its own workflow, so a failing scraper or model call stalls one stage without losing leads further down.

Runs on Groq (LLaMA 3.3 70B), Gmail OAuth, Telegram, Playwright and Reacher on a single self-hosted VPS.

Technology stack

  • n8n
  • PostgreSQL
  • Groq
  • LLaMA 3.3 70B
  • Gmail
  • Telegram
  • Playwright

Need a similar product?

Let’s discuss the workflow, website, or application you want to ship.

Start a project