BLOG ARTICLE

AI Agent for Lead Generation with n8n & Claude AI: Guida 2026

Reading time: 9 minutes

An AI agent for lead generation isn’t science fiction — it’s a tool you can build today with n8n, Claude AI, and a €6/month VPS. I built my first AI agent in 2025 for Astra Digital. In 60 days it generated 47 qualified leads with no human intervention.

I’m not talking about a chatbot that replies “Thanks for reaching out”. I’m talking about an autonomous system that identifies prospects, qualifies them, writes personalized messages, and adds them to your CRM — while you sleep. In this guide I show you exactly how to replicate this system in 2026, with open-source tools and costs under €50/month.

What an AI Agent is, and why it’s different from a chatbot

A chatbot answers questions. An AI agent makes decisions. The difference is structural, not cosmetic.

A traditional chatbot works with reactive: it receives an input, looks up an answer in a decision tree, and returns it. If the user steps outside the expected script, the chatbot freezes. The interaction ends there.

Un AI agent for lead generation operates with logic proactive. It has defined goals — find prospects, qualify them, start a conversation — and autonomously chooses which actions to take to reach them. If a step fails, it changes strategy. If data is missing, it goes and finds it. If a lead doesn’t reply to the first email, it schedules a follow-up with a different angle.

In technical terms, an AI agent combines three capabilities a chatbot doesn’t have:

  • Reasoning — it analyzes the context and decides the next step without explicit instructions
  • Tool use — it interacts with external APIs (CRM, email, database, scraping)
  • Memory — it remembers previous interactions and adapts its behavior over time

According to a 2025 McKinsey report, companies that adopt AI agents for sales development see a 40-60% reduction in cost per qualified lead compared to manual processes. This isn't a marginal advantage — it's a paradigm shift for Italian SMEs competing on limited budgets.

The architecture of an AI Agent for lead generation

Before touching a single line of code, you need to understand the architecture. An AI agent for customer acquisition effective has four components:

1. The brain: Claude AI as the decision-making engine

Anthropic’s Claude AI is the model I use as the reasoning engine. Why not GPT-4? Two practical reasons: the 200K-token context window lets you pass the agent entire prospect databases without chunking, and the cost per token is competitive for medium-to-high volumes. In my setup, each lead qualification cycle costs around €0.003 — less than half a cent.

2. The nervous system: n8n as the orchestrator

n8n is the open-source automation platform that orchestrates the entire flow. Unlike Zapier or Make, n8n lets you self-host on a VPS, eliminating execution limits and recurring costs. Each n8n workflow becomes a “reflex” of the agent: time-based triggers, webhooks, listeners on email or forms.

3. The memory: Supabase as the database

The agent must remember who it contacted, what it said, how the prospect responded. I use Supabase (managed PostgreSQL) for three tables: leads, interactions, scores. The free plan is enough for up to 500 active leads.

4. The hands: integrations with the outside world

The agent needs tools to act: email APIs (Brevo or SMTP), Google Sheets for shared reports, webhooks to receive data from your site’s forms, and optionally LinkedIn Sales Navigator for scraping profiles. Each integration is an n8n node.

How to build your AI Agent with n8n and Claude AI: step-by-step

Here’s the exact process I followed. Each step includes the logic, not just the “what to do.”

Step 1 — Setup infrastruttura (30 minuti)

Get a VPS with at least 2 GB of RAM. The Hetzner CX22 at €5.83/month is the one I use. Install n8n with Docker:

docker run -d --restart unless-stopped -p 5678:5678 -v n8n_data:/home/node/.n8n n8nio/n8n

Set up a reverse proxy with Caddy for automatic HTTPS. Get a Claude API key from console.anthropic.com — you’ll need about €5 in credit for the first month of testing.

Step 2 — Workflow di raccolta lead (1 ora)

Create your first n8n workflow with a Webhook node as a trigger. This receives data from your site's forms (name, email, company, message). Connect it to a Supabase node that inserts the lead into the leads with stato new.

Aggiungi a nodo HTTP Request to the Claude API with this system prompt: “You are a sales analyst. Analyze this lead and assign a score from 1 to 100 based on: estimated company size, industry, urgency perceived from the message, implicit budget. Respond in JSON with the fields score, reasoning, next_action.”

The result is saved in the scores. Leads with a score above 60 move on to the next step. The others receive an informational email and stay in nurturing.

Step 3 — Personalized outreach with Claude (2 hours)

This is the heart of theAI agent for customer acquisition. A second n8n workflow runs every morning at 9:00 AM and retrieves from Supabase all leads with a score above 60 and a status of qualified.

For each one, send Claude the lead’s profile along with 3-4 outreach emails that worked in the past (few-shot prompting). Claude generates a personalized email that:

  • Reference a specific element from the lead's original message
  • Offer a concrete benefit tied to the prospect's industry
  • Include a CTA with a Calendly booking link
  • Maintain a professional but direct tone — never corporate-speak

The email is sent via Brevo API (free plan: 300 emails/day). The lead status changes to contacted.

Step 4 — Follow-up intelligente (1 ora)

A third workflow checks every 48 hours whether leads in the status contacted replied. If not, Claude generates a follow-up with a different angle — not an annoying reminder, but valuable content (case study, industry data, free resource).

After three follow-ups with no reply, the lead moves to cold and enters a low-cost monthly nurturing sequence. No lead is ever deleted — just deprioritized.

Step 5 — Dashboard e alerting (30 minuti)

Connect Supabase to Google Sheets with an n8n workflow scheduled every evening. You get an up-to-date dashboard with: total leads, average score, response rate, conversions. A Telegram alert notifies you when a lead with a score above 80 enters the system.

The results: what to expect in the first 90 days

Here is the real data from my agent, launched in October 2025 for Astra Digital:

  • Days 1-30: 12 leads collected, 8 qualified (score >60), 3 replies, 1 call booked. The agent is “learning” — the prompts are refined based on results.
  • Days 31-60: 23 leads collected, 16 qualified, 9 replies, 4 calls. The response rate rises from 25% to 39% after tuning the outreach prompts.
  • Days 61-90: 35 leads collected, 23 qualified, 14 replies, 6 calls, 3 contracts closed for a total value of €4,800.

The average monthly operating cost was €38: VPS €6, Claude API €22, Brevo €0 (free plan), Supabase €0 (free plan), domain and DNS €10/year amortized. The ROI by the third month was 42x.

Heads up: these results reflect a B2B context with an average ticket above €1,000. If you sell products at €20, the model needs to be adapted — an AI agent makes sense when the value of a single lead justifies the qualification costs.

Errori from evitare

In 14 months of working with AI agents, I’ve made every mistake possible. Here are the five that cost the most:

  1. Prompt troppo generici — “Write a sales email” produces spam. The prompt must include context about the lead, examples of emails that worked, and precise constraints (length, tone, CTA). Invest 60% of your setup time in prompt engineering.
  2. Nessun human-in-the-loop — In the first 30 days, manually review every email before sending. Use an n8n “Wait for approval” node that sends the draft to Telegram and waits for your OK. After 30 days of data, you can enable automatic sending for leads with a score below 70 and keep manual review only for high-value ones.
  3. Ignorare the GDPR — Every outreach email must include a legal basis (legitimate interest for B2B, consent for B2C), a working opt-out link, and a reference to the privacy policy. I’ve seen agencies hit with €5,000 fines for automated emails without an opt-out. It’s not worth the risk.
  4. Troppi follow-up — Three follow-ups is the maximum. Beyond that, you damage the reputation of your domain and your brand. Configure a hard stop in the n8n workflow after the third attempt.
  5. Not measuring cost per lead — If your agent generates leads but the cost per acquisition exceeds 30% of the average ticket, you’re losing money. Monitor your CPL weekly and optimize the qualification prompts to filter earlier.

How much an AI Agent for lead generation costs

Here is the realistic breakdown for an Italian SMB in 2026:

  • VPS (Hetzner CX22): €5,83/mese — n8n + Caddy + monitoring
  • Claude API (Anthropic): €15-40/month — depends on lead volume. With 100 leads/month and 3 interactions each, around €25
  • Supabase: €0 up to 500 MB of database — enough for the first 6 months
  • Brevo (email): €0 fino a 300 email/giorno — ampiamente sufficiente
  • Dominio + DNS: €10-15/anno

Totale: €25-50/mese for a fully operational system. Compare it to the cost of a junior SDR (€1,800-2,200/month gross) or a Google Ads campaign (€500-2,000/month for competitive keywords in the Italian B2B market). The AI agent doesn’t replace these activities — it amplifies them, handling the repetitive work of qualification and first contact.

If you’d rather not manage the infrastructure, n8n Cloud starts at €24/month with 2,500 executions included. You lose full control but gain ease of maintenance. For a detailed comparison of the platforms, read my n8n vs Make vs Zapier guide for Italian SMBs.

Approfondimenti consigliati

This article covers the architecture and setup of an AI agent for lead generation. To go deeper into individual components, I’ve written dedicated guides:

Next step: build your agent

An AI agent for lead generation isn’t a “someday I’ll get to it” project. It’s an asset that generates value from the day you turn it on — and gets better every week thanks to the data it collects.

If you want to build your agent with n8n e Claude AI but you’d rather have someone guide you through the setup, the prompt optimization, and GDPR compliance, book a free 30-minute consultation. Together we'll analyze your case, your industry, and the lead volume you can realistically expect.

No slide deck, no aggressive selling. Just numbers and a concrete action plan.

Mattia Calastri is an AI and marketing automation consultant in Verona. He helps Italian SMEs and professionals build customer acquisition systems powered by artificial intelligence, automation, and data. Founder of Astra Digital.

Sei una PMI di Verona o del Veneto?
Oltre alle guide, costruisco il cervello AI della tua azienda e ti porto clienti con Google e Meta Ads. Preferisci delegare tutto? agenzia AI a Verona

EXPLORE MY SERVICES

Digital solutions tailored to you.

I customize every digital solution to perfectly meet your needs. With my Full-Stack Marketing service, I position your brand online making it functional and operational in one week!

DIGITAL MARKETING Blog

SEO and AI Strategies for Business.

Discover the ultime tendenze and strategies of digital marketing, SEO and artificial intelligence. Practical tips to grow your business online.