Quick overview
This workflow runs every Monday, reads sales data from Google Sheets, compares the last 7 days to the previous week, generates an executive summary with Anthropic Claude, renders a PDF via MintPDF, posts it to Slack, and archives the report in Google Drive.
How it works
- Runs every Monday at 8:00 on a schedule.
- Loads report settings and fetches all rows from the specified Google Sheets Sales tab.
- Splits rows into “this week” and “last week,” totals KPIs (revenue, refunds, orders, units, customers), and calculates changes plus top products, regions, and daily revenue.
- If there are no sales in the current period, posts a no-sales message to the configured Slack channel and stops.
- Sends the computed metrics to Anthropic Claude to write a 3–5 bullet executive summary, falling back to a basic summary if the AI output is empty.
- Builds a Markdown report, converts it to a PDF using MintPDF, then posts the PDF to Slack and uploads it to Google Drive or alerts Slack if rendering fails.
Setup
- Install the community node
n8n-nodes-mintpdf and add a MintPDF API credential.
- Add credentials for Google Sheets, Slack (with
files:write and chat:write scopes), Google Drive, and Anthropic (Claude).
- Update the Report settings values for your Google Sheet ID, Sales tab name, Slack channel ID, and Google Drive folder ID.
- Ensure your Google Sheet has columns named Date, Order ID, Customer, Product, Region, Quantity, Amount, and Status with parseable dates and amounts.
Requirements
- A MintPDF API key (free plan: 100 PDFs a month)
- Google Sheets, Google Drive and a Slack bot with files:write and chat:write
- An Anthropic API key (or another chat model)
Customization
- Replace "Get sales rows" with Shopify, Stripe or Postgres and keep the same columns
- Change the period in "Compare this week with last week"
- Send the PDF by Gmail instead of Slack