AI Contact Form Classifier & Router for eCommerce
Integrates with:
Overview
Unlock Streamlined Customer Inquiry Management with this AI Agent
This n8n AI Agent automates the entire lifecycle of handling contact form submissions for your e-commerce business. When a customer submits the integrated n8n form (or any form connected via webhook), their message is intelligently analyzed by an AI-powered Text Classifier using OpenAI's gpt-4o-mini
model via Langchain.
Based on the message content, the inquiry is categorized into predefined types such as 'Request Quote', 'Product Info', 'General Problem', or 'Order Query'. Once classified, the AI Agent automatically routes the inquiry by sending a detailed email to the designated department (e.g., Sales, Support, Orders). Simultaneously, all submission details, including the sender's information and message, are logged into a centralized Google Sheet for record-keeping, tracking, and further analysis. This ensures prompt responses, efficient team collaboration, and valuable data collection without manual intervention.
Key Features & Benefits
- AI-Powered Inquiry Classification: Leverages OpenAI (
gpt-4o-mini
via Langchain) to accurately understand and categorize customer messages from contact forms. - Automated Routing: Instantly directs inquiries to the relevant internal teams (e.g., Sales for quotes, Support for product info/problems, Operations for orders) via email.
- Centralized Data Logging: Automatically appends submission data (name, email, message, timestamp) to a Google Sheet for comprehensive record-keeping and reporting. Note: The provided template logs a static category to Google Sheets; customize this to log the dynamic AI classification.
- Customizable Categories: Easily adapt the classification categories ('Request Quote', 'Product info', 'General problem', 'Order', 'Other') to fit your specific business needs.
- Flexible Form Integration: Starts with an n8n Form Trigger, but can be adapted to use webhooks for any external form system (e.g., WordPress CF7, Typeform).
- Scalable Follow-up Actions: Extend the workflow with additional n8n nodes to trigger CRM updates, notifications, or other business processes.
Use Cases
- B2C eCommerce: Automatically categorize customer inquiries from your website contact form (e.g., 'Order Status', 'Return Request', 'Product Question') and route them to the appropriate support agent or department, while logging all interactions in a Google Sheet.
- B2B SaaS: Classify demo requests, support tickets, or partnership inquiries submitted through a contact form, ensuring they are quickly directed to sales, customer success, or business development teams. Simultaneously archive lead data in a centralized Google Sheet.
- Solopreneurs: Efficiently manage all incoming messages by having this AI agent sort them into predefined buckets (like 'New Project', 'Existing Client Query'), sending notifications and organizing the information for faster response times.
- Streamlining internal request routing by classifying messages based on department or urgency.
Prerequisites
- An n8n instance (Cloud or self-hosted).
- OpenAI API Key with access to a suitable model (e.g.,
gpt-4o-mini
,gpt-3.5-turbo
). - Credentials for your SMTP server (for sending emails).
- Google Sheets API credentials (OAuth2) to log data.
Setup Instructions
- Download the n8n workflow JSON file.
- Import the workflow into your n8n instance.
- Configure the 'On form submission' (Form Trigger) node: review the form fields (Name, Email, Message) and title. Alternatively, replace this node with a Webhook node if connecting to an external form system.
- In the 'OpenAI' Chat Model node (connected to 'Text Classifier'), configure your OpenAI API credentials. The workflow is pre-set to use
gpt-4o-mini
but can be changed. - In the 'Text Classifier' node, review and customize the classification
categories
. The current categories are 'Request Quote', 'Product info', 'General problem', and 'Order', with a fallback for 'Other'. Adjust thesystemPromptTemplate
if needed for more nuanced classification. - Configure each of the 'Email Send' nodes (e.g., 'Prod. Dep.', 'Quote Dep.', 'Gen. Dep.', 'Order Dep.', 'Other Dep.') with your SMTP credentials and the correct recipient email addresses for each department. The email templates use a placeholder
{{ $json["tipo prodotto"] }}
. You may need to customize your form to include a 'Product Type' field and update the email nodes to use this data, or remove the placeholder if not applicable. - Configure each of the 'Google Sheets' nodes (e.g., 'Quote DB', 'Prod DB') with your Google Sheets API credentials, the correct
documentId
(Spreadsheet ID), andsheetName
(Tab name). - Important Customization for Google Sheets: By default, the 'CATEGORIA' column in the Google Sheets nodes is hardcoded to
"info prodotti"
. You will likely want to modify this to use the dynamic output from the 'Text Classifier' node. For example, change the value for theCATEGORIA
field to{{ $('Text Classifier').item.json.category }}
(or the specific field name your classifier node outputs for the category after processing the form data) to log the actual AI-determined category. - Test the workflow thoroughly by submitting the form with various messages to ensure correct classification and routing.
- Activate the workflow.
Want your own unique AI agent?
Talk to us - we know how to build custom AI agents for your specific needs.
Schedule a Consultation