Templates / Monitor daily Shopify profit leaks with GPT-4o, Google Sheets and Slack

Monitor daily Shopify profit leaks with GPT-4o, Google Sheets and Slack

Ready for 3.0

by Anna Cole ✓ · 1 views · created 2026-10-07 · CRM, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (10)

Basic LLM ChainOpenAI Chat ModelStructured Output ParserSlackGoogle Sheets

What it does

Quick overview This workflow runs every morning to pull yesterday’s orders and product variants from Shopify, calculate profit and margin leak signals, generate a short commentary with OpenAI, post a detailed report to Slack, and append daily profit metrics to Google Sheets. How it works 1. Runs every morning at 7am to prepare a “yesterday” date window and Shopify GraphQL queries. 2. Retrieves all of yesterday’s Shopify orders via the Shopify Admin GraphQL API using pagination. 3. Retrieves the full Shopify product variant catalog (including price and cost per item) via the Shopify Admin GraphQL API using pagination. 4. Calculates revenue, COGS, payment fees, and shipping costs to produce gross profit/margin, and flags loss-making orders, unprofitable discount codes, low-margin sellers, below-cost variants, and missing costs. 5. Sends the calculated profit dataset to OpenAI to generate a structured headline, key insights, and suggested actions based only on the provided numbers. 6. Posts a formatted profit report to a Slack channel and appends the day’s metrics as a new row in a Google Sheets tab. Setup 1. Create a Shopify custom app with readorders, readproducts, and readinventory scopes and add a Shopify Admin access token credential in n8n. 2. Add OpenAI API credentials, Slack credentials, and Google Sheets OAuth credentials in n8n. 3. Update the Configuration values (store handle, API version, payment fees, shipping cost per order, target margin, maxPages, Slack channel, and Google Sheet URL). 4. Ensure your Google Sheets file contains a worksheet named Daily profit with columns that match (or can be auto-mapped to) the appended fields. 5. Optional: enable the Meta ad spend step, add a Facebook Graph API credential, and set metaAdAccountId to subtract ad spend and calculate net profit. Requirements - Shopify store with a custom app access token (readorders, readproducts, readinventory scopes) - Cost per item entered for your products in Shopify - OpenAI API key - Slack workspace - Google Sheets with a tab named Daily profit - Optional: Facebook Graph API credential and Meta ad account ID for net profit after ad spend Customization - Set your real payment fee rate, average shipping cost per order and target margin in Configuration - Enable the "Get Meta ad spend" node and set metaAdAccountId to see net profit after ads - Raise lossThreshold above 0 to also flag orders with very thin profit - Change "Set report window" to report weekly or month-to-date instead of yesterday - Add Google Ads or TikTok ad spend using the same pattern as the Meta node - Raise maxPages for stores with very high daily order volume Additional info All profit numbers are calculated in code from Shopify data (revenue after all discounts and refunds, cost per item, payment fees and shipping costs); OpenAI only writes the commentary and is told to use the calculated figures only. Orders and product variants are fetched with GraphQL pagination loops, so the workflow works for small and large catalogs. Test and cancelled orders are excluded, and products without a cost are reported separately instead of being counted as 100% profit.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.