# Generate competitive deal strategies in Salesforce: n8n workflow

> Started by an event in a connected app, and works across Gmail, Google Sheets and Salesforce. It hands the judgement calls to Gemini.

Source: https://millionrounds.com/workflow/generate-competitive-deal-strategies-in-salesforce (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [CRM](https://millionrounds.com/workflows?category=CRM#library)

# Generate competitive deal strategies in Salesforce

Started by an event in a connected app, and works across Gmail, Google Sheets and Salesforce. It hands the judgement calls to Gemini. 18 steps, 1 branch, 2 loops or waits: a working afternoon to understand properly.

Medium Calls a model: Gemini

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fgenerate-competitive-deal-strategies-in-salesforce)

**18 steps** Medium: a working afternoon

**1** Branch: places the flow splits

**2** Loops or waits

**3** Services it connects to

## The flow

Starts it 2 Model 2 Logic 9 Service 5

The steps in the order they run, from what starts it.

- 1 **Opportunity Created** Salesforce trigger *Starts it*
- 2 **Opportunity Updated** Salesforce trigger *Starts it*
- 3 **Process Each Opportunity** Split In Batches *Logic*
- 4 **Get Opportunity Details** Salesforce *Service*
- 5 **Competitor Present & Not Processed** If *Logic*
- 6 **Fetch Account Opportunity History** Salesforce *Service*
- 7 **Fetch Competitor Intelligence** Google Sheets *Service*
- 8 **Account Opportunities** Aggregate *Logic*
- 9 **History + Competitor Data** Merge *Logic*
- 10 **Account History Summary** Code *Logic*
- 11 **AI Input Payload** Set *Logic*
- 12 **Competitive Analysis (Current Deal)** Google Gemini *Model*
- 13 **Counter Strategy Generator** Google Gemini *Model*
- 14 **Competitive Risk Score** Code *Logic*
- 15 **Strategy Notes & Status** Set *Logic*
- 16 **Update Opportunity (Strategy & Status)** Salesforce *Service*
- 17 **Send Analysis Email** Gmail *Service*
- 18 **Control Execution Cycle** Wait *Logic*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 18, with 1 branch, 2 loops or waits
- **Size:** Medium: a working afternoon
- **Connects to:** Gmail, Google Sheets, Salesforce
- **Model:** Gemini

## Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Sheets and Salesforce accounts, and a key for Gemini. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an event in a connected app.

Does it use AI?

Yes. It calls Gemini. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 18 steps is enough that you should read each one before running it.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 18 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fgenerate-competitive-deal-strategies-in-salesforce)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[Salesforce](https://millionrounds.com/workflows?service=Salesforce#library)

## Workflows like it

Also crm, with the same services where possible, closest in size first.

- [**Automate weekly timesheet reporting with Salesforce and OpenAI** 18 steps · calls a model · Gmail, Salesforce](https://millionrounds.com/workflow/automate-weekly-timesheet-reporting-with-salesforce-and-open)
- [**CoinGecko crypto price forecasting pipeline with Gemini** 18 steps · calls a model · Gmail, n8n data table](https://millionrounds.com/workflow/coingecko-crypto-price-forecasting-pipeline-with-gemini)
- [**Find and analyze salvage car deals with Google Sheets** 18 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/find-and-analyze-salvage-car-deals-with-google-sheets)
- [**Predict tenant churn and manage retention with OpenAI** 18 steps · calls a model · Gmail](https://millionrounds.com/workflow/predict-tenant-churn-and-manage-retention-with-openai)
- [**Screen and score investment deals with OpenAI and Gmail** 18 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/screen-and-score-investment-deals-with-openai-and-gmail)
- [**Generate style-locked Seedance videos with Gmail and Jira** 18 steps · Gmail, Jira](https://millionrounds.com/workflow/generate-style-locked-seedance-videos-with-gmail-and-jira)
