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

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

Needs changes

by Amjid Ali ✓ · 6,650 views · created 2025-01-20 · Lead Generation, AI Summarization

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 16 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects OpenAI Chat Model, Google Sheets, Microsoft Outlook and Google Docs.

How it runs

Trigger: When an HTTP POST request hits its webhook URL.

  1. Source Website and Status Open (If): checks a condition and branches into true / false
  2. Lead Body (Edit Fields (Set)): sets 1 field: body
  3. Get Lead Data from ERPNext (HTTP Request): calls an HTTP API
  4. Inquiry has Notes (If): checks a condition and branches into true / false
  5. Customer Lead AI Agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; 4 tools (Abbriviations, Company Profile, Company Policies, Company Contact Database)
  6. Inquiry is Valid? (If): checks a condition and branches into true / false
  7. Fields for Outlook (Code): runs custom JavaScript code
  8. Email Body Text Generated by AI (Edit Fields (Set)): sets 1 field: email_body
  9. Email Body for Outlook (Code): runs custom JavaScript code
  10. Microsoft Outlook: uses Microsoft Outlook

Services it uses

OpenAI Chat ModelGoogle SheetsMicrosoft OutlookGoogle Docs

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • AI Agent v1 (old agent modes) in Customer Lead AI Agent (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Removed in 3.0Replace with
AI Agent v1 (old agent modes)
Customer Lead AI Agent (v1.7)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Nodes used (10)

From the author

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…

Excerpt from Amjid Ali's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.