AI-driven lead management and inquiry automation with ERPNext & n8n
Needs changesWhat 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.
- Source Website and Status Open (If): checks a condition and branches into true / false
- Lead Body (Edit Fields (Set)): sets 1 field: body
- Get Lead Data from ERPNext (HTTP Request): calls an HTTP API
- Inquiry has Notes (If): checks a condition and branches into true / false
- 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)
- Inquiry is Valid? (If): checks a condition and branches into true / false
- Fields for Outlook (Code): runs custom JavaScript code
- Email Body Text Generated by AI (Edit Fields (Set)): sets 1 field: email_body
- Email Body for Outlook (Code): runs custom JavaScript code
- Microsoft Outlook: uses Microsoft Outlook
Services it uses
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.0 | Replace 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)
- AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Google Sheets Tool
n8n-nodes-base.googleSheetsTool - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Microsoft Outlook
n8n-nodes-base.microsoftOutlook - Code
n8n-nodes-base.code - Google Docs Tool
n8n-nodes-base.googleDocsTool - HTTP Request
n8n-nodes-base.httpRequest - Webhook
n8n-nodes-base.webhook
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…