Automate Lead Responses with Lemlist, HubSpot & n8n Workflow

This n8n workflow automates email reply categorization from Lemlist leads, updating HubSpot CRM and notifying teams via Slack. It solves the time-consuming manual follow-up of leads and categorizes responses for faster sales actions.
lemlistTrigger
openAi
merge
+5
Workflow Identifier: 1454
NODES in Use: lemlistTrigger, openAi, merge, switch, lemlist, httpRequest, hubspot, slack
Automate lead responses with Lemlist and n8n

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

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow catches email replies from Lemlist leads, then uses OpenAI to sort these replies into clear groups. It automatically updates HubSpot CRM and sends messages to Slack with the right info for the sales team. This helps save time, avoid mistakes, and follow up fast on leads who want to buy.

It works by getting replies via a webhook, then classifies them as “Interested”, “Out of Office”, “Unsubscribe”, or “Other” using AI. Each type makes the workflow do different actions like unsubscribing leads, creating deals, or setting reminders.


Who Should Use This Workflow

Sales managers and teams who get many email replies from campaigns can use this. It helps people who want to stop spending hours reading emails and manually updating CRMs. Also good for users wanting clear, fast info about lead interest and better team messages.


Tools and Services Used

  • n8n: to build and run the workflow automation.
  • Lemlist API: to get emails and manage leads.
  • OpenAI API: to classify the type of reply.
  • HubSpot API: to create deals and tasks in CRM.
  • Slack API: to notify sales teams.

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

Step 1: Download the Workflow

  1. Click the Download button on this page to get the workflow file.
  2. Make sure you already have an n8n account and you are in the n8n editor.

Step 2: Import Workflow

  1. In n8n, pick “Import from File” option.
  2. Choose the downloaded workflow file.

Step 3: Configure Credentials

  1. Enter API Keys and OAuth2 credentials for Lemlist, HubSpot, Slack, and OpenAI.
  2. Update fields like campaign IDs, emails, Slack channel IDs if needed.
  3. Copy-paste the provided OpenAI prompt into the OpenAI node.

Step 4: Test the Workflow

  1. Run a test with sample lead reply data to see if classification and updates work.

Step 5: Activate for Production

  1. Enable the active toggle at top right of n8n editor to start live processing.
  2. Monitor the Executions tab for errors or issues.

For special cases, visit self-host n8n to run this on your own server.


Inputs, Processing, and Outputs

Inputs

  • Email reply events from Lemlist webhook.
  • Lead email and campaign details.
  • The plaintext of the email reply.

Processing Steps

  • Catch reply via Lemlist Trigger.
  • Send reply text to OpenAI with prompt to classify category.
  • Merge original and AI results in Merge node.
  • Use Switch node to select action path by category.
  • Batch handle each category: unsubscribe leads, mark interested, create deals, set follow-up tasks, or notify via Slack.

Outputs

  • Leads unsubscribed in Lemlist when requested.
  • New deals created in HubSpot for interested leads.
  • Follow-up tasks scheduled in HubSpot for out-of-office replies.
  • Sales team notified in Slack with clear info.

Important Code / Prompt for OpenAI Node

This prompt guides AI to classify emails into categories with simple rules and examples. Copy-paste as is for best accuracy.

=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"].replaceAll(/^\s+|\s+$/g, '').replace(/(\r\n|\n|\r)/gm, "")}}
Category:

Common Problems and Fixes

  • Workflow doesn’t start: Usually webhook URL missing in Lemlist campaign settings.
  • Wrong AI category: The prompt might be unclear, simplify or add more examples.
  • HubSpot nodes fail: Check OAuth2 credentials, refresh or add missing permissions.
  • Unsubscribe fails: Verify campaign ID in Lemlist node is correct.

Customization Ideas

  • Change campaign or teams by updating IDs in Lemlist or HTTP Request nodes.
  • Add or change AI categories in OpenAI prompt for better sorting.
  • Send Slack messages to more channels by duplicating Slack nodes.
  • Modify HubSpot deals or task details to fit your sales process.
  • Add nodes to update HubSpot contacts based on reply info.

Deploying the Workflow

Activate the workflow inside n8n by toggling the active switch.

Watch the Executions page for any errors.

Set error alerts in n8n to notify if anything stops.

This can handle many leads daily if n8n has enough resources.

Summary

✓ Saves hours every day by automating lead reply handling.

✓ Stops errors from manual work and keeps data accurate.

✓ Prioritizes hot leads and sends clear notifications.

✓ Makes sure no leads get missed from out-of-office or unsubscribe replies.


Automate lead responses with Lemlist and n8n

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes. The user must replace HubSpot nodes with other CRM API nodes and update authentication accordingly.
Each email classification is short and uses few tokens, so cost is low but users should monitor API usage.
Yes. The workflow uses OAuth2 and standard security measures to protect data.
Yes, with proper n8n resource setup and webhook capacity it can scale to many thousands of leads daily.
Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.