Weekday low-stock restock report for Shopify

By General Input

Every weekday at 7am ET, log your low-stock Shopify SKUs to a Google Sheets tracker and post the most urgent ones to Slack with a days-of-cover estimate.

Integrations

  • Shopify
  • Google Sheets
  • Slack

Type

Deterministic Code

Categories

  • Operations

Build a code workflow that produces a low-stock restock report for my Shopify store every weekday morning and delivers it to a Google Sheets tracker plus a Slack summary.

Trigger: cron, every weekday (Monday through Friday) at 7am America/New_York.

Inputs I should be able to configure: the low-stock threshold (default 10 units), the lookback window for sales velocity (default 30 days), the Google Sheets spreadsheet ID and tab name for the restock tracker, the Slack channel for the morning summary, and how many items to include in the Slack top list (default 10).

Steps:

1. Call Shopify List Inventory Levels to pull current quantities for every inventory item across every location in the store. Aggregate the per-location quantities so each inventory item has a single total on-hand number. Drop anything at or above the threshold and keep only the SKUs at or below it.

2. For the low-stock items, call Shopify List Products (and List Variants where needed) to attach product title, SKU, vendor, and price for each variant. If an inventory item does not map to a sellable variant (raw component, archived product), skip it.

3. Call Shopify List Orders for the last 30 days, filtered to paid and not cancelled, and aggregate units sold per SKU across all line items. Divide by 30 to get an average daily run rate. Compute days of cover for each low-stock SKU as current on-hand divided by daily run rate. If the daily run rate is zero, mark days of cover as "no recent sales" rather than dividing by zero.

4. Sort the low-stock list by days of cover ascending (most urgent first).

5. Append one row per low-stock SKU to the Google Sheets tracker using Append Values. Columns: run date, product title, SKU, vendor, price, on-hand units, 30-day units sold, daily run rate, days of cover.

6. Post a Slack Send a Message to the configured channel with a short header (date and total count of low-stock SKUs), then the top 10 most-urgent items as a bullet list showing product title, SKU, on-hand, and days of cover. End with a link to the Google Sheet.

If the low-stock list is empty for the day, still post a one-line Slack message saying everything is above threshold and skip the sheet append.

Three integrations: Shopify (List Inventory Levels, List Products, List Variants, List Orders), Google Sheets (Append Values), Slack (Send a Message). The pipeline is fully deterministic, no judgement step.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seats