Automatically disable unsold Magento 2 products after 1 year with Gmail approval
Ready for 3.0What this workflow does
This workflow has 17 nodes and runs on a schedule (every month at 08:00). Along the way it connects Gmail.
How it runs
Trigger: On a schedule (every month at 08:00).
- Calculate date an year ago (ISO) (Code): runs custom JavaScript code
- Fetch Orders since 1 year ago (HTTP Request): calls an HTTP API
- If: checks a condition and branches into true / false
- Extract Sold SKUs from orders (Code): runs custom JavaScript code
- Get All Product Skus (HTTP Request): calls an HTTP API
- Filter products NOT sold in last year (Code): runs custom JavaScript code
- Merge: merges the data from its input branches
- Build Decision Email (Code): runs custom JavaScript code
- Split Out: splits a list into separate items
- Gmail: send and wait for a reply
…plus 6 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (9)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - Gmail
n8n-nodes-base.gmail - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Merge
n8n-nodes-base.merge - Split Out
n8n-nodes-base.splitOut - Aggregate
n8n-nodes-base.aggregate
From the author
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…