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
- Download the workflow file using the Download button on this page.
- In the n8n editor, click on menu and select Import from File.
- Choose the downloaded workflow file to add it to your workspace.
Step 2: Add Credentials
- Go to Credentials settings and add API Keys or OAuth2 credentials for Lemlist, HubSpot, and OpenAI.
- Make sure each credential matches the node that uses it.
Step 3: Update IDs and Details
- Edit nodes that require campaign IDs, email addresses, Slack channels, or URLs to use your own data.
- 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
- Send test replies to your campaign emails matching each expected category.
- Watch n8n executions to confirm nodes work and classify correctly.
Step 5: Activate Workflow
- Enable the workflow by turning on Active toggle in n8n.
- Monitor logs and fix any errors found.
- Optionally add retry or error nodes for stability in production.
- 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.
