🎣 AI-driven lead management and inquiry automation with ERPNext & n8n

⚡ 6,479 views · 🎣 Lead Generation & Enrichment

💡 Pro Tip — YouTube’s API quotas can be a bottleneck when you’re pulling data at scale. ScraperNode is a community node with dedicated scrapers for channels, videos, and comments — no quota limits, just structured data.

View All Scrapers

Description

Overview

This workflow template automates lead management and customer inquiry processing by integrating ERPNext, AI agents, and email notifications. It streamlines the process of capturing leads, analyzing inquiries, and generating actionable responses. The workflow uses ERPNext to capture inquiries, analyzes them with AI, and notifies the appropriate team or individual, all while maintaining a professional approach.


What This Template Does

  1. ERPNext Webhook Integration:

    • Captures leads and inquiries through ERPNext webhooks.
    • Triggers the workflow when a new lead is created.
  2. AI-Powered Inquiry Analysis:

    • Uses AI to extract key details from lead notes (e.g., customer name, organization, inquiry summary).
    • Classifies inquiries as valid or invalid based on relevance to products, services, or solutions.
  3. Contact Assignment:

    • Matches inquiries to the appropriate contact(s) using a Google Sheets database or ERPNext contact information.
    • Handles multiple contacts if required.
  4. Email Notifications:

    • Generates professional email notifications for valid inquiries.
    • Sends emails to the appropriate contact(s) with inquiry details and action steps.
  5. Invalid Lead Handling:

    • Identifies invalid inquiries (e.g., unrelated to products or services) and flags them for follow-up or dismissal.
  6. Custom Email Formatting:

    • Converts plain text into professionally formatted HTML emails.
    • Ensures that communication is clear, concise, and visually appealing.

How It Works

Step 1: Capture Lead Data

Step 2: Validate and Analyze Inquiry

Step 3: Assign Contact(s)

Step 4: Generate and Send Email Notifications

Step 5: Post-Inquiry Actions


Setup Instructions

Prerequisites

  1. ERPNext:
    • A configured ERPNext instance with lead data and a webhook for the “Lead” DocType.
  2. Google Sheets:
    • A sheet mapping products, services, or solutions to responsible contacts.
  3. AI Integration:
    • Credentials for OpenAI or other supported AI platforms.
  4. Email Client:
    • Credentials for Microsoft Outlook or another email client.

Step-by-Step Setup

  1. ERPNext Configuration:

    • Create a webhook for the “Lead” DocType in ERPNext.
    • Test the webhook with sample data to ensure proper integration.
  2. Workflow Import:

    • Import the workflow template into n8n.
    • Configure nodes with your API credentials for ERPNext, Google Sheets, and AI tools.
  3. Google Sheets Integration:

    • Prepare a Google Sheet with columns for product, service, or solution and the responsible contact(s).
    • Link the sheet to the workflow.
  4. AI Agent Configuration:

    • Customize the AI agent’s prompts to align with your business’s products and services.
    • Adjust criteria for valid and invalid inquiries as needed.
  5. Email Setup:

    • Configure the email client node with your email service credentials.
    • Customize the email template for your organization.
  6. Testing:

    • Run the workflow with sample leads to validate the entire process.
    • Check email notifications, contact assignments, and record updates in ERPNext.

Dos and Don’ts

Dos:

Don’ts:


Resources

GET n8n Now

N8N COURSE

n8n Book

đź”— Nodes Used

HTTP Request, Webhook, Microsoft Outlook, AI Agent, OpenAI Chat Model

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup