Skip to main content

Send predictive Shopify low-stock alerts with Google Sheets, Slack, and Gmail

Workflow preview

Workflow preview
100%
Send predictive Shopify low-stock alerts with Google Sheets, Slack, and Gmail preview
Open on n8n.io

1. Workflow Overview

Quick overview This workflow runs daily to calculate Shopify product sales velocity, predict days until stockout, and alert on low inventory. It logs alerted variant IDs to Google Sheets to avoid d...

Best for

  • CRM automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, n8n-nodes-base.set, n8n-nodes-base.shopify, n8n-nodes-base.googlesheets, n8n-nodes-base.code, n8n-nodes-base.slack, n8n-nodes-base.gmail

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Tricore Infotech Pvt Ltd.

Original n8n.io source

1.1 Workflow description

Title
Send predictive Shopify low-stock alerts with Google Sheets, Slack, and Gmail
Workflow name
Send predictive Shopify low-stock alerts with Google Sheets, Slack, and Gmail

Quick overview

This workflow runs daily to calculate Shopify product sales velocity, predict days until stockout, and alert on low inventory. It logs alerted variant IDs to Google Sheets to avoid duplicate notifications, then sends a Slack summary and a detailed HTML email via Gmail, with Slack error alerts.

How it works

  1. Runs every day at 7:00 AM UTC on a schedule.
  2. Loads configuration values and reads the existing alert log from Google Sheets for deduplication.
  3. Fetches recent paid Shopify orders from the configured lookback window and retrieves all active Shopify products and variants with inventory tracking.
  4. Calculates per-variant daily sales velocity, estimates days of stock remaining, categorizes urgency, and skips variants already alerted for the current UTC date.
  5. Appends the newly alerted variant IDs and run metadata to Google Sheets as an alert log.
  6. Posts a Slack message with the urgency breakdown and predicted depletion timelines.
  7. Generates an HTML table report and sends it to the configured recipient using Gmail.
  8. If the workflow fails at any point, sends the failed node name and error message to Slack via the global error trigger.

Setup

  1. Connect Shopify OAuth2 credentials in n8n and ensure your store has access to Orders and Products APIs.
  2. Create a Google Sheet with headers runTimestamp, variantIds, and totalVariantsAlerted, connect Google Sheets OAuth2 credentials, and paste the sheet URL into the configuration.
  3. Connect Slack API credentials, set the Slack channel ID in the configuration (and select a channel for the error-alert Slack node), and connect Gmail OAuth2 credentials for sending email.
  4. Update daysToCalculateVelocity, recipientMail, googleSheetUrl, and slackEscalationChannel in the configuration, then adjust the schedule time if needed.

Requirements

  • n8n Version: 2.20 or higher
  • Shopify Store: An active Shopify store with API access
  • Accounts Needed: Shopify, Google Sheets, Gmail, Slack
  • Google Sheet: Set up in advance with the 3 required column headers (see Step 2 above)

Customization

  • Adjust the Velocity Window: Change the daysToCalculateVelocity in the config node (e.g., to 14 or 30 days) if you sell slower-moving goods and need a wider average.
  • Tweak Urgency Thresholds: Open the Calculate Velocity & Depletion node and modify the THRESHOLDS variable to match your supply chain lead times (e.g., change "Critical" from 2 days to 14 days if your supplier takes two weeks to ship).
  • Send to More People: Add multiple emails to the Gmail node separated by commas, or use a distribution email address.
  • Automate Reorders: Add a Shopify node to the end of the workflow to automatically create a "Draft Order" for any items that hit the Critical threshold.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - When Daily at 7am

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.3

Block 8 - Set Inventory Settings

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 9 - Fetch Shopify Orders

Type / Role
n8n-nodes-base.shopify - shopify
Config choices
Version 1

Block 10 - Fetch Shopify Inventory

Type / Role
n8n-nodes-base.shopify - shopify
Config choices
Version 1

Block 11 - Read Inventory Logs from Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 12 - Calculate Inventory Velocity

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Append Alert to Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 14 - Post Inventory Alert to Slack

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2

Block 15 - Build Email Content

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 16 - Send Stock Alert Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 17 - On Global Error

Type / Role
n8n-nodes-base.errorTrigger - errorTrigger
Config choices
Version 1

Block 18 - Post Error to Slack

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2

3. Summary Table

Workflow Send predictive Shopify low-stock alerts with Google Sheets, Slack, and Gmail
Complexity advanced
Nodes 18
Categories CRM, AI Summarization
Author Tricore Infotech Pvt Ltd
Published 27 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15972/15972.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Send predictive Shopify low-stock alerts with Google Sheets, Slack, and Gmail do?

Quick overview This workflow runs daily to calculate Shopify product sales velocity, predict days until stockout, and alert on low inventory. It logs alerted variant IDs to Google Sheets to avoid d...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your CRM, AI Summarization use case.