Templates / Assess contract risk from Google Drive with Groq, Salesforce and Slack

Assess contract risk from Google Drive with Groq, Salesforce and Slack

Ready for 3.0

by WeblineIndia ✓ · 21 views · created 2026-08-12 · Document Extraction, 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 (11)

Google DriveAI AgentGroq Chat ModelSalesforceSlack

What it does

Quick overview This workflow monitors a Google Drive folder for new PDF contracts, extracts and cleans the text, uses Groq-hosted LLMs to extract clauses and assess risk, then writes the final risk summary to a Salesforce custom object and posts a notification to Slack. How it works 1. Triggers when a new file is created in a specific Google Drive folder. 2. Checks that the new file is a PDF, then downloads it and derives a contract name from the filename. 3. Extracts text from the PDF, normalizes whitespace, and splits the contract into smaller chunks. 4. Uses a Groq LLM to extract and classify key clauses from each chunk and parses the model output into structured JSON. 5. Sends the extracted clauses to a Groq LLM to assign risk levels, identify issues, and recommend improvements, then generates an overall risk report (overall risk, summary, top risks, and recommendations). 6. Searches Salesforce for an existing ContractAIc record by contract name, creates one if missing, and updates the record with the final report fields. 7. Posts a Slack message to the selected channel with the overall risk level, summary, and the top risk and recommendation. Setup 1. Connect your Google Drive credentials and set the folder ID to watch for incoming contract PDFs. 2. Add Groq credentials (or equivalent supported configuration) for the three LLM steps used for clause extraction, risk analysis, and final report generation. 3. Connect Salesforce credentials and ensure the ContractAIc custom object and fields (RiskLevelcc, Summaryc, TopRisksc, Recommendationsc) exist and match the workflow mappings. 4. Connect Slack credentials and select the channel where the risk summary should be posted. 5. Verify the Salesforce search query and update field mappings (especially the contract name used for lookup) to match your naming conventions. Additional info How To Customize Nodes Adjusting Chunk Size: If you are using an AI model with a massive context window, you can double-click the "Split Contract into Chunks" Code node and change the chunkSize variable from 3000 to a higher number. Targeting Specific Clauses: In the "Extract Contract Clauses" Agent node, you can edit the System Message under options. Add or remove clause categories you care about (e.g., add "Data Privacy" or "Service Level Agreements"). Customizing the Slack Message: Open the Slack node and modify the "Text" parameter to include mentions (like @channel or specific user IDs) or format the text using Slack's markdown. Mapping Different CRM Fields: If you use standard Salesforce objects (like Opportunities or standard Contracts) instead of a custom object, just alter the Salesforce nodes to target your preferred object and map the AI output JSON to your specific fields. Add‑ons Here are a few ways you can extend this workflow: Human-in-the-Loop Validation: Send an interactive Slack message with "Approve" or "Reject" buttons before the data is pushed to Salesforce. Email Summary: Add a Gmail or Outlook node at the end to email the final risk report directly to the legal department. Support for Word Documents: Add an IF node after the trigger to check if the file is .docx. If it is, use a cloud conversion tool node to turn it into text alongside the PDF route. Cloud Storage Archive: Add a node to move the processed PDF from an "Inbox" Drive folder to a "Processed Contracts" folder once the workflow completes successfully. Use Case Examples 1. Vendor Agreement Vetting: Automatically scan incoming software subscriptions or supplier contracts for hidden auto-renewal clauses or high-risk indemnities. 2. NDA Risk Screening: Ensure non-disclosure agreements match your company's standard terms and don't contain unusually long confidentiality periods. 3. Sales Contract Review: Allow sales reps to drop drafted contracts into a Drive folder and automatically get a Slack message confirming if the terms meet the legal baseline before sending to clients. 4. Employment Agreement Checks: Scan HR docum

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.