Quick overview
This workflow runs weekly to review contracts stored in Google Sheets, calculates days to expiry and a renewal priority score, uses a Groq-hosted chat model to draft renewal recommendations for high-priority items, posts alerts to Slack, and updates each contract row as processed.
How it works
- Runs weekly on a schedule trigger.
- Reads contract rows from a Google Sheets contract tracker and keeps only rows that are not marked as processed.
- Checks that required fields (ContractID, SupplierName, and ExpiryDate) are present, and sends a Slack message and marks the row as processed in Google Sheets when validation fails.
- Calculates DaysToExpiry and a priority score/level using contract value, risk level, performance score, and expiry urgency.
- For contracts scored as High priority, uses a Groq chat model (via LangChain) to generate a short renewal strategy, then posts a formatted renewal alert to a Slack channel.
- Updates the matching Google Sheets row with Processed=Yes, the computed PriorityLevel, and either the AI recommendation (high priority) or a “monitor for now” recommendation (non-high priority).
Setup
- Connect Google Sheets credentials and update the spreadsheet ID and sheet name to point to your contract tracker.
- Add a Slack credential and set the target Slack channel for renewal and invalid-data alerts.
- Add a Groq API credential for the LangChain chat model used to generate renewal strategies.
- Ensure your Google Sheet includes the columns used by the workflow (at least ContractID, SupplierName, ExpiryDate, ContractValue, RiskLevel, PerformanceScore, Processed, PriorityLevel, and Recommendation) and that ContractID values are unique for row matching.
- Adjust the weekly schedule timing and the scoring thresholds in the code steps if you want different renewal urgency rules.