← Back to projects
n8nOllamaGmailGoogle SheetsTelegramSelf-Hosted

AI SDR: Autonomous Cold
Outreach with Local LLM

Three synchronised n8n workflows running on weekday schedules: scoring leads 0–100, generating 3-email sequences, managing follow-up cadence, detecting replies, and firing Telegram alerts. Fully self-hosted. No SaaS subscription. No data leaving your infrastructure.

3
Synced workflows
0–100
AI lead scoring
Private
Self-hosted LLM
Real-time
Telegram alerts

Most outbound tools are SaaS platforms with per-seat pricing, OpenAI API bills, and your lead data sitting on someone else's servers. For founders, agencies, and privacy-conscious companies, this is a real constraint.

This system runs entirely on your own infrastructure. n8n self-hosted, Ollama running locally with Mistral or Llama3. All the intelligence of a paid AI SDR tool, at infrastructure cost only. The system scores leads, writes emails, manages cadence, and detects replies autonomously on weekday schedules.

1
Flow 1 — New Lead Processing (8am weekdays)

Reads rows with status "New" from Google Sheets. For each lead, scrapes their company website to build a research dossier: product description, target market, value prop. Passes the dossier to Ollama (running Mistral locally) which scores the lead 0–100 based on your ICP criteria and generates 3 personalised emails with subject lines. Results written back to Sheets. Email 1 sent immediately via Gmail.

Google SheetsWeb ScraperOllama/MistralGmail
2
Flow 2 — Follow-up Cadence (every 2hrs weekdays)

Checks the Sheets for leads where Email 1 was sent 3+ days ago and Email 2 hasn't gone out: sends Email 2. Checks for 7+ day gaps and sends Email 3. Automatically marks sequence "complete" after Email 3. Skips any lead marked "replied". The sequence stops the moment a reply is detected.

Cadence LogicDate ComparisonGmail
3
Flow 3 — Reply Detection (every 2hrs weekdays)

Searches Gmail for emails from active lead domains. Filters out your own sent emails to avoid false positives. When a genuine reply is detected: marks the lead "replied" in Sheets (stopping the sequence), logs the reply preview, and fires a Telegram alert with the lead's name, company, and first 200 characters of the reply. You respond. The machine moves on to the next lead.

Gmail SearchFalse Positive FilterTelegram Bot
n8n
Orchestration (self-hosted)
Ollama
Local LLM
Mistral / Llama3
AI model
Gmail
Send & receive
Google Sheets
Lead database
Telegram
Reply alerts
1
Google Sheets Structure

Create a sheet with: Lead Name, Email, Company, Website, Role, ICP Score, Email 1/2/3 Subject, Email 1/2/3 Body, Status, Date Sent 1/2/3, Reply Detected, Reply Preview. This is the workflow's single source of truth.

2
Install Ollama Locally

Install Ollama from ollama.ai. Pull your chosen model: ollama pull mistral or llama3. The n8n Ollama node connects to localhost:11434 by default. Swap for OpenAI or Anthropic credentials if you prefer cloud models.

3
Gmail OAuth2 + Telegram Bot

Connect Gmail via OAuth2 in n8n. Ensure it's the inbox you want to send from and monitor for replies. Create a Telegram bot via @BotFather, note the token and your personal chat ID for the alert destination.

4
Customise AI Prompts

Two prompts to configure: the Lead Scorer (ICP definition, scoring criteria, what makes a 90+ vs 40 score) and the Email Writer (product description, value prop, tone, CTA, max word count per email). The quality of your prompts determines the quality of the output.

5
Test & Activate All Three Flows

Add one test lead with status "New" and your own email address. Run Flow 1 manually. Verify scoring, email generation, and Gmail send. Wait for the schedule to test Flows 2 and 3, or trigger them manually. Activate all three schedules once satisfied.

Want a private, self-hosted SDR?

I'll build and deploy this system on your own infrastructure. No SaaS dependency.