Before you start: you’ll need a
products or inventory table with a stock quantity column, plus a notification channel like Slack, email, or SMS. See Connect Slack or Send Emails.The Flow at a Glance
Check
Scan inventory for items below threshold
Alert
Notify the purchasing team once per item
Reset
Clear alert when stock is replenished
Step 1: Create the Workflow
Step 2: Query for Low-Stock Items
Add a Database Query action:low_stock_alerted_at IS NULL check prevents spam — once you’ve alerted on an item, you don’t re-alert until stock is replenished and cleared.
Step 3: Send Slack Notifications
For each low-stock product, add a Send Slack Message action:<@USER_ID>. Link back to your inventory admin so they can mark a reorder in progress.
Step 4: Mark as Alerted
After the Slack message sends, update the database:Step 5: Handle Out-of-Stock Separately
Items that hit zero need different treatment — they’re no longer “low,” they’re gone. Add a second query:Step 6: Reset When Restocked
Create a small workflow (or a database trigger) that fires when stock is replenished:
Now when stock drops again, the alert fires fresh.
Advanced: Velocity-Based Alerts
Fixed thresholds are blunt. A better approach: alert based on days of inventory remaining, using recent sales velocity.Connecting to E-Commerce Platforms
If you’re using Shopify, WooCommerce, or BigCommerce for storefront, pull inventory via their webhooks rather than maintaining a separate table:- Shopify: subscribe to
inventory_levels/update - WooCommerce: Stock change webhook
- BigCommerce:
store/product/inventory/updated
Multi-Channel Alerts
Different urgency, different channel:- Non-urgent low stock: Slack message to #ops
- Out of stock: Slack + email to purchasing manager
- Bestseller out of stock: SMS to manager (see Connect Twilio)
Out-of-Stock Page Handling
When a product hits zero, your product page should respond:- Hide or gray-out the “Add to Cart” button
- Show an “Out of stock” badge
- Offer a “Notify me when available” signup form
- When stock returns, auto-email the waitlist
Verify It Worked
Manually lower a product's stock
Pick a test product, set
stock_quantity to 1 below its reorder_threshold.Troubleshooting
Too many alerts flooding Slack
Too many alerts flooding Slack
Raise your
reorder_threshold values, or switch to a daily digest format — one message listing all low-stock items rather than one per product. Batch the query results into a single Slack message.Alerts aren't firing
Alerts aren't firing
Most common cause: product rows have NULL
reorder_threshold. Run SELECT COUNT(*) FROM products WHERE reorder_threshold IS NULL and backfill. Second most common: the workflow is disabled — check the toggle in the top right.Alerts fire but nothing is actually low
Alerts fire but nothing is actually low
The
low_stock_alerted_at flag isn’t being cleared on restock. Add the reset logic described in Step 6, or manually clear stale flags: UPDATE products SET low_stock_alerted_at = NULL WHERE stock_quantity > reorder_threshold.Wrong person tagged in Slack
Wrong person tagged in Slack
Slack user IDs differ from usernames. Open the user’s Slack profile, click the ”…” menu, copy the member ID (starts with
U). Use that in the mention: <@U123456>.Out-of-stock page still shows product as available
Out-of-stock page still shows product as available
Your product page fetches stock at render time but caches. Either disable caching on product pages, or add a stock check at the API layer that runs fresh on every page load.
What’s Next?
Build Product Pages
Set up the storefront side of your e-commerce
Send SMS with Twilio
Wire up SMS for urgent alerts