DataLatte☕
n8n AI Agent Workflow for Local Business Lead Follow-Up
AI & Automation

n8n AI Agent Workflow for Local Business Lead Follow-Up

Part of the guide: AI & Marketing Automation

June 13, 2026·Nataliia· 10 min read All posts
An n8n AI agent workflow for a local business can watch your inbox for new inquiries, classify each lead with an LLM, draft a personalized reply, and log everything to a spreadsheet. n8n is an open-source automation tool you can self-host or run in the cloud, which makes it a good fit if you want more control over data and costs than per-operation tools offer.
The workflow below is a starting template: test it carefully before letting it email real customers.
This article covers a specific workflow: an AI agent that monitors your email inbox for new leads, classifies them, generates a reply using an LLM, and logs the result. It uses the same logic as our Make.com workflow, but runs on infrastructure you control. We recommend having the agent create drafts at first, so you can review replies before anything is sent.

n8n vs. Make.com: When to Choose Which

Factorn8nMake.com
CostFree community edition if self-hosted (you pay for the server), or paid cloud plansFree tier (limited), paid plans
Setup complexityHigher (needs server or cloud setup)Low (cloud-native)
Data privacyFull control (self-hosted)Data goes through Make servers
Execution limitsNo per-execution fees when self-hostedOperation limits depend on plan
AI integrationNative AI Agent nodesVia HTTP modules
CommunityLarge library of shared workflow templatesLarge, but proprietary
Choose n8n if: You care about data privacy, need unlimited operations, or want to avoid per-operation costs as you scale.
Choose Make.com if: You want the fastest setup with no server management.

Setting Up n8n

Option 1: n8n Cloud (Easiest Start)

Sign up at n8n.io. There is typically a free trial and then a paid plan; check current pricing. No server needed.

Option 2: Self-Hosted on a VPS (Free)

Run n8n on a small VPS (entry-level plans from providers like DigitalOcean or Hetzner usually cost a few dollars a month; confirm current prices). This is a minimal example, so follow n8n's current docs for production settings:
# Install Docker
curl -fsSL https://get.docker.com | sh

# Run n8n with Docker Compose
cat > docker-compose.yml << 'EOF'
version: '3'
services:
  n8n:
    image: docker.n8nio/n8n
    restart: unless-stopped
    ports:
      - "5678:5678"
    environment:
      - N8N_HOST=your-domain.com
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - WEBHOOK_URL=https://your-domain.com/
      - GENERIC_TIMEZONE=America/Chicago
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:
EOF

docker compose up -d
Access at http://your-server-ip:5678. Set up SSL with Nginx or Caddy for production.

The Workflow: AI Lead Follow-Up Agent

This workflow:
  1. Watches your Gmail inbox for new inquiry emails (use a dedicated inquiries address if you can)
  2. Uses an LLM to classify lead quality (GOOD_FIT / MAYBE / NOT_FIT)
  3. Generates a personalized reply for GOOD_FIT leads
  4. Sends the email reply (or, safer at first, saves it as a draft for you to approve)
  5. Logs everything to a Google Sheet
  6. Sends you a Slack/email alert for high-priority leads only

Workflow JSON (Import Directly into n8n)

Go to n8n → New Workflow → click the three dots → Import from JSON → paste this. Node names, versions and parameters change between n8n releases, so treat this JSON as a template: after importing, reconnect credentials, replace placeholders like YOUR_GOOGLE_SHEET_ID and the Calendly link, and run it with test emails before enabling it.
{
  "name": "AI Lead Follow-Up Agent",
  "nodes": [
    {
      "parameters": {
        "pollTimes": {
          "item": [{"mode": "everyMinute"}]
        },
        "filters": {
          "readStatus": "unread",
          "sender": ""
        }
      },
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "typeVersion": 1,
      "position": [250, 300]
    },
    {
      "parameters": {
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "openAiApi",
        "resource": "chat",
        "model": "gpt-4o-mini",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a lead qualifier. Classify the email as GOOD_FIT, MAYBE, or NOT_FIT. Reply only with valid JSON: {\"classification\": \"GOOD_FIT\", \"reason\": \"one sentence\", \"priority\": \"high|medium|low\", \"first_name\": \"extracted name or Unknown\"}"
            },
            {
              "role": "user",
              "content": "=Classify this lead inquiry:\n\nFrom: {{ $json.from }}\nSubject: {{ $json.subject }}\nBody: {{ $json.text }}\n\nGOOD_FIT: local business, clear service need, budget signals, professional inquiry\nNOT_FIT: requests free work, spam, wrong service entirely, student project\nMAYBE: everything else"
            }
          ]
        },
        "options": {
          "maxTokens": 150,
          "temperature": 0.2
        }
      },
      "name": "Classify Lead",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [500, 300]
    },
    {
      "parameters": {
        "jsCode": "const raw = $input.first().json.choices[0].message.content;\ntry {\n  return [{ json: JSON.parse(raw) }];\n} catch(e) {\n  return [{ json: { classification: 'MAYBE', reason: 'parse error', priority: 'low', first_name: 'there' } }];\n}"
      },
      "name": "Parse Classification",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [750, 300]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.classification }}",
              "value2": "GOOD_FIT"
            }
          ]
        }
      },
      "name": "Is Good Fit?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [1000, 300]
    },
    {
      "parameters": {
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "openAiApi",
        "resource": "chat",
        "model": "gpt-4o-mini",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You write warm, personalized business emails. Under 180 words. Sound like a real person, not a marketing email. Sign as Nataliia from DataLatte."
            },
            {
              "role": "user",
              "content": "=Write a reply to this inquiry.\n\nFrom: {{ $('Gmail Trigger').first().json.from }}\nSubject: {{ $('Gmail Trigger').first().json.subject }}\nInquiry: {{ $('Gmail Trigger').first().json.text }}\n\nInclude:\n- Reference something specific from their message\n- Suggest a free 20-min discovery call\n- Calendly link: https://calendly.com/datalatte/discovery\n- Warm and specific, not generic"
            }
          ]
        },
        "options": {
          "maxTokens": 350,
          "temperature": 0.7
        }
      },
      "name": "Generate Reply",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [1250, 200]
    },
    {
      "parameters": {
        "operation": "reply",
        "messageId": "={{ $('Gmail Trigger').first().json.id }}",
        "message": "={{ $json.choices[0].message.content }}"
      },
      "name": "Send Reply",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [1500, 200]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": "YOUR_GOOGLE_SHEET_ID",
        "sheetName": "Leads",
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "timestamp": "={{ new Date().toISOString() }}",
            "from": "={{ $('Gmail Trigger').first().json.from }}",
            "subject": "={{ $('Gmail Trigger').first().json.subject }}",
            "classification": "={{ $('Parse Classification').first().json.classification }}",
            "priority": "={{ $('Parse Classification').first().json.priority }}",
            "reason": "={{ $('Parse Classification').first().json.reason }}",
            "replied": "=YES"
          }
        }
      },
      "name": "Log to Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [1750, 200]
    }
  ],
  "connections": {
    "Gmail Trigger": {
      "main": [[{"node": "Classify Lead", "type": "main", "index": 0}]]
    },
    "Classify Lead": {
      "main": [[{"node": "Parse Classification", "type": "main", "index": 0}]]
    },
    "Parse Classification": {
      "main": [[{"node": "Is Good Fit?", "type": "main", "index": 0}]]
    },
    "Is Good Fit?": {
      "main": [
        [{"node": "Generate Reply", "type": "main", "index": 0}],
        [{"node": "Log to Sheets", "type": "main", "index": 0}]
      ]
    },
    "Generate Reply": {
      "main": [[{"node": "Send Reply", "type": "main", "index": 0}]]
    },
    "Send Reply": {
      "main": [[{"node": "Log to Sheets", "type": "main", "index": 0}]]
    }
  }
}

Using n8n's Native AI Agent Node

n8n 1.x+ includes a dedicated AI Agent node that's more powerful than chaining LLM calls manually. This node:
  • Maintains conversation context
  • Can call multiple tools in sequence
  • Supports function calling (takes actions based on LLM decisions)
  • Works with many LLM providers, including OpenAI-compatible APIs such as Groq
For a lead follow-up agent using the AI Agent node:
Trigger (Gmail) 
    → AI Agent node
        - System prompt: "You are a business development assistant. When given a new email lead, classify it and draft a reply."
        - Tools: [Gmail Reply, Google Sheets Append, Slack Notify]
        - LLM: Groq (llama-3.3-70b) or OpenAI gpt-4o-mini
    → Done
The AI Agent node handles all the classification, drafting, and action-taking in a single node. It's simpler to build and more flexible when leads have unusual context.

Connecting to Groq (Low-Cost LLM Option)

n8n works with any OpenAI-compatible API. To use Groq instead of OpenAI (this can reduce LLM costs, depending on usage):
  1. In n8n, go to Credentials → New → OpenAI API
  2. Set API key: your Groq API key
  3. Set base URL: https://api.groq.com/openai/v1
  4. In any LLM node, set model to: llama-3.3-70b-versatile
Groq has offered a free tier with daily request limits; limits and available models change, so check their current terms. For many small local-business workflows, a free or low-cost tier is enough, but plan for what happens if limits are reached.

Safety Checklist Before Going Live

  • Start with draft mode or send replies only to yourself for the first week.
  • Never let the agent promise prices, availability or guarantees you have not approved. Put those rules in the system prompt.
  • Route complaints, refunds and sensitive messages to a human.
  • Keep API keys in n8n credentials, not in the workflow text.
  • Tell customers they may be talking to an automated assistant where the law or good practice requires it.
For the broader strategy, see AI agent for lead generation and our AI agents service.

FAQ

Q: Do I need programming knowledge to use n8n? A: Less than you might expect. The visual interface is similar to Make.com — you drag nodes and connect them. The workflow JSON I've provided can be imported and run without editing code. Where you need basic programming is: the Code node (JavaScript) for data transformation, and occasionally debugging webhook payloads. If you're comfortable with Excel formulas, you can handle n8n. If the self-hosted setup is intimidating, start with n8n Cloud, where they handle infrastructure.
Q: How does n8n compare to Zapier for this use case? A: Zapier is simpler to set up but can become more expensive at scale, because pricing is based on tasks. n8n self-hosted has no per-execution fee, though you pay for the server and your time. For a low-volume AI lead follow-up workflow, Zapier's cost may be manageable. See our comparison of Make.com and Zapier. For higher volume or complex multi-branch workflows, n8n's economics improve significantly. Zapier also doesn't have native AI Agent nodes — complex AI workflows require chaining multiple Zap steps vs. n8n's single agent node.
Q: Can I run n8n on a small, cheap server reliably? A: Yes. A small VPS with about 2GB of RAM can usually run n8n for light workflow volumes, such as a local business handling a modest number of executions a day. If you see slowdowns or memory errors, move to a larger instance. Check n8n's current system recommendations.
Q: How do I handle webhook security on self-hosted n8n? A: n8n generates unique webhook URLs with random tokens by default. For additional security: 1) Enable basic auth on the n8n interface, 2) Use environment variables for all credentials (never hardcode), 3) Run behind an Nginx reverse proxy with SSL, 4) Restrict the server's incoming connections to known IP ranges if your webhook sources are fixed. For many small automations the default token-based security is a reasonable baseline, but review n8n's current security guidance before exposing the server publicly.
Q: Can n8n send SMS messages for appointment reminders? A: Yes. n8n has integrations for SMS providers such as Twilio. Remember to collect consent and follow local texting rules. Build a workflow: Google Sheets (read upcoming appointments) → Code node (filter for 48h window) → an LLM node (generate message) → Twilio (send SMS). This is the n8n version of the Python reminder script elsewhere in this blog. The visual builder makes it easier to modify and debug without touching code.

Next Step

If you would rather have this built and tested for you, explore our AI agents service or contact us and we will scope a workflow for your business. You may also like our guide to automating your local business with AI.
Want More Local Customers?
Nataliia at DataLatte runs data-driven local marketing campaigns for local businesses — coffee shops, salons, pet groomers, and fitness studios. Book a free 30-minute strategy call or explore Google Ads management.

Free for local businesses

Want this applied to your business?

I'll review your Google presence, local SEO, and ad accounts — and send you a specific action plan within 48 hours. No pitch, no pressure.

Want hands-on help?

See how DataLatte handles AI Agents & Automation for local businesses.

Learn more
Nataliia — local marketing expert
Nataliia

Local marketing strategist with 10+ years at global agencies — OMD, Dentsu, GroupM, and BBDO. Now helping small businesses get the same data-driven edge. Based in Europe, working with clients in the US, UK, Australia, and beyond.

About Nataliia

Want this applied to your business?

Let's review your current marketing setup together — free, no obligations.

Get Your Free Marketing Audit