Use this powerful n8n workflow to automatically analyze customer order data (e.g., Magento 2), identify high-value shoppers, generate unique discount codes, and send vouchers via the Gmail n8n node. Explore official n8n templates for CRM automation.
Download this n8n workflow template and start using it instantly.
Markdown-formatted text:
E-commerce Managers running platforms like Magento 2 who need automated CRM retention strategies.
Marketing teams looking for robust n8n templates to automate personalized customer outreach.
System administrators seeking a reliable n8n workflow to schedule complex API interactions and email delivery.
Users familiar with connecting HTTP Request n8n nodes to external e-commerce APIs.
Manually identifying high-value customers, creating segmented sales rules, generating unique coupon codes, and sending personalized emails is a time-consuming and error-prone process. This automated n8n workflow solves this by running a complete retention campaign on a schedule.
This robust n8n workflow starts with a Cron n8n trigger, calculating relevant date ranges and fetching necessary media paths (like a company logo). It then queries your e-commerce platform (via HTTP Request n8n node) to retrieve orders and calculates the total spent by customers over the last three months. By using core logic flow control, the n8n workflow filters for customers exceeding a specific spend threshold. For those high-value customers, the automation dynamically creates a sales rule and generates a unique coupon code before sending a personalized email using the Gmail n8n node. This approach ensures maximum efficiency and accuracy in rewarding loyalty.
Markdown-formatted text:
Get Media Path) and prepares them (SetOrGet Logo). A specialized Code n8n node (Get 3 Month Dates) calculates the exact date range required for filtering recent orders.Get Completed Orders HTTP Request n8n node uses the calculated dates to query the e-commerce API (like Magento 2) for recent transactions.Get Customer Order Value Code n8n node processes the retrieved orders, aggregating the total sales value for each unique customer ID.If n8n node checks if a customer's total order value meets the defined threshold for being considered "high-value."Create New Sales Rule and Generate Coupon for Each Customer. These steps interact with the e-commerce API to set up the discount parameters and create the unique voucher code.Send Voucher Gmail n8n node sends a customized, personalized email containing the unique coupon code directly to the customer.Send Report Gmail n8n node can be used to notify the administrative team about the execution status or customers who did not qualify.Markdown-formatted text:
Send Voucher and Send Report Gmail n8n node instances.Get Customer Order Value Code n8n node and the If n8n node to ensure the high-value spending threshold aligns with your business rules.Markdown-formatted text:
Cron (n8n trigger):
Function: Serves as the primary n8n trigger, initiating the entire n8n workflow on a predefined schedule (e.g., daily).
Key Configuration: Schedule frequency.
Get 3 Month Dates (Code n8n node):
Function: Custom scripting to dynamically calculate the date range (e.g., last 90 days) needed for filtering recent customer orders.
Get Completed Orders (HTTP Request n8n node):
Function: Queries the e-commerce API to retrieve a list of completed orders within the calculated date range, filtering for relevant customer data.
Get Customer Order Value (Code n8n node):
Function: Processes the order data from the previous n8n node, calculating the cumulative lifetime or recent order value for each customer.
If (n8n node - Core Logic Flow Control):
Function: Directs the n8n workflow flow based on whether the calculated customer order value meets the high-value threshold.
Create New Sales Rule (HTTP Request n8n node):
Function: Only executed for high-value customers. Calls the e-commerce API to create the base sales rule (e.g., 15% off). Set to continue on error, indicating resilience is built into this specific n8n workflow step.
Generate Coupon for Each Customer (HTTP Request n8n node):
Function: Generates a unique, single-use coupon code associated with the newly created sales rule for the individual customer.
Send Voucher (Gmail n8n node):
* Function: Delivers the personalized email containing the unique discount code and branding assets (referenced from earlier steps) to the high-value customer.
Use this powerful n8n workflow to automate sending instant, personalized SMS appointment reminders via a Twilio n8n node, triggered by a dedicated webhook. Save time on CRM follow-ups.

Automate Gmail analysis. This powerful n8n workflow uses GPT-4o-mini to summarize unread emails and instantly send concise alerts to Slack. Get started with these n8n templates.

Use this advanced n8n workflow to automate highly personalized LinkedIn connection requests. Leverage Google Sheets and Gemini AI to generate authentic, profile-based messages, mimicking human behavior.

Use this comprehensive n8n workflow to automate patient appointment reminders via Email and SMS (Twilio). This n8n template supports parallel data storage in Google Sheets, Airtable, and PostgreSQL.

Use this robust n8n workflow to automatically send batch rejection emails to candidates flagged in Google Sheets, scheduled daily using the n8n trigger.


Experienced Magento 2 Developer with 10+ years of expertise in building and optimizing eCommerce solutions. Over the past year, I’ve expanded my skills into workflow automation using n8n, streamlining business processes and integrating systems for efficiency. Passionate about solving complex problems, enhancing performance, and leveraging automation to drive smarter workflows.







































