See llms.txt for all machine-readable content.

Back to Templates

Schedule festive Shopify sales with Google Sheets, Slack and GPT-4o-mini

Quick overview

This workflow schedules Shopify variant price changes from a Google Sheets sale plan, validates discounts and margins before starting, rolls prices back safely at the end, and posts preflight checks, change summaries, and a 30-minute AI-assisted sale pulse to Slack with an on-demand rollback link.

How it works

  1. Runs every 5 minutes to read the Sale Plan tab in Google Sheets and decide which rows need a preflight check, a sale start, a sale end (rollback), or need to be marked as invalid/expired.
  2. Fetches each variant’s current price, compare-at price, and inventory from Shopify and calculates the target sale price from either sale_price or discount_pct.
  3. Validates each row against stock availability, maximum discount, and minimum margin rules, then posts a Slack preflight report up to 24 hours before the sale start highlighting any rows that need fixes.
  4. At the sale start or end time, either posts a dry-run preview to Slack or updates Shopify variant price and compare-at price in batches via the Shopify GraphQL API.
  5. Records results back to Google Sheets by updating the Sale Plan row status and appending an entry to a Price Change Log tab, then posts a Slack summary including a “Roll back now” button.
  6. Runs every 30 minutes during live sales to fetch Shopify orders and inventory, calculate units, revenue, pace, and stock flags, and uses OpenAI (gpt-4o-mini) to generate a short numeric read that is posted to Slack.
  7. Accepts rollback webhook clicks from Slack, validates a token, sets the sale end time to “now” in Google Sheets, and the next scheduled run restores original prices and sends a final Slack report when all rows for a sale have ended.

Setup

  1. Create a Shopify custom app with product and order access, then add its Admin API access token as HTTP Header Auth for the Shopify HTTP Request nodes and set your store domain in the configuration code.
  2. Add Google Sheets credentials and replace the placeholder spreadsheet ID, then create and populate the “Sale Plan” and “Price Change Log” tabs with the required columns (including row_id, sale_id, sale_name, variant_id, start_at, end_at, and either sale_price or discount_pct).
  3. Add Slack credentials, replace the placeholder Slack channel ID, and ensure the workflow can post both simple messages and Block Kit messages.
  4. Add OpenAI credentials for the OpenAI (LangChain) node and select/confirm the gpt-4o-mini model access.
  5. Update the rollback webhook base URL and set a strong stop_secret value in the configuration code so the “Roll back now” link token validation works.
  6. Leave dry_run enabled to validate previews first, then set dry_run to false when you’re ready to let the workflow update Shopify and write status changes back to Google Sheets.