Analyze Salesforce stakeholder risk with Gmail, Google Calendar, OpenAI and Slack
Go to WorkflowDescription
Quick overview
This workflow monitors updated Salesforce opportunities, gathers related contacts plus Gmail and Google Calendar interaction history, uses OpenAI to assess stakeholder engagement gaps and risk, writes the results back to Salesforce custom fields, and posts a high-risk alert to Slack.
How it works
Triggers when a Salesforce Opportunity is updated.
Retrieves the opportunity details and the associated Opportunity Contact Roles from Salesforce.
Calculates which stakeholder roles are expected based on the opportunity amount and stage, then compiles the customer contact emails/domains to search.
Searches the connected Gmail mailbox for emails involving the opportunity contacts and pulls events from a specified Google Calendar.
Normalizes email and meeting results into a single interaction list and combines it with opportunity context and contact details.
Sends the combined data to OpenAI (gpt-4o-mini) to generate a structured JSON stakeholder gap and risk analysis, then parses and validates the response.
Updates the Salesforce Opportunity with the risk status, score, engagement insight, last analysis timestamp, and missing stakeholder roles, and posts a Slack alert if the risk score is 61 or higher.
Setup
Connect Salesforce credentials and ensure the Opportunity object has the custom fields used for output (Stakeholder_Engagement_Status__c, Last_Stakeholder_Analysis__c, Stakeholder_Risk_Score__c, Stakeholder_Engagement_Insight__c, Missing_Stakeholders__c).
Connect Gmail credentials for the mailbox you want to scan for messages with opportunity contacts.
Connect Google Calendar credentials and set the target calendar ID used to pull meeting events.
Add an OpenAI credential (configured in the OpenAI node) and select an available model (default: gpt-4o-mini).
Connect Slack credentials and set the destination channel for high-risk alerts.
Additional info
Customization Options
Custom Role Matrix**: Adjust threshold rules in the Determine Expected Stakeholder Roles node to match your company's sales methodology (e.g., requiring Procurement at $100k instead of $250k).
Alternative CRM Integration**: Replace Salesforce nodes with HubSpot, PipeDrive, or Dynamics 365 nodes.
Enhanced Communication Channels**: Expand interaction gathering by integrating Gong, Chorus, Microsoft Outlook, or Slack conversation nodes.
Threshold Tuning**: Adjust the alert sensitivity in the IF High Stakeholder Risk node (e.g., lower threshold to 50 for mid-market teams).
Use Case Examples
MEDDPICC Alignment & Coverage Auditing**: Automatically verifies Economic Buyer and Champion participation prior to pushing deals to decision stages.
Enterprise Deal Slippage Prevention**: Identifies missing legal or procurement stakeholders early in contract negotiation stages.
Executive Oversight for High-Value Deals**: Flags large opportunities ($250k+) lacking C-suite or Executive Sponsor involvement.
Troubleshooting Guide
Missing Contacts in Salesforce**: If zero contact roles are attached to an Opportunity, the workflow classifies all required roles as missing. Ensure AEs regularly populate Opportunity Contact Roles.
Gmail Search Limitations**: If search queries exceed character limits due to excessive contacts, the workflow falls back to default filters (label:SENT).
AI Formatting Errors**: The Parse AI Analysis Response and Validate AI Analysis code nodes catch malformed JSON outputs and enforce validation standards before updating Salesforce.
Need Assistance?
WeblineIndia can help you with:
n8n workflow customization
AI automation development
OpenAI integrations
Supabase and PostgreSQL setup
Slack and business integrations
Enterprise workflow automation
AI-powered reporting systems
Production deployment support
Whether you need workflow enhancements, custom dashboards, advanced AI integrations or entirely new automation systems, WeblineIndia can help build scalable solutions tailored to your business needs.
This workflow was created by WeblineIndia and shared publicly on the n8n community template library. n8nFind indexes it for discovery — the workflow remains the property of its original creator.