Description
Overview
This automation workflow processes incoming email replies from Lemlist campaigns using an event-driven analysis approach. Designed for sales and marketing teams, the orchestration pipeline classifies replies into predefined categories to enable targeted follow-up actions and notifications.
The workflow triggers on the “emailsReplied” event from Lemlist and integrates OpenAI’s GPT-4o model for reply classification, providing structured and actionable insights from raw email content.
Key Benefits
- Automates reply classification with AI-driven event-driven analysis, reducing manual sorting.
- Delivers formatted notifications to Slack, improving team visibility and response times.
- Routes replies to appropriate actions such as unsubscribe or mark as interested, enhancing campaign management.
- Combines raw and cleaned reply data for accurate downstream processing in the orchestration pipeline.
Product Overview
This no-code integration workflow begins with a Lemlist trigger node configured to activate on the first email reply received from a campaign lead. The incoming reply text is processed through a Markdown formatter node to clean and standardize the content for readability. The data is then merged to consolidate the original reply and cleaned text.
Using OpenAI’s GPT-4o model via a language model chain, the workflow classifies replies into five categories: Interested, Out of office, Unsubscribe, Not interested, and Other. The classification uses a defined JSON schema and a structured output parser to ensure consistent, machine-readable results.
Based on classification, a switch node routes the reply to specific downstream nodes: sending Slack alerts, unsubscribing leads from campaigns, or marking leads as interested through Lemlist API calls. Notifications to Slack use block formatting with Markdown for clear display of categorized replies and related metadata. The entire workflow operates synchronously in response to the Lemlist event trigger, with no explicit error handling beyond platform defaults.
Features and Outcomes
Core Automation
This image-to-insight orchestration pipeline accepts raw email replies, formats them into Markdown, and categorizes them using OpenAI’s GPT-4o model. The switch node routes replies based on classification results to automate campaign response actions.
- Single-pass classification ensures deterministic categorization of reply statuses.
- Combines data nodes to maintain context and metadata integrity throughout the flow.
- Clear branching logic minimizes processing ambiguity and manual intervention.
Integrations and Intake
The workflow integrates Lemlist for event intake and outbound API calls using predefined API key credentials. Slack is connected for real-time alerting with structured message blocks. The input payload is triggered by Lemlist’s “emailsReplied” event containing reply content and lead metadata.
- Lemlist trigger captures first new reply per lead using webhook events.
- Slack node sends formatted alerts to a designated channel with no link unfurling.
- HTTP request node uses Lemlist API to update lead status with OAuth-based authentication.
Outputs and Consumption
The workflow outputs structured Slack notifications including categorized reply status and campaign details. Responses to Lemlist API calls are handled asynchronously. Key output fields include reply category, cleaned text preview, campaign identifiers, and lead contact information.
- Slack alerts utilize block and Markdown formatting for enhanced readability.
- API calls to Lemlist for unsubscribe or interested status are POST requests with JSON payloads.
- Classification results are parsed as JSON objects conforming to a strict schema.
Workflow — End-to-End Execution
Step 1: Trigger
The workflow initiates on the Lemlist trigger node configured for the “emailsReplied” event, capturing only the first reply per lead. This webhook-based trigger listens continuously for new campaign replies without requiring additional polling.
Step 2: Processing
The raw reply text is passed to a Markdown formatting node, which cleans and converts the content to a standardized readable format. This step ensures consistent text presentation for downstream classification and Slack notifications. Basic presence checks validate input existence; no further schema validation is applied.
Step 3: Analysis
Cleaned reply text is sent to an OpenAI GPT-4o language model chain with a prompt instructing classification into one of five categories. The structured output parser enforces a JSON schema to extract the “replyStatus” field reliably. This deterministic categorization guides the workflow branching.
Step 4: Delivery
Based on classification, replies are routed to different branches: Slack notifications are sent synchronously, unsubscribe requests trigger Lemlist API calls to remove leads from campaigns, and interested leads are marked via Lemlist API POST requests. Slack messages include campaign metadata and a preview of the cleaned reply text.
Use Cases
Scenario 1
Sales teams receive numerous email replies during outreach campaigns, complicating manual sorting. This automation workflow classifies replies into actionable categories and sends alerts to Slack, enabling immediate and organized responses.
Scenario 2
Campaign managers need to comply with unsubscribe requests promptly. The workflow automatically identifies unsubscribe replies and triggers API calls to Lemlist to remove leads from campaigns, ensuring compliance without manual effort.
Scenario 3
Marketing teams want to track leads showing interest for targeted follow-up. This orchestration pipeline marks interested leads in Lemlist automatically, streamlining lead nurturing workflows and enabling prioritization.
How to use
To deploy this automation workflow, import it into your n8n instance and configure Lemlist API credentials with valid API keys. Connect your Slack account and specify the alert channel name for notifications. Once the workflow is active, it will run on each new Lemlist reply event, classify the reply using OpenAI, and route actions accordingly. Expect structured Slack messages per reply and automatic lead updates in Lemlist based on classification results.
Comparison — Manual Process vs. Automation Workflow
| Attribute | Manual/Alternative | This Workflow |
|---|---|---|
| Steps required | Multiple manual steps: reading, categorizing, updating leads, sending alerts | Single automated flow with AI-based classification and routing |
| Consistency | Subject to human error and delay in classification | Deterministic categorization using structured AI output |
| Scalability | Limited by manual effort and team size | Handles all new replies automatically regardless of volume |
| Maintenance | Ongoing manual oversight and process adjustment | Low maintenance with predefined nodes and API integrations |
Technical Specifications
| Environment | n8n workflow automation platform |
|---|---|
| Tools / APIs | Lemlist API, Slack API, OpenAI GPT-4o |
| Execution Model | Event-driven, synchronous processing per new email reply |
| Input Formats | Webhook JSON payload from Lemlist containing reply text and metadata |
| Output Formats | Slack message blocks, JSON API requests to Lemlist |
| Data Handling | Transient processing with Markdown formatting; no persistence within workflow |
| Known Constraints | Relies on external API availability for Lemlist and OpenAI services |
| Credentials | Lemlist API key, Slack OAuth token, OpenAI API key |
Implementation Requirements
- Valid Lemlist API key with permissions to read campaign replies and update leads.
- Slack workspace access with OAuth credentials to send messages to selected channel.
- OpenAI API key authorized for GPT-4o usage to perform reply classification.
Configuration & Validation
- Set up Lemlist credentials and confirm webhook event “emailsReplied” triggers the workflow.
- Test Slack integration by sending a sample alert message to the configured channel.
- Validate OpenAI classification by submitting test replies and confirming structured JSON output.
Data Provenance
- Trigger node: Lemlist Trigger – On new reply (event: emailsReplied, first reply only)
- Classification nodes: OpenAI Chat Model (GPT-4o), Structured Output Parser (JSON schema)
- Output destinations: Slack node for alerts, HTTP Request node for Lemlist API lead updates
FAQ
How is the automation workflow triggered?
The workflow triggers on the Lemlist “emailsReplied” webhook event, specifically the first reply received per lead in an email campaign.
Which tools or models does the orchestration pipeline use?
This orchestration pipeline uses Lemlist for event intake, OpenAI’s GPT-4o model for reply classification, and Slack for notifications.
What does the response look like for client consumption?
Clients receive Slack messages formatted with Markdown blocks containing reply category, campaign details, sender and lead emails, LinkedIn URL, and a reply preview.
Is any data persisted by the workflow?
The workflow processes data transiently without internal persistence; all data storage and lead updates occur via Lemlist API calls.
How are errors handled in this integration flow?
Error handling relies on n8n platform defaults; no explicit retry or backoff strategies are configured within the workflow nodes.
Conclusion
This automation workflow provides a structured method to classify and route Lemlist campaign replies using event-driven analysis combined with AI classification. It delivers consistent, actionable categorization and routing, reducing manual effort in campaign management. The workflow’s dependency on external APIs for classification and lead updates requires stable connectivity and valid credentials. Overall, it offers a deterministic approach to streamline reply handling and notification without persistent data storage or complex error recovery mechanisms.








Reviews
There are no reviews yet.