📊 Generate competitive deal strategies in Salesforce with Google Sheets and Gemini

⚡ 6 views · 📊 Market Research & Insights

💡 Pro Tip — For competitive intelligence, ScraperNode can automate the data collection — Yelp reviews, Glassdoor company data, and Crunchbase profiles all return structured JSON you can feed straight into this workflow.

View All Scrapers

Description

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 Primary_Competitor__c, Competitive_Strategy_Notes__c, and Competitor_Intelligence_Status__c.
  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

Google Sheets Mapping

Risk Logic

Email Content

Add-Ons (Enhancements)

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

IssuePossible CauseSolution
Workflow not triggeringSalesforce trigger not configuredCheck OAuth connection and trigger setup
No analysis generatedCompetitor field emptyEnsure Primary_Competitor__c is filled
Workflow skips opportunityAlready marked as “Analysis Complete”Reset field or modify IF condition
Missing competitor dataGoogle Sheets mismatchEnsure competitor name matches exactly
Email not sentRecipient not configuredAdd email in Gmail node
AI output emptyAPI or prompt issueVerify Gemini API credentials and prompts
Incorrect risk scoreLogic mismatchReview code node conditions
Salesforce update failsMissing custom fieldsCreate required fields in Salesforce

Need Help?

If you need assistance with:

Feel free to reach out to WeblineIndia, our n8n workflow developers can help you implement, customize and scale automation tailored to your business needs.

🔗 Nodes Used

Google Sheets, Salesforce, Gmail, Salesforce Trigger, Google Gemini

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup