Quick Overview
This workflow runs every Monday morning to pull unscored sourcing initiatives from a Notion database, calculate a risk-weighted priority score, optionally generate a Groq-based AI rationale for higher-priority items, write results back to Notion, post a ranked report to Slack, and email an alert for critical scores.
How it works
- Runs weekly on Monday at 08:00.
- Retrieves all Notion database pages where the “Priority Score” property is empty and maps the key project metrics into a clean structure.
- Calculates a priority score for each initiative using value, urgency, supplier risk, business impact, and effort.
- Uses Groq to generate a 2-sentence procurement rationale only for items with a priority score of 20 or higher, and assigns a default rationale for lower-scored items.
- Sorts the initiatives by priority score (highest first) and updates each Notion page with the computed “Priority Score” and “AI Rationale.”
- Compiles a single “Weekly Sourcing Priority Report” message and posts it to a Slack channel.
- Checks the highest score in the batch and sends a Gmail alert email if it exceeds 50.
Setup
- Connect your Notion credentials and select the target database ID, ensuring it has properties for Project Name, Value, Urgency, Supplier Risk, Business Impact, Effort, Priority Score, and AI Rationale.
- Add a Groq API credential (Chat Model) to enable AI rationale generation for items scoring 20 or higher.
- Add Slack credentials and set the destination channel (currently #social) for the weekly report.
- Add Gmail credentials and replace RECEIVER_MAIL_HERE with the alert recipient email address.
- Adjust the score thresholds (20 for AI rationale, 50 for email escalation) if your scoring scale differs.