Generate competitive deal strategies in Salesforce with Google Sheets and Gemini
Ready for 3.0Ready 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 (12)
- Google Gemini
@n8n/n8n-nodes-langchain.googleGemini - Code
n8n-nodes-base.code - Edit Fields (Set)
n8n-nodes-base.set - Salesforce
n8n-nodes-base.salesforce - Gmail
n8n-nodes-base.gmail - Wait
n8n-nodes-base.wait - Salesforce Trigger
n8n-nodes-base.salesforceTrigger - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - If
n8n-nodes-base.if - Aggregate
n8n-nodes-base.aggregate - Google Sheets
n8n-nodes-base.googleSheets - Merge
n8n-nodes-base.merge
What it does
Quick overview This workflow triggers on Salesforce opportunity creation or updates, pulls recent account opportunity history and competitor intel from Google Sheets, uses Google Gemini to generate competitive analysis and a counter-strategy, calculates a competitive risk score, updates the Salesforce opportunity with notes and status, and emails the results via Gmail. How it works 1. Triggers when a Salesforce opportunity is created or updated, then processes each opportunity in turn. 2. Loads the full opportunity details from Salesforce and continues only if a primary competitor is set and the opportunity has not already been marked as “Analysis Complete.” 3. Queries Salesforce for the account’s last 10 opportunities and fetches matching competitor intelligence from a Google Sheets “Competitive Intelligence Database.” 4. Summarizes the account’s win/loss history and compiles the current deal details, competitor intel, and historical context into a single AI input payload. 5. Uses Google Gemini to analyze the current active deal’s competitive factors and generate an actionable counter-strategy and next-step plan. 6. Calculates a competitive risk score based on deal size, sales stage, competitor name, and prior win/loss signals, then formats strategy notes and status. 7. Updates the Salesforce opportunity’s competitive strategy and intelligence status fields and sends a Gmail notification email to the sales team. Setup 1. Connect Salesforce credentials and ensure your Opportunity object has the custom fields PrimaryCompetitorc, CompetitiveStrategyNotesc, and CompetitorIntelligenceStatusc. 2. Connect Google Sheets credentials and update the spreadsheet document ID, sheet name, and column mappings used to look up competitor intel by “Competitor Name.” 3. Connect Google Gemini (API key/credentials) and confirm the selected model is available in your environment. 4. Connect Gmail credentials and set the recipient(s) and any sender/permission requirements for sending notification emails. 5. Adjust the risk-scoring rules (deal thresholds, sales stages, and competitor list) to match your sales process and competitive landscape. Additional info How To Customize Nodes AI Prompts - Modify prompts in: - Competitive Analysis (Current Deal) - Counter Strategy Generator - Customize tone, depth, or output format Google Sheets Mapping - Add more columns (pricing, strengths, weaknesses) - Update mapping in AI Input Payload Risk Logic - Edit scoring logic in Competitive Risk Score node - Add/remove conditions or adjust scoring weights Email Content - Customize subject and message in Send Analysis Email Add-Ons (Enhancements) - Slack or Microsoft Teams notifications - Dashboard integration (Power BI / Tableau) - Auto-create follow-up tasks in Salesforce - Add win/loss prediction model - Multi-competitor comparison logic - Store analysis logs in database Use Case Examples 1. Enterprise Deal Strategy - Analyze million-dollar deals and prepare executive-level strategy 2. Competitive Sales Enablement - Equip reps with real-time talking points before meetings 3. Account-Based Selling - Use historical account insights to improve win probability 4. Pipeline Risk Monitoring - Identify high-risk deals early and escalate 5. Sales Coaching - Help junior reps with structured AI-generated guidance There can be many more use cases depending on your business needs. Troubleshooting Guide | Issue | Possible Cause | Solution | |------|---------------|----------| | Workflow not triggering | Salesforce trigger not configured | Check OAuth connection and trigger setup | | No analysis generated | Competitor field empty | Ensure PrimaryCompetitorc is filled | | Workflow skips opportunity | Already marked as "Analysis Complete" | Reset field or modify IF condition | | Missing competitor data | Google Sheets mismatch | Ensure competitor name matches exactly | | Email not sent | Recipient not configured | Add email in Gmail node | | AI output empty | API or prompt issue