Mindket

ERPNext website leads routed to the right contact by email

Newversion 1 · updated

Overview

An n8n workflow for ERPNext. A webhook sends each new website lead to an AI agent that reads your company files and a contact sheet, then emails the right person a summary through Outlook.

ERPNext website leads routed to the right contact by email is an n8n workflow in the Business category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

At a glance

Runs in
  • n8n Cloud: import the file, and let ERPNext post to the webhook’s production address
  • Your own n8n server: the same file, with the webhook open to your ERPNext
  • ERPNext: a webhook on the Lead doctype that fires when a lead is added
  • Outlook: the notice leaves your own account for the address the agent picks

Platform

Connects 5 apps

How it works

Trigger

New lead in ERPNext

It starts when ERPNext sends a new lead to the webhook, with:

  • The lead’s ID, as name
  • Its source, which must be Website
  • Its status, which must be Open

Actions

  1. Only open website leads that have notes go on, and the rest stop
  2. The lead’s full record is fetched from ERPNext
  3. An AI agent reads your company profile, policies, abbreviations and contact sheet
  4. It decides whether the inquiry fits what you sell and finds the right contact’s email
  5. A valid inquiry becomes a notice email that summarizes the request
  6. The notice is turned into HTML and sent from Outlook, with a link to the lead

Result

The person who handles the inquiry gets an email with the customer’s details, a summary and a link to the lead in ERPNext

Integrations

What you need before you start.

ERPNext

Leads

Sends each new lead to the webhook, and returns the full lead record when the workflow asks for it.

NeedsAn ERPNext API credential, and a webhook on the Lead doctype

OpenAI

Language model

Runs the agent that reads the inquiry, finds the contact and writes the notice.

NeedsOpenAI API key

Google Sheets

Contacts and abbreviations

Gives the agent a contact sheet for who handles what, and a list of abbreviations to read.

NeedsA Google Sheets OAuth2 credential, and two sheets

Google Docs

Company information

Gives the agent your company profile and policies to judge the inquiry against.

NeedsA Google Docs OAuth2 credential, and two documents

Microsoft Outlook

Email

Sends the notice from your own account to the contacts the agent picked.

NeedsA Microsoft Outlook OAuth2 credential

Workflow check

Checked by Mindket on 13 Nov 2026

Steps
11 steps, starting when its webhook is called
AI
1 step calls an AI model: Customer Lead AI Agent
Sign-ins
Signs in to: ERPNext, Google Sheets, Google Docs, Microsoft Outlook and OpenAI
API keys
No API key is left in the file
Step types
Mindket’s checker reads all 7 of its step types

Read from the workflow’s file, not from a run.

About

What it is

This n8n workflow reads each new website lead in ERPNext and tells the right person about it by email. ERPNext calls a webhook when a lead is added. The workflow keeps only open website leads that carry notes, fetches the full lead and hands it to an AI agent. The agent reads your company profile and policies in Google Docs, an abbreviations list and a contact sheet. It decides whether the inquiry fits what you sell and who handles it. A valid inquiry becomes an email through Microsoft Outlook, with a link back to the lead. An invalid one stops there. The file holds 26 nodes, ten of them sticky notes. The original copy had stray text after its JSON, which Mindket’s copy drops.

Who it suits

Sales and support teams that run ERPNext, take leads from a website form and want each one sent to the person who knows the product. Skip it if you do not use ERPNext, or if you want to read each notice before it goes. As imported, the email leaves your Outlook account the moment the agent writes it.

Who uses it, and how
IndustryWho uses itHow they use itExample
ManufacturingSales managersSend a website inquiry about one product line to the person who sells itA packaging firm gets a quote request for custom boxes, and its box specialist is emailed.
IT servicesPresales leadsPass each demo or integration request to the matching consultantAn integrator gets a request about workflow software, and its automation consultant gets the summary.
Facility suppliesAccount managersRoute a request for a site visit to the owner of that productA cleaning supplier gets a floor-care request, and the floor-care account manager is emailed.
Professional servicesOffice managersKeep stray messages, such as job requests, from reaching the sales teamA consultancy’s form also gets job requests, which the agent marks invalid and nobody is emailed.

You need to know n8n and ERPNext: a webhook in ERPNext, five credentials, four Google files and a few gaps to fill in.

Where to use it

Any n8n that can reach your ERPNext, OpenAI, Google and Microsoft will run it. ERPNext has to reach the webhook’s address over the internet.

  • n8n Cloud: import the file, and let ERPNext post to the webhook’s production address
  • Your own n8n server: the same file, with the webhook open to your ERPNext
  • ERPNext: a webhook on the Lead doctype that fires when a lead is added
  • Outlook: the notice leaves your own account for the address the agent picks

Setup

Download saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Make the four Google files first, since the agent reads them.

What you need first
NeedDetail
n8nOn n8n Cloud or on a server of your own
ERPNextAn API credential, and permission to add a webhook on the Lead doctype
OpenAIAn API key for the agent’s model
GoogleA Docs OAuth2 credential and a Sheets OAuth2 credential, with a company profile, a policies document, a list of abbreviations and a contact sheet
MicrosoftAn Outlook OAuth2 credential
  1. In n8n, create a workflow, open its menu, choose Import from File and pick workflow.json.
  2. Add an ERPNext API credential and select it in Get Lead Data from ERPNext. In that node’s address and in the link inside Microsoft Outlook, replace <YOUR_ERPNEXT_HOST> with your ERPNext address.
  3. Add an OpenAI credential and select it in OpenAI Chat Model.
  4. Add a Google Sheets OAuth2 credential. In Abbriviations and Company Contact Database, select it and choose a document and a sheet.
  5. Add a Google Docs OAuth2 credential. In Company Profile and Company Policies, select it and replace you-must-provide-the-doc-id with the ID of each document.
  6. Add a Microsoft Outlook OAuth2 credential and select it in Microsoft Outlook.
  7. In ERPNext, add a webhook on the Lead doctype that fires on insert. Its request must carry name, source and status. Use the Webhook test address first.
  8. Add a test lead with the source Website, the status Open and a note. Read the email, press Publish, then point ERPNext at the production address.

How to use it

Nothing to open once it is published. Add a lead in ERPNext, or let your website form add one. The workflow runs for each lead whose source is Website and whose status is Open, and ends quietly for the rest.

What to change for a different result
To changeWhere
Which leads countSource Website and Status Open
How the agent decides and writesThe system message of Customer Lead AI Agent, with its email template
Who gets the emailThe rows of the contact sheet
The email’s lookThe HTML in Email Body for Outlook
What counts as invalidInquiry is Valid?

Example

A visitor fills the website form and asks for a floor-care contract for three offices, with a site visit first. ERPNext adds the lead and posts it to the webhook.

The agent finds the person who handles floor care in your sheet. It writes a notice with the customer’s name, company and contact details, a summary of the request and a line asking for a prompt reply. Outlook sends it, with a link to the lead at the end.

For newcomers and experts

If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. This one runs in a line from the webhook to the email. The agent in the middle is one node that can look things up in four Google files before it answers. Test with a contact sheet that holds only your own address.

For experts. The agent’s answer is plain text with fixed labels, and two Code nodes read it back into fields.

Where to look closer
NodeWhat it doesWhat to know
Source Website and Status OpenPasses only leads with body.source equal to Website and body.status equal to OpenAnything else ends the run with nothing sent
Get Lead Data from ERPNextFetches the lead from ERPNext’s Lead resource by body.nameThe agent reads data.lead_name, company_name, source, notes, city, country and mobile_no
Fields for OutlookPulls the addresses, the subject and the message out of the answer by text patternsThe answer must keep the template’s labels
Inquiry is Valid?Passes an answer unless it contains Invalid LeadMindket changed it from an exact match on a bold sentence

Good to know

The webhook has no authentication, and the email goes out unchecked.

  • Models: OpenAI Chat Model names no model, so n8n’s default applies, gpt-5-mini (read on 12 November 2026). OpenAI’s deprecations page lists it for shutdown on 11 December 2026, with gpt-5.6-terra as the replacement
  • Open webhook: Webhook has no authentication set, so anyone who learns its address can post a fake lead. Add Header Auth in the node and in ERPNext
  • Fixed labels: the answer must keep **Email Address(es):**, _Subject: and Dear, or Microsoft Outlook gets no recipient
  • No review: the email goes out as soon as the agent writes it, to the address it picked. Test with a sheet of your own addresses
  • Empty tools: the sheet and document tools read nothing until you choose files
  • Your data: lead details and the rows and documents the agent reads go to OpenAI
  • Billing: OpenAI bills one agent run for each lead, plus every tool call
  • Credentials: the JSON holds none. Mindket left out a sticky note that held its author’s credit, a payment link and an advert

README and files

README

ERPNext website leads routed to the right contact by email

An n8n workflow for teams that run ERPNext. When a lead arrives from your website, an AI agent reads it against your
company documents and a contact sheet, decides whether it fits what you sell, and finds who should handle it. That person
gets a notification email from Outlook, with a link back to the lead.

What is inside

  • workflow.json: the workflow as n8n exports it, 26 nodes. Ten are sticky notes that label its steps. It holds no
    credential. The original copy had stray text after its JSON, which Mindket's copy drops.
  • README.md: these notes.

What we changed from the original copy

  • The address of its author's ERPNext sat in two nodes, Get Lead Data from ERPNext and Microsoft Outlook. It is now
    <YOUR_ERPNEXT_HOST>: put your own ERPNext address there, without https://.
  • The two Google Sheets tool nodes pointed at its author's files. They now point at none until you choose yours. The two
    Docs tool nodes keep their you-must-provide-the-doc-id text for you to replace.
  • The example inside the agent's system message named its author's company, a person and an email address. They now read
    Example Co, Alex Morgan, Northwind Ltd and employee@example.com.
  • Inquiry is Valid? compared the agent's answer with the invalid-lead sentence in bold, two asterisks on each side.
    The prompt shows the sentence without them, so a plain answer would have counted as valid and gone on to an email with no
    recipient. The check now passes an answer unless it contains Invalid Lead.
  • One sticky note, a credit with its author's name, a payment link and an advert for a course, is left out.
  • Every credential link is gone, so select your own in each node that needs one.
  • Nothing else. Its Code nodes and expressions needed no repair.

Before you start

  • An n8n instance, on n8n Cloud or your own server, that your ERPNext can reach over the internet.
  • An ERPNext site with an API credential for n8n, and permission to add a webhook on the Lead doctype.
  • An OpenAI API key.
  • A Google account with a Docs OAuth2 credential and a Sheets OAuth2 credential in n8n.
  • A Microsoft account with an Outlook OAuth2 credential in n8n.
  • Four Google files: a company profile, a policies document, a list of abbreviations and a contact sheet.

Set it up

  1. In n8n, create a workflow, open its menu and choose Import from File. Pick workflow.json.
  2. Add an ERPNext API credential and select it in Get Lead Data from ERPNext. In that node's address and in the link
    inside Microsoft Outlook, replace <YOUR_ERPNEXT_HOST> with your ERPNext address.
  3. Add an OpenAI credential and select it in OpenAI Chat Model.
  4. Add a Google Sheets OAuth2 credential. In Abbriviations and Company Contact Database, select it and choose a
    document and a sheet. See "The Google files" below.
  5. Add a Google Docs OAuth2 credential. In Company Profile and Company Policies, select it and replace
    you-must-provide-the-doc-id with the ID of each document.
  6. Add a Microsoft Outlook OAuth2 credential and select it in Microsoft Outlook.
  7. In ERPNext, open Webhook and add one on the Lead doctype with the trigger set to insert. Its request must carry
    name, source and status. Use Webhook's test address first.
  8. Add a test lead in ERPNext with the source Website, the status Open and a note. Check the email, then press Publish in
    n8n and switch the ERPNext webhook to the production address.

The Google files

| File | What the agent uses it for |
|---|---|
| Company Profile | Your products, services and solutions, so it can tell whether an inquiry fits |
| Company Policies | Rules it should respect when it writes the notice |
| Abbriviations | A list of abbreviations your team uses, so it reads them the way you do |
| Company Contact Database | One row for each person, with an email address and the products, solutions or services they deal with. Add that last column yourself |

How a lead runs

  1. Webhook receives the lead from ERPNext, and Source Website and Status Open lets through only leads whose source
    is Website and whose status is Open.
  2. Lead Body keeps the body, and Get Lead Data from ERPNext fetches the lead by its name.
  3. Inquiry has Notes ends the run for a lead with no notes.
  4. Customer Lead AI Agent gets the lead's name, company, source, notes, city, country and mobile number. It may look in
    the four Google files, and it answers with the contact's email, a subject and a message.
  5. Inquiry is Valid? stops an answer that says the lead is invalid.
  6. Fields for Outlook reads the addresses, the subject and the message out of the answer with text patterns. `Email
    Body Text Generated by AI keeps the message, and Email Body for Outlook` turns it into HTML.
  7. Microsoft Outlook sends it to the addresses the agent found, with a link to the lead added at the end.

Change the result

  • Which leads count: Source Website and Status Open. Remove it to include every lead.
  • How the agent decides and writes: the system message of Customer Lead AI Agent, with its email template.
  • Who gets the email: the rows of the contact sheet.
  • The email's look: the HTML in Email Body for Outlook.
  • Another way to tell people: replace Microsoft Outlook with a WhatsApp or chat node.
  • The model: OpenAI Chat Model.

Good to know

  • OpenAI Chat Model names no model in the file, so the node uses its own default, gpt-5-mini (n8n's repository, read
    on 12 November 2026). OpenAI's deprecations page, read the same day, lists gpt-5-mini for shutdown on 11 December
    2026, with gpt-5.6-terra as its replacement. Pick a model in the node before then.
  • Webhook has no authentication set, so anyone who learns its address can post a fake lead. Add Header Auth to the node
    and to the ERPNext webhook.
  • Fields for Outlook finds the recipients, the subject and the message by their labels, so the agent has to keep the
    template's **Email Address(es):**, _Subject: and Dear. An answer that drops them leaves Microsoft Outlook with no
    recipient.
  • The email is sent as soon as the agent writes it, from your own Outlook account, to the address it picked. Test with a
    contact sheet that holds only your own addresses.
  • The sheet tools and the Docs tools have nothing to read until you choose files. Without them the agent works from the
    lead alone.
  • Lead details, your documents and the sheet rows the agent reads go to OpenAI.
  • OpenAI bills one agent run for each lead, plus every tool call it makes.
Files
NOTICE.md  672 B
README.md  6 KB
workflow.json  23 KB

3 files, 30 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-12

Reviews

No ratings yet

Write a review

No reviews yet.

More from Mindket

See all from Mindket

Huashu Design

alchaincyf · Skill

Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…

New29.4k

Guizang PPT Skill

op7418 · Skill

Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…

New29.8k

Claude Code Skills & Plugins

alirezarezvani · Skill

Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…

New29.8k

Similar in Business

See all in Business

pplx-decider-v1.1-27b

perplexity-ai · Kit

Picks the best option for a decision from text and images, such as which team should handle a request, with a probability for each choice, for developers who b…

New

NuExtract3

numind · Kit

Reads documents as text or images and fills a JSON template with the fields you ask for, or converts the pages to Markdown. A 4B model for teams that process s…

New

Drex DLM

nace-ai · Kit

Scores yes or no, multiple choice and rating questions about a document in one pass, with a probability for every option. An 8B decision model from Nace.AI tha…

New