Skip to main content

Modular & customizable AI-powered email routing: text classifier for eCommerce

Workflow preview

Workflow preview
100%
Modular & customizable AI-powered email routing: text classifier for eCommerce preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

How It Works 1. Form Submission : The workflow starts with the On form submission node, which triggers when a user submits a contact form. The form collects the user's name, email, and message. 2. ...

Best for

  • Ticket Management automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.formtrigger, @n8n/n8n-nodes-langchain.textclassifier, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.emailsend, n8n-nodes-base.googlesheets, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Davide.

Original n8n.io source

1.1 Workflow description

Title
Modular & customizable AI-powered email routing: text classifier for eCommerce
Workflow name
Modular & customizable AI-powered email routing: text classifier for eCommerce

How It Works

  1. Form Submission:

    • The workflow starts with the On form submission node, which triggers when a user submits a contact form. The form collects the user's name, email, and message.
  2. Text Classification:

    • The Text Classifier node uses an AI model (GPT-4) to classify the submitted message into one of the predefined categories:
      • Request Quote: For quote requests.
      • Product info: For general product inquiries.
      • General problem: For issues or problems related to products.
      • Order: For questions about placed orders.
      • Other: For any messages that don’t fit the above categories.
  3. Email Routing:

    • Based on the classification, the workflow routes the message to the appropriate department via email:
      • Prod. Dep.: For product-related inquiries.
      • Quote Dep.: For quote requests.
      • Gen. Dep.: For general problems.
      • Order Dep.: For order-related questions.
      • Other Dep.: For all other inquiries.
    • Each email includes the user's name, email, message, and the classified category.
  4. Data Logging:

    • The workflow logs the form submission and classification results into a Google Sheets document. Each department has its own sheet where the data is appended, including:
      • User’s name, email, and message.
      • Submission date and time.
      • Assigned category.
      • Email recipient details.
  5. AI Model Integration:

    • The OpenAI node provides the AI model (GPT-4) used by the Text Classifier to classify the messages. The model is instructed to classify the text into one of the predefined categories without additional explanations.

Set Up Steps

  1. Configure the Form Trigger:

    • Set up the On form submission node to collect user inputs (name, email, and message) and trigger the workflow.
  2. Set Up the Text Classifier:

    • Configure the Text Classifier node to use the OpenAI model (GPT-4) for text classification.
    • Define the categories and their descriptions (e.g., "Request Quote", "Product info", etc.).
    • Set the fallback category to "Other" for unclassifiable messages.
  3. Configure Email Sending:

    • Set up the Email Send nodes for each department (Prod. Dep., Quote Dep., Gen. Dep., Order Dep., Other Dep.).
    • Configure the email subject, body, and reply-to address using the form data and classification results.
    • Ensure SMTP credentials are correctly configured for sending emails.
  4. Set Up Google Sheets Integration:

    • Configure the Google Sheets nodes to append data to the appropriate sheets for each department.
    • Map the form data (name, email, message, date, category, and recipient) to the corresponding columns in the Google Sheets document.
  5. Test the Workflow:

    • Submit a test form to ensure the workflow correctly classifies the message, sends the email to the right department, and logs the data in Google Sheets.
    • Verify that the OpenAI model is classifying messages accurately.
  6. Activate the Workflow:

    • Once tested, activate the workflow to automate the process of handling contact form submissions.

Key Features

  • Automated Classification: Uses AI to classify messages into relevant categories, reducing manual effort.
  • Email Routing: Sends emails to the appropriate department based on the classification.
  • Data Logging: Logs all form submissions and classification results in Google Sheets for tracking and analysis.
  • Scalability: Easily adaptable to additional categories or departments by modifying the workflow.

This workflow is ideal for eCommerce businesses or customer support teams looking to automate and streamline the handling of contact form submissions.


Need help customizing?

Contact me for consulting and support or add me on Linkedin.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - On form submission

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.2

Block 2 - Text Classifier

Type / Role
@n8n/n8n-nodes-langchain.textClassifier - textClassifier
Config choices
Version 1

Block 3 - OpenAI

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 4 - Prod. Dep.

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 5 - Quote Dep.

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 6 - Gen. Dep.

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 7 - Order Dep.

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 8 - Other Dep.

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 9 - Quote DB

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 10 - Prod DB

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 11 - General DB

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 12 - Order DB

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 13 - Other DB

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 14 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Modular & customizable AI-powered email routing: text classifier for eCommerce
Complexity intermediate
Nodes 14
Categories Ticket Management, AI Summarization
Author Davide
Published 05 Feb 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2851/2851.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Modular & customizable AI-powered email routing: text classifier for eCommerce do?

How It Works 1. Form Submission : The workflow starts with the On form submission node, which triggers when a user submits a contact form. The form collects the user's name, email, and message. 2. ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Ticket Management, AI Summarization use case.