Low-stock alert in Slack
Check inventory daily and warn your team before a product sells out.
How it works
Trigger: Schedule — every day at 9:00
- Get all products and variants from Shopify.
- Keep only variants with inventory below your threshold (e.g. 5).
- If any are found, post a list to your #inventory Slack channel.
Diagram
Trigger App Code
Code
JavaScript used in the Code step — already included in the template below.
// Lists every variant below the threshold. Returns nothing when stock is fine,
// so the Slack node only runs when there is something to report.
const THRESHOLD = 5;
const low = [];
for (const { json: product } of $input.all()) {
for (const v of product.variants || []) {
if (v.inventory_quantity < THRESHOLD) {
const variant = v.title !== "Default Title" ? ` – ${v.title}` : "";
low.push(`• ${product.title}${variant}: ${v.inventory_quantity} left`);
}
}
}
if (!low.length) return [];
return [{ json: { text: `⚠️ Low stock:\n${low.join("\n")}` } }];Build it
Pick your tool — same automation, step by step.
Copy and paste straight into an n8n canvas (Ctrl+V), or download and use Import from File. Then connect your own credentials and replace every YOUR_… placeholder.
Show code (130 lines)
{
"name": "Low-stock alert in Slack (Flowngn)",
"nodes": [
{
"parameters": {
"content": "## Low-stock alert in Slack\nCheck inventory daily and warn your team before a product sells out.\n\n**Setup**\n1. Open each node and connect your own credentials.\n2. Replace every YOUR_… placeholder.\n3. Test once, then activate.\n\nFree template from Flowngn",
"height": 260,
"width": 340
},
"id": "310be4a1-4008-4828-ad8d-e71c4a4bb1f3",
"name": "Setup notes",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-420,
-60
]
},
{
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 9
}
]
}
},
"id": "310be4a1-4008-4828-ad8d-e71c4a4bb1f3",
"name": "Every day 9:00",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
0,
0
]
},
{
"parameters": {
"resource": "product",
"operation": "getAll",
"returnAll": true
},
"id": "310be4a1-4008-4828-ad8d-e71c4a4bb1f3",
"name": "Get all products",
"type": "n8n-nodes-base.shopify",
"typeVersion": 1,
"position": [
300,
0
]
},
{
"parameters": {
"jsCode": "// Lists every variant below the threshold. Returns nothing when stock is fine,\n// so the Slack node only runs when there is something to report.\nconst THRESHOLD = 5;\nconst low = [];\n\nfor (const { json: product } of $input.all()) {\n for (const v of product.variants || []) {\n if (v.inventory_quantity < THRESHOLD) {\n const variant = v.title !== \"Default Title\" ? ` – ${v.title}` : \"\";\n low.push(`• ${product.title}${variant}: ${v.inventory_quantity} left`);\n }\n }\n}\n\nif (!low.length) return [];\nreturn [{ json: { text: `⚠️ Low stock:\\n${low.join(\"\\n\")}` } }];"
},
"id": "310be4a1-4008-4828-ad8d-e71c4a4bb1f3",
"name": "Find low stock",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
600,
0
]
},
{
"parameters": {
"select": "channel",
"channelId": {
"__rl": true,
"value": "#inventory",
"mode": "name"
},
"text": "={{ $json.text }}",
"otherOptions": {}
},
"id": "310be4a1-4008-4828-ad8d-e71c4a4bb1f3",
"name": "Alert #inventory",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.2,
"position": [
900,
0
]
}
],
"connections": {
"Every day 9:00": {
"main": [
[
{
"node": "Get all products",
"type": "main",
"index": 0
}
]
]
},
"Get all products": {
"main": [
[
{
"node": "Find low stock",
"type": "main",
"index": 0
}
]
]
},
"Find low stock": {
"main": [
[
{
"node": "Alert #inventory",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"meta": {
"templateCredsSetupCompleted": false
},
"tags": []
}In Make, create a new scenario and add these modules in order:
- Schedule the scenario: Every day 9:00
- Shopify › Search Products
- Tools › Set variable / Iterator + Array aggregator (same logic as the Code step)
- Slack › Create a Message
- Every module run uses Make operations — the free plan includes a monthly quota.
- Make's built-in functions (map, sum, formatDate…) can replace most Code steps; for complex logic use a code module.
- Module and step names can differ slightly as Make and Zapier update their apps.
In Zapier, create a new Zap and add these steps in order:
- Schedule by Zapier — Every day 9:00
- Code by Zapier — fetch products via the Shopify API
- Code by Zapier — Run JavaScript (paste the code from the Code section)
- Slack — Send Channel Message
- Zaps with more than two steps need a paid Zapier plan.
- Webhooks, Filters/Paths and Code by Zapier are premium features on some Zapier plans.
- Code by Zapier runs JavaScript: reuse the code shown above, reading inputs from inputData instead of $json.
- Module and step names can differ slightly as Make and Zapier update their apps.
Tips
- Store thresholds per product in a sheet if some items sell faster.
Related flows
E-commerceEasy
Refund alerts for your store
Get a Slack alert with the amount and reason whenever a refund is issued.
Shopify → Slack1h/mo
E-commerceMedium
Daily Shopify sales summary on WhatsApp
Every morning, get yesterday's order count and revenue sent to your WhatsApp.
Shopify → WhatsApp3h/mo
E-commerceEasy
Log every new order in Google Sheets
Each new Shopify order becomes a row in a spreadsheet you can filter and share.
Shopify → Google Sheets4h/mo