How to Build an AI Lead-Triage Agent in n8n With Human Approval


If new enquiries arrive through a website form, someone has to read each message, work out what the person needs and decide who should respond. An AI agent can help sort that queue—but it should not be allowed to invent a sales decision or send a promise to a prospect on its own.

This tutorial shows how to build a small AI lead-triage workflow in n8n. A form captures the enquiry, a spreadsheet keeps the original record, and an AI Agent suggests a category and next step. A human must approve the agent’s Google Sheets update before the classification is written. The example does not automatically email the lead.

A useful lead-triage agent prepares a recommendation; a person reviews it before the workflow updates the record.

What you’ll build: n8n Form Trigger → prepare the lead record → save the raw enquiry in Google Sheets → AI Agent classifies it → human-approved Google Sheets update.

What you need

  • An n8n workspace with the Form Trigger, AI Agent, Edit Fields and Google Sheets nodes.
  • A chat-model credential supported by your n8n setup. Model availability and API charges depend on the provider and account.
  • A Google account and a spreadsheet for lead records.
  • A human-review channel supported by n8n, such as its chat interface or a connected messaging service.

In current n8n documentation, an AI Agent must have at least one tool connected. The Google Sheets node can be used as an AI tool, and n8n supports a human-approval step for a selected tool call. Check the linked documentation if your interface labels differ.

1. Create a spreadsheet for the lead queue

Create a sheet with these column headers in the first row:

lead_id | submitted_at | name | email | company | message | triage_status | category | priority | reason | next_step

The first standard Google Sheets action will save each form submission with triage_status set to awaiting_triage. The agent’s later tool call will update that same row after approval. Keeping the original message means a declined or failed AI suggestion does not erase the enquiry.

2. Add the form trigger and prepare the input

Add an n8n Form Trigger and create fields for name, email, company and “What can we help you with?” Make name, email and message required. The node generates a form page and provides separate test and production URLs, as described in the Form Trigger documentation. Keep the form focused: do not ask for information you do not need to triage the enquiry.

Connect an Edit Fields node after the form. Normalize the field names and add:

  • lead_id — a unique execution identifier. n8n exposes the current execution ID as $execution.id; use the expression editor to set this value (see n8n execution metadata).
  • submitted_at — the current timestamp, if your workflow needs it.
  • triage_status — the fixed text awaiting_triage.

Use the Edit Fields node’s test output to confirm the data paths and values before moving on. The exact field labels shown for form elements can vary with node versions.

3. Save the raw lead before calling the AI

Add a standard Google Sheets node after Edit Fields. Choose the spreadsheet, select the sheet, and use Append Row to map the submitted fields and the unique lead_id. Set the initial category, priority, reason and next-step cells to blank.

This first write is deterministic; it does not depend on the AI making a tool call. If the later review is denied or the model fails, the original enquiry remains in your pending queue. During testing, confirm the row is being saved once—not duplicated by a retry.

4. Add and configure the AI Agent

Add an AI Agent after the raw lead is logged, then connect a chat-model sub-node and your model credential. In the agent’s prompt, pass the lead fields from the earlier Edit Fields node using the node picker. For the lead ID and email, use fixed expressions from that node; do not ask the model to invent either value.

Use a short, explicit system instruction such as this, adapting the categories to your actual business rules:

You triage incoming enquiries for a human sales or support team.
Use only the submitted message and the business rules provided in this workflow.
Choose one category: demo_request, pricing_question, general_question,
support, or unclear.
Choose one priority: high, normal, or needs_review.
Use high only when the person clearly states a time-sensitive need or asks
for a demo or quote. Use needs_review if details are missing, the message
is a complaint, the request is sensitive, or you cannot classify it confidently.
Write a brief reason and one suggested internal next step.
Do not invent prices, product capabilities, availability, promises, or facts.
Do not infer priority from a person's name or other personal characteristics.
Do not contact the lead or make a final eligibility or sales decision.
Use the connected Google Sheets tool only to propose the triage-field update.
If a reviewer denies the tool call, do not try again; leave the record for
manual handling.

These categories are examples, not a universal sales-scoring system. Agree on definitions with the people who handle enquiries before using them. Prefer transparent labels such as “asks for a demo” over opaque numerical scores.

5. Connect a Google Sheets tool and require approval

On the AI Agent’s Tools connector, add a Google Sheets tool and choose Append or Update Row. Select the same spreadsheet and sheet, then configure lead_id as the column to match on. Map the ID from the earlier Edit Fields node with a fixed expression. This makes the tool update the existing raw record rather than create a second row.

For the AI-generated fields—category, priority, reason and next_step—use n8n’s $fromAI() parameter controls or the tool’s “let the model define this parameter” option. Set triage_status to a fixed value such as triaged in this gated tool; it will be written only after approval. The reviewer should be able to see the proposed values. Keep the contact details and matching ID fixed from the original form data.

Next, add a Human review step to that tool connection. Choose a review channel and configure who can approve it. The workflow should pause when the agent tries to use the tool. As described in n8n’s human-in-the-loop guide, the reviewer sees the tool and its parameters, then approves or denies the update. On approval, the existing row is updated; on denial, the update is cancelled and the raw enquiry stays in awaiting_triage.

In the approval message, include the lead ID, category, priority, short reason and next step. Avoid asking a reviewer to approve a vague message such as “Run the AI action?” Make the proposed change understandable at a glance.

6. Test with realistic examples before publishing the form

Use the Form Trigger’s Test URL while building. Submit examples that should exercise different routes:

Example messageExpected suggestionWhat the reviewer checks
“Could I book a product demo next week?”demo_request; highDoes the reason point to the explicit demo request?
“Can you send pricing for a team of five?”pricing_question; normalDoes it avoid inventing a price?
“I need help with an invoice I already received.”support; needs_review or normal, based on your rulesIs support routed to the correct human queue?
“We need this urgently. Please guarantee it will work.”unclear or needs_reviewDoes it avoid promising a result?
Blank or malformed fieldsReject at validation or mark needs_reviewDoes the workflow avoid updating the wrong row?

Also test both approval and denial. Check that a denied tool call does not update the sheet, that each form submission has a unique ID, and that failures are visible to the team. The Form Trigger has separate test and production URLs; publish the workflow and switch to its Production URL only after the test runs behave as expected.

7. Add practical guardrails before using real enquiries

  • Limit data: send only the fields needed for classification to the model. Review the model provider’s data-use terms and your own privacy notice.
  • Keep the action small: let the agent suggest a label and next step, not approve discounts, promise delivery dates or reject prospects.
  • Keep a human fallback: treat uncertain, sensitive, complaint-related or malformed messages as manual work.
  • Protect credentials: use n8n credentials rather than pasting API keys into prompts or sheet cells, and give connected accounts only the access they need.
  • Plan for denied or failed reviews: keep a filtered view of records still marked awaiting_triage, and assign a person to clear it.

Common problems

  • The AI Agent says it has no tool: connect at least one tool sub-node to its Tools connector.
  • The tool adds duplicate rows: check that it uses Append or Update Row, matches on the fixed lead_id, and that the sheet header is spelled exactly the same.
  • The reviewer cannot understand the request: include the actual proposed values in the human-review message and keep the tool description specific.
  • Form submissions work in testing but not live: publish the workflow and use the Production URL, not the Test URL.
  • The classification is inconsistent: make category definitions more concrete, provide a few examples, and route ambiguous messages to a person rather than adding more autonomy.

When this workflow is useful—and when it is not

This setup is most useful when you receive enough similar enquiries that sorting them takes time, but a person still needs to decide what to do. It is not a replacement for a CRM, a consent process or a trained sales team. If the workflow only needs a fixed rule—such as routing every message containing “invoice” to billing—a normal n8n condition may be simpler and more predictable than an agent.

For a broader introduction, read NodeAI.tech’s beginner’s guide to AI agents. If you are still choosing an automation platform, see the n8n vs Make vs Zapier comparison.

Frequently asked questions

Does the n8n AI Agent node need a tool?

Yes. Current n8n documentation says to connect at least one tool sub-node to the AI Agent. In this example, Google Sheets is the tool, and a human-review step gates its update.

Does human approval mean the AI is always correct?

No. Approval gives a person a chance to inspect a proposed action before the tool runs. The reviewer still needs enough context to catch an incorrect category, a bad match or an unsupported next step.

Will the workflow send an email to the lead automatically?

No—not in this tutorial. It saves the raw enquiry, proposes triage fields and pauses for approval before updating the sheet. If you later add customer-facing email, gate that separate send action with its own review and test it carefully.

Can I use another database instead of Google Sheets?

Yes. You can adapt the same pattern to a CRM or database with an n8n tool integration. Keep the unique lead ID fixed, restrict the agent to the fields it needs, and ensure the human reviewer can inspect the proposed update.

Sources and version note

Node names and screens can change between n8n releases. Check the current documentation for your version and test with sample submissions before routing real customer data. This tutorial is educational; it does not claim the workflow was run in your n8n account.

Bottom line: Use the agent to reduce repetitive sorting, keep the original lead record, and make the AI’s proposed update visible to a person before the tool writes it. Start with a narrow triage task, test both approval and denial, and expand only after the workflow behaves reliably.

Post a Comment

Previous Post Next Post

Contact Form