Automate Sales Reply Categorization with n8n and OpenAI

Struggling with manually sorting sales email replies? This n8n workflow uses OpenAI to categorize responses and updates Lemlist and HubSpot automatically, saving hours and reducing errors in follow-ups.
main
main
main
Workflow Identifier: 1879
NODES in Use: main

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Automation Does

This workflow reads email replies from Lemlist campaigns.

Then it uses OpenAI to sort the replies into categories like “interested”, “Out of office”, “unsubscribe”, or “other”.

It unsubscribes contacts in Lemlist if they want to stop emails.

It also makes new deals in HubSpot CRM when replies show interest.

Team members get notifications with reply details to act fast.

The workflow keeps HubSpot contacts updated by getting correct contact IDs from replies.

This saves more than 3 hours daily by stopping manual sorting and mistakes.


Who Should Use This Workflow

This workflow is for sales teams receiving many email replies through Lemlist campaigns.

It fits anyone who wants to quickly know which leads are interested or want to unsubscribe without reading every email.

Also good for users wanting automatic updates in HubSpot CRM and better team alerts.


Tools and Services Used

  • n8n: Automates and connects all steps.
  • Lemlist: Runs email campaigns and feedback collection.
  • OpenAI API: Classifies reply texts into set categories.
  • HubSpot CRM: Manages contacts and creates sales deals.
  • Slack or Email (optional): Sends team notifications.

How The Workflow Works (Input → Process → Output)

Input

Emails replied by leads within Lemlist campaigns trigger the workflow.

Process

1. The Lead Replied node in n8n gets email reply data from Lemlist.

2. The reply text sends to OpenAI node for text completion classification.

3. A Switch node routes the flow by category: interested, Out of office, unsubscribe, or other.

4. Unsubscribe replies update Lemlist contact status via a Lemlist node.

5. HubSpot nodes get contact IDs by email and create deals for interested replies.

6. Optional notification node alerts teams with reply info and campaign URLs.

Output

Updated Lemlist contact statuses.

New deals created in HubSpot when appropriate.

Team notifications delivered with relevant reply context.


Beginner Step-by-Step: How to Use This Workflow in Production in n8n

Step 1: Import Workflow

  1. Download the workflow file using the Download button on this page.
  2. In the n8n editor, click on menu and select Import from File.
  3. Choose the downloaded workflow file to add it to your workspace.

Step 2: Add Credentials

  1. Go to Credentials settings and add API Keys or OAuth2 credentials for Lemlist, HubSpot, and OpenAI.
  2. Make sure each credential matches the node that uses it.

Step 3: Update IDs and Details

  1. Edit nodes that require campaign IDs, email addresses, Slack channels, or URLs to use your own data.
  2. Copy the OpenAI prompt below and check if you want to modify categories or text settings:
    The following is a list of emails and the categories they fall into:
    Categories=["interested", "Out of office", "unsubscribe", "other"]
    Interested is when the reply is positive.
    
    {{$json["text"].trim()}}
    Category:

Step 4: Test Workflow

  1. Send test replies to your campaign emails matching each expected category.
  2. Watch n8n executions to confirm nodes work and classify correctly.

Step 5: Activate Workflow

  1. Enable the workflow by turning on Active toggle in n8n.
  2. Monitor logs and fix any errors found.
  3. Optionally add retry or error nodes for stability in production.
  4. If running on your own server, use self-host n8n for better control.

Customization Ideas

  • Change OpenAI prompt to include more categories or different keywords.
  • Add more notification nodes for Slack, Teams, SMS, or email.
  • Customize HubSpot deal creation for different pipelines or stages.
  • Expand Lemlist node actions to tag leads or send follow-up emails.

Troubleshooting Common Issues

Issue: No or wrong category from OpenAI node.

Fix: Make sure the prompt is exactly as shown and input reply text is not empty.

Issue: Lemlist unsubscribe operation fails.

Fix: Check API credentials and campaign ID are correct and valid.

Issue: HubSpot deal not linked to correct contact.

Fix: Confirm OAuth tokens are valid and contact ID is mapped properly from get contact node.


Pre-Production Checklist

  • Verify API credentials for Lemlist, HubSpot, and OpenAI are set and authorized.
  • Test webhook by sending sample replies to confirm trigger works.
  • Check OpenAI node categorizes replies correctly with sample texts.
  • Ensure Switch node routes correctly to each reply category path.
  • Do full run tests with typical reply examples for each category.
  • Set up logging and alerts for error tracking in your n8n instance.

Deployment Guide

After testing, activate the workflow.

Watch executions live in the n8n dashboard.

Add retry policies for API nodes to avoid lost data.

Use error trigger node to catch and handle failures better.

If using a server or VPS setup for n8n, consult self-host n8n for uptime and security practices.


Summary

✓ The workflow reads and sorts sales email replies automatically.

✓ It unsubscribes contacts or creates deals based on reply type.

✓ Contacts stay synced in HubSpot with correct associations.

✓ Teams get notified fast with easy to act information.

→ Saves over 3 hours daily by avoiding manual review and entry errors.

→ Makes sales follow-up quicker and more reliable.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free