Automatically disable unsold Magento 2 products after 1 year with Gmail approval
Workflow preview
$20/month : Unlimited workflows
2500 executions/month
THE #1 IN WEB SCRAPING
Scrape any website without limits
HOSTINGER
Early Deal
DISCOUNT 20% Try free
DISCOUNT 20%
Self-hosted n8n
Unlimited workflows - from $4.99/mo
#1 hub for scraping, AI & automation
6000+ actors - $5 credits/mo
Important notice
This workflow is provided as-is. Please review and test before using in production.
Overview
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., [email protected]) 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