Templates / Analyze procurement spend with Google Sheets, Groq Llama 3.3, Notion, and Gmail

Analyze procurement spend with Google Sheets, Groq Llama 3.3, Notion, and Gmail

Ready for 3.0

by WeblineIndia ✓ · 6 views · created 2026-08-18 · Market Research, AI RAG

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 (11)

AI AgentGroq Chat ModelGoogle SheetsGmailNotion

What it does

Quick overview This workflow runs daily, reads procurement spend data from Google Sheets, calculates category-level savings and risk metrics, uses Groq (Llama 3.3) to generate Kraljic Matrix insights, logs results to Notion, appends metrics to a Google Sheets dashboard, and emails an aggregated HTML report via Gmail. How it works 1. Runs every day at 9:30 AM on a schedule. 2. Fetches spend transactions from Google Sheets and groups today’s rows by category to calculate total spend, supplier list, and supplier count. 3. Filters to categories with at least two suppliers, then computes estimated savings, savings percentage, supplier dominance, risk score, and an optimization level. 4. Sends the calculated category metrics to Groq (Llama 3.3) to classify each category into a Kraljic Matrix quadrant and generate issues, recommendations, insights, and optional web search queries. 5. Parses the AI’s JSON response and merges it back with the calculated savings and risk metrics. 6. Writes the enriched category record to a Notion database and appends the key metrics to a Google Sheets dashboard sheet. 7. Aggregates all category results into a single dataset, renders an HTML email that includes a Data Studio dashboard link, and sends the report via Gmail. Setup 1. Add Google Sheets credentials and update the spreadsheet and sheet references for both the input spend data sheet and the dashboard append sheet. 2. Add a Groq API credential to power the Llama-3.3-70b model used for Kraljic Matrix analysis. 3. Add a Notion credential, select the target Notion database, and ensure the database properties match the fields being written (Category, Date, Insight, Savings, Risk Score, Recommendation, Total Spend, Kraljic Matrix, Optimization Level, Search Queries, Supplier Count, Issue). 4. Add Gmail credentials, set the recipient(s) in the email node, and adjust the subject/body if needed. 5. Ensure your Google Sheets input data includes at least these columns: createdat (ISO datetime), category, supplier, and amount (numeric), and update the schedule time if required. Additional info How To Customize Nodes Adjusting Savings Logic: Open the calculate Savings code node. You can easily tweak the JavaScript if/else statements to change the savings percentages based on your industry standards (e.g., changing the 12% savings assumption for 3+ suppliers to 15%). Modifying the AI Persona: Open the AI Insights node. You can edit the "System Message" to change how the AI responds. For example, you can tell it to focus specifically on the European market instead of the Indian market, or ask it to evaluate sustainability risks instead of just financial risks. Customizing the Email Look: Open the Create HTML Format node. This contains standard HTML and inline CSS. You can change the hex color codes (like 4f46e5) to match your company's brand colors, or add your company logo to the top of the email template. Add‑ons There are several ways you can extend the functionality of this workflow: Slack / Microsoft Teams Integration: Add a Slack or Teams node right after the Combine reports node to send a quick alert to a channel when a high-risk category is discovered. ERP Connection: Instead of fetching data from Google Sheets, replace the first node with an HTTP Request node or a database node (like PostgreSQL/MySQL) to pull raw spend directly from your ERP system (like SAP, Oracle, or NetSuite). PDF Generation: Add a service like API2PDF to convert the generated HTML into a downloadable PDF file, and attach it to the final Gmail message. Use Case Examples While this workflow is built for category opportunity discovery, its architecture supports many use cases. There can be more such use cases of this workflow, including: 1. Daily Procurement Opportunity Scanning: Automatically checking daily invoices to group spend and highlight where vendor consolidation can save money. 2. Supply Chain Risk Management: Highlighting categories that rely too heavily on a single supp

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.