Automate Lemlist Email Replies with n8n and Slack Alerts

This n8n workflow automates the process of handling email replies from Lemlist campaigns by categorizing responses using OpenAI and sending structured Slack notifications. It saves time by auto-unsubscribing uninterested leads and marking interested ones, streamlining outbound outreach management.
lemlistTrigger
lmChatOpenAi
slack
+8
Learn how to Build this Workflow with AI:
Workflow Identifier: 2061
NODES in Use: lemlistTrigger, markdown, lmChatOpenAi, outputParserStructured, chainLlm, merge, switch, slack, lemlist, httpRequest, stickyNote

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

Visit through Desktop for Best experience

Opening Problem Statement

Meet Alex, a busy sales manager who runs multiple outbound email campaigns using Lemlist. Every day, Alex receives dozens of replies to these emails — some interested, some out of office, some asking to unsubscribe, and others simply not interested. Sifting through these replies manually is overwhelming, time-consuming, and error-prone. Alex wastes hours each week reading through replies, categorizing them, and updating the Lemlist campaign manually. Missing an important interested lead means lost sales opportunities, while delayed unsubscribes lead to unhappy recipients and potential compliance risks.

This exact situation calls for an automated solution that not only collects and classifies email replies from Lemlist campaigns, but also sends quick alerts to the team on Slack, so they can take prompt action. Enter this detailed n8n workflow that will transform how Alex handles Lemlist outbound replies — automatically.

What This Automation Does

When this workflow runs triggered by a new reply on Lemlist, it performs a seamless series of tasks to boost your outbound campaign efficiency. Specifically, this automation:

  • Detects new email replies to Lemlist campaigns using the Lemlist Trigger node.
  • Formats the incoming reply text into clean Markdown for better readability.
  • Leverages OpenAI GPT-4 via the Langchain Chat Model to categorize each reply as Interested, Unsubscribe, Out of office, Not interested, or Other.
  • Routes replies into specific branches based on category to perform targeted actions: unsubscribe uninterested leads automatically, mark interested leads accordingly in Lemlist, or just send notifications for other replies.
  • Sends well-structured Slack notifications with campaign details, sender/lead emails, LinkedIn URL and a brief reply preview for quick team insight.
  • Reduces manual processing time by automating routine reply management steps, freeing up hours weekly.

Prerequisites ⚙️

  • Lemlist account: To run campaigns and generate replies.
  • Slack account: To receive alerts about new replies.
  • OpenAI API key: To classify email replies intelligently.
  • n8n account and workspace: Either cloud or self-hosted. (Self-hosting option info at Hostinger).
  • Credentials setup in n8n for Lemlist, Slack, and OpenAI nodes.

Step-by-Step Guide

Step 1: Start with the Lemlist Trigger Node

Navigate to the n8n editor and add the Lemlist Trigger – On new reply node from the node list. This node listens for new email replies to your Lemlist campaigns, configured to trigger only for the first reply received.

How to configure: In this node’s settings, use the event type emailsReplied and enable the option isFirst to true so it triggers on the first reply per lead.

Visual check: You should see the webhook URL generated by this trigger in the node panel after it is activated.

Common mistake: Forgetting to activate or save the webhook URL in Lemlist integrations will prevent trigger events.

Step 2: Format Reply Text with Markdown Node

Connect the Lemlist Trigger node output to the Format text with Markdown node. This node converts the raw reply text into neat HTML format for better readability in Slack alerts.

Parameters to set: Set the html parameter with the expression = {{ $json.text }} to use the incoming reply text.

Expected result: The node outputs a field named textClean with formatted readable text.

Tip: This makes Slack message previews clearer and easier to scan.

Step 3: Classify Reply Using OpenAI Chat Model and Langchain

The core intelligence happens here. Add the OpenAI Chat Model node and set it to use GPT-4o model.

Next, add the Structured Output Parser node to enforce that OpenAI’s response matches a predefined JSON schema with a “category” property. Connect this parser node as the output parser of the OpenAI node to extract structured data.

Then, insert the Categorize lemlist reply Langchain Chain LLM node. This node sends a prompt instructing GPT-4o to classify the reply text into one of predefined categories: Interested, Out of office, Unsubscribe, Not interested, or Other.

Prompt logic sample:
Classify the [email_content] in one only of the following categories: Interested, Out of office, Unsubscribe, Not interested, Other.
Return only JSON like {"replyStatus": "Interested"}.

Tip: This approach ensures consistent, machine-readable classification output.

Step 4: Merge Formatted Text and Categorization Results

Use the Merge data node to combine the outputs from the Markdown formatter and the reply categorization. Set the mode to “combine” and combination mode to “mergeByPosition” so the results are paired correctly.

Purpose: This merge step creates a single useful dataset that contains both prettified text and classification outcome for downstream logic.

Step 5: Route Replies Based on Category with Switch Node

Add a Route reply to the right branch Switch node connected to the merged data. Set rules to split flow by the category property received from the classification:

  • Replies categorized as Unsubscribe go down the unsubscribe branch.
  • Interested leads flow to the mark interested branch.
  • All others flow to a general Slack notification branch.

Check rules carefully: The JSON field parsed from Langchain is output.category (or similar depending on output field renaming).

Step 6: Handle Unsubscribe Replies Automatically

Connect the Unsubscribe branch to the Lemlist – Unsubscribe node. This node calls the Lemlist API to automatically unsubscribe the lead based on their email and campaign ID.

How it works: This is bound to save headaches from manual unsubscribes and reduce compliance risks by honoring opt-out requests rapidly.

Step 7: Mark Interested Leads in Lemlist

On the Interested branch, connect to the lemlist – Mark as interested HTTP Request node. This POST request uses the Lemlist API to mark the lead as interested in the specified campaign.

Key parameters: URL constructed dynamically with campaign ID and lead email from the workflow data. The request is authenticated via saved Lemlist credentials in n8n.

Step 8: Send Structured Slack Notification

Finally, connect all replies routed to the Slack notification branch to the Send alert to Slack node. This node crafts a detailed message with Slack Blocks containing campaign details, sender/lead emails, LinkedIn profile, and a reply preview.

Tips for Slack setup:
– Add your Slack credential before use.
– Specify the target channel name, for example, “automated_outbound_replies”.
– Customize the Slack message text and blocks to fit your team’s style.

Customizations ✏️

  • Change reply categories: In the Categorize lemlist reply node’s prompt, adjust or expand the list of categories to suit your campaign needs (e.g., add “Follow up needed”).
  • Customize Slack alert formatting: Modify the Slack node’s “blocksUi” JSON to add more fields like lead phone number or add buttons with links.
  • Use a different OpenAI model: Switch the “model” parameter in the OpenAI Chat Model node to a newer or cheaper variant for cost or performance reasons.
  • Add logging: Insert a Set or Code node to capture logs for each reply classification for auditing and debugging.

Troubleshooting 🔧

Problem: “No webhook response from Lemlist Trigger node”

Cause: The webhook URL is not properly set or Lemlist campaign webhook integration is missing.

Solution: Verify webhook URL in the Lemlist Trigger node, copy it, and add it correctly in your Lemlist campaign’s webhook section under Integrations.

Problem: “OpenAI classification returns invalid JSON or no category”

Cause: The prompt is too ambiguous or the output parser node schema doesn’t match the OpenAI response.

Solution: Refine the prompt in the Categorize lemlist reply node for stricter instructions. Ensure the Structured Output Parser node has the correct JSON schema matching your model output.

Problem: “Slack message missing fields or not displaying properly”

Cause: Slack message blocks JSON malformed or dynamic expressions not resolving.

Solution: Use Slack’s Block Kit Builder to validate the JSON. Test expressions in n8n preview to check data presence before sending.

Pre-Production Checklist ✅

  • Confirm valid API keys and credentials for Lemlist, Slack, and OpenAI are saved in n8n.
  • Test the Lemlist webhook trigger with sample replies from test campaigns.
  • Validate OpenAI classification by testing sample reply texts manually and checking output JSON.
  • Check Slack node sends messages to the correct channel with proper formatting.
  • Backup your workflow and create a restore point before deployment.

Deployment Guide

After completing setup and testing each step, activate the workflow by toggling it ON in n8n. Make sure the webhook URL in Lemlist integrations remains unchanged to receive real-time replies. Monitor the Slack channel for notifications during initial days to confirm smooth operation.

This workflow requires no complex infrastructure and can run on n8n cloud or your own server. For higher loads, consider scaling your n8n instance or upgrading OpenAI API plan based on reply volume.

FAQs

Can I use a different messaging platform instead of Slack?

Yes, you can replace the Slack node with other messaging integrations supported by n8n, such as Microsoft Teams or Discord, by adjusting the node configuration accordingly.

Does this automation consume a lot of OpenAI API credits?

It depends on email reply volume. Each reply triggers one classification request to OpenAI, so volume directly affects credit usage. Optimize prompt and model choice to manage costs.

Is data processed securely in this workflow?

Yes, data flows solely between your n8n instance, Lemlist, OpenAI, and Slack using secure APIs with credentials stored safely in n8n. Make sure to use environment variables and credential encryption features.

Conclusion

By implementing this specialized n8n workflow, you have transformed the way Alex (and you) manage Lemlist outbound email replies. You now automatically classify replies using powerful AI, unsubscribe uninterested contacts, mark interested leads, and send meaningful Slack alerts without lifting a finger.

This saves hours of manual work weekly, reduces risk of missed leads, and keeps your sales funnel running smoothly. Next, consider expanding your automation to include follow-up reminders for interested leads or analyze reply sentiment trends over time to refine outreach approaches.

With n8n and Lemlist working hand-in-hand, your outbound campaigns just got a whole lot smarter and easier.

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 in n8n (Beginner Guide)

A complete beginner guide to building an AI-powered 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