Day 22Growth & DemandGPT-4oSalesn8n

Lead Nurturing Workflow — AI Agent for personalized form follow-ups

Instant personalised follow-ups after form submissions.

Impact

Instant personalised follow-ups after form submissions.

Mechanism

Trigger-based Sales Logic

DAY 22
Full README · Case Study

🚀 Day 22: Automated AI Lead Nurturing System

Because Speed & Relevance Win Deals — Not Just "More Tools".


🌊 The Problem: Why Leads Go Cold

Most leads don't vanish because your product is bad. They vanish because:

  1. Response Time is Too Slow: "The vendor who responds first wins 35-50% of sales."
  2. Follow-up is Generic: "Hi [Name], just checking in..." doesn't cut it anymore.
  3. Manual Data Entry Kills Momentum: Sales reps spend 30% of their time entering data, not selling.

🤖 The Solution: Decision-Grade Automation

This isn't just "sending emails." This is a fully automated, intelligent sales development representative (SDR) that works 24/7.

It doesn't just forward data; it thinks.

  • It Reads the lead's unique context (Budget, Timeline, Interests).
  • It Decides the lead's value (High, Medium, Low, Hot).
  • It Writes a 100% unique, personalized email.
  • It Notifies your team instantly on Slack.
  • It Updates your CRM (Google Sheets) automatically.

🧠 Workflow Logic: How It Works

Here is the step-by-step intelligence built into this 5-node system:

Triggers every 1 min

Analyze Context

Write Copy

📝 Lead Submits Google Form

⚡ n8n Workflow

🧠 GPT-4o Analysis

🏷️ Assign Tag: High/Med/Low/Hot

✉️ Draft Personalized Email

🚀 Gmail: Send Email

💬 Slack: Notify Team

📊 Google Sheets: Update Status & Tag

1. The Trigger (Google Sheets)

  • Watcher: The agent monitors your Google Sheet connected to the Form every 60 seconds.
  • Action: Instantly detects when a new row is added (new lead).

2. The Brain (OpenAI GPT-4o)

  • Persona: "Pam", your friendly, professional Customer Service Rep.

  • Logic: It reads every field—budget, timeline, comments.

  • Intelligent Tagging:

    • 🔥 Hot Lead: Immediate timeline, urgent words ("ASAP").
    • 💎 High-Value: Budget > $10k, Premium interest.
    • ⚖️ Medium-Value: $5k-$10k, Standard interest.
    • 📉 Low-Value: Row Added] -->|Polls 1/min| B(wait: 1 sec) B --> C{llm: Create Email & Tag GPT-4o}

    C -->|Parallel Action 1| D[gmail: Send Email To Lead] C -->|Parallel Action 2| E[slack: Notify Team To Channel] C -->|Parallel Action 3| F[sheets: Update Status Write Back]

    style A fill:#0f9d58,stroke:#333,stroke-width:2px,color:white style C fill:#10a37f,stroke:#333,stroke-width:4px,color:white style E fill:#4a154b,stroke:#333,stroke-width:2px,color:white


## 🎛️ Node Configuration Reference table
Using the JSON `fWtXJswvUcA - 1.json` provided, here are the exact parameters used.

| Node Name | Key Parameter | Value | Logic |
| :--- | :--- | :--- | :--- |
| **Google Sheets Trigger** | `pollTimes` | `1 minute` | Ensures near real-time response. |
| **Wait** | `amount` | `1 second` | Prevents race conditions with Sheet write/read. |
| **Create Email & Tag** | `modelId` | `gpt-4o` | High intelligence for nuance. |
| **Create Email & Tag** | `jsonOutput` | `true` | Forces structured JSON (`Subject`, `Body`, `Tag`) instead of plain text strings. |
| **Send Email** | `sendTo` | `{{Email Address}}` | Dynamic mapping from Sheet. |
| **Notify Team** | `text` | `New {{Tag}} Alert!` | Dynamic header based on AI classification. |
| **Update Status** | `Status` | `Contacted...` | Timestamp injection `{{ $now }}` for audit trail. |

---

## 📈 ROI Calculator: What Is This Worth?
Let's do the math on what this agent saves you.

| Metric | Manual Human Process | AI Agent (Day 22) |
| :--- | :--- | :--- |
| **Response Time** | 2 - 24 Hours | ** [!TIP]
> **Revenue Impact**: If you get 50 leads/month and improved speed closes **10% more deals** at $2,000 LTV, this agent generates **$10,000/month** in extra revenue. 

---

## 🛠️ Step-by-Step Setup Guide
Follow this guide to build your own Lead Nurturing Agent in  **Import from File**.
4.  Select the JSON file.
5.  You will see the 5 nodes appear. Don't activate it yet!

### Phase 3: Credential Configuration
You need to connect 4 services. This is the hardest part, but do it once and you're set forever.

#### 1. Google Sheets & Gmail (OAuth2)
*Goal: Allow n8n to read Sheets and send Emails.*
1.  Go to **Google Cloud Console** -> Create Project.
2.  Enable **Google Sheets API** and **Gmail API**.
3.  Go to **Credentials** -> **Create Credentials** -> **OAuth Client ID**.
4.  App Type: Web Application.
5.  **Authorized Redirect URIs**: Copy the URL from your n8n (Credential setup window).
6.  Copy the `Client ID` and `Client Secret` back to n8n.
7.  **Scopes**: Add `https://www.googleapis.com/auth/spreadsheets`, `https://www.googleapis.com/auth/gmail.send`.

#### 2. OpenAI (API Key)
*Goal: Give the AI its brain.*
1.  Go to **platform.openai.com**.
2.  Create a new API Key.
3.  In n8n, open the **Create Email & Tag** node.
4.  Select `OpenAi account 2` (or create new).
5.  Paste your API Key.
6.  **Model**: Ensure `gpt-4o` or `gpt-4-turbo` is selected for best writing quality.

#### 3. Slack (Bot User)
*Goal: Send alerts to your team.*
1.  Go to **api.slack.com/apps**.
2.  **Create New App** -> From scratch.
3.  **OAuth & Permissions**:
    -   Add Bot Token Scope: `chat:write`.
4.  **Install App to Workspace**.
5.  Copy the **Bot User OAuth Token** (starts with `xoxb-`).
6.  In n8n, setup Slack credentials with this token.
7.  **Important**: You must invite the bot to the channel you want alerts in! Type `/invite @YourBotName` in the Slack channel.
8.  Update the **Notify Team** node in n8n with the correct `Channel ID` (Right click channel -> Copy Link -> The letters at the end is the ID).

### Phase 4: Customization
Make "Pam" sound like *your* team.
1.  Open the **Create Email & Tag** node.
2.  Scroll to the **System Message** (Prompt).
3.  Edit the top section:
    > "Your name is [Your Name] and you work as a [Role] for [Your Company]..."
4.  Edit the criteria for "High Value Lead" to match your pricing ($10k might be low for you, or high!).

---

## 🧪 Testing Your Agent
1.  Click **Execute Workflow** (Manual Test) in n8n.
2.  Go to your Google Form (or Sheet) and manually add a row with test data:
    -   *Name*: Test User
    -   *Budget*: $15,000 (To test High Value tag)
    -   *Timeline*: Immediate
3.  **Watch n8n**: You should see green checkmarks flow through the nodes.
4.  **Check Inbox**: Did you get a personalized email?
5.  **Check Slack**: Did the alert pop up?
6.  **Check Sheets**: Did the Status update to "Contacted..."?

> [!SUCCESS]
> If all checkmarks are green, hit **Activate** in the top right. Your silent sales machine is now LIVE. 24/7.

---

## ⚠️ Troubleshooting & FAQ

#### Q: The node fails at "Google Sheets Trigger"?
**A:** Ensure your n8n instance can connect to Google. If using Desktop n8n, you might need a tunnel. For Cloud/Server, check your OAuth Redirect connections.

#### Q: Slack node gives "channel_not_found" error?
**A:** This is 99% of the time because the Bot is not *in* the channel. Go to the channel and type `@YourBotName` to invite it.

#### Q: Emails are going to Spam?
**A:** Since you are sending via Gmail API, it uses your actual account. Ensure you don't send 500+ emails/day (Gmail limit). For higher volume, swap the Gmail node for SendGrid or AWS SES.

#### Q: The AI is hallucinating or promising things we don't do?
**A:** Tighten the System Prompt. Add a "Constraints" section: "Do not promise specific delivery dates. Do not quote exact prices."

---

## 🌟 The "Day 22" Philosophy
We aren't automating work to be lazy.
We are removing **friction**.

Every minute a lead sits in your inbox is a minute they are looking at your competitor. This agent removes that friction entirely.

**Structure is key.**
**Speed is key.**
**Personalization is profit.**

---

### *Built with ❤️ instructions by Aiagentbros*
*Part of the 30 Days 30 AI Agents Challenge.*

Explore more agents

30 open-source systems · full registry

Browse All 30 Agents