Automatically Disable Unsold Magento 2 Products After 1 Year with Gmail Approval
This workflow is designed for Magento 2 merchants who want to automatically identify and deactivate products that haven't been sold in the past 12 months, helping to maintain a clean and optimised catalog.
This automation includes order analysis, product comparison, management approval, and automated product deactivation, with full reporting and transparency.
🔧 What It Does 1st of Every Month at 8 AM, it triggers a scheduled cleanup. Calculates the date 12 months ago from the current day. Fetches all Magento 2 orders created in the last 12 months via REST API. Extracts all SKUs of products sold during that period. Fetches the entire product catalog from Magento 2. Compares all products with sold SKUs to determine which products had zero sales in the last year. Prepares an HTML email report (including SKU, Name, Price, Status) of the unsold products. Sends the report to the merchant (e.g., kmyprojects@gmail.com) for approval via interactive email (Approve / Decline). If approved, each product is automatically disabled (status updated to 1) in Magento 2 using the REST API. Aggregates all disabled products and sends a confirmation email with a summary and product table. Ensures safe operations with conditional logic and user review before taking any action.
🧠 Key Features ✅ Fully automated detection of inactive inventory. ✅ Uses n8n's Gmail Approval Node for human decision-making. ✅ Works with Magento 2’s REST API and handles large product sets with batching and aggregation. ✅ Includes fail-safe conditional checks (e.g., don’t run if no orders are found). ✅ Clean HTML email reports with product metadata. ✅ Modular and scalable for different business sizes or intervals.
📦 Use Case Perfect for:
Magento 2 store owners or managers Digital operations teams aiming for lean product catalogs Agencies maintaining Magento-based ecommerce stores Any business needing automated product lifecycle management
🔐 Credentials Required Magento 2 API Bearer Token (for reading orders and updating products) Gmail OAuth2 (for sending approval and summary emails)
🛠️ Customizable Parameters Trigger interval (currently set to monthly at 8 AM) Email recipients for approval and notifications Product status change (can be extended to delete or archive instead of disabling)
🧩 Workflow Stack Trigger: Schedule (Monthly) Nodes Used: HTTP Request Code (JavaScript) IF Condition Gmail (Approval & Notification) Split Out / Split in Batches Aggregate Merge
Related Templates
Instagram Full Profile Scraper with Apify and Google Sheets
📸 Instagram Full Profile Scraper with Apify and Google Sheets This n8n workflow automates the process of scraping ful...
Technology News Workflow Explanation with Key Services
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Auto-Publish Techn...
Auto-classify Gmail emails with AI and apply labels for inbox organization
Who is this for? Professionals and individuals who receive high volumes of emails, those who want to automatically organ...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments