Skip to content

Flag deals missing key stakeholders, using Salesforce, email and calendar

When a Salesforce deal changes, this n8n workflow checks the roles a deal its size should have against who has actually emailed or met the team, scores the gap and alerts Slack when risk is high.

Curated by Andrew Donato, Editor. Reviewed .

Get one setup like this every Thursday, by email.

Written for sales leaders running leaner teams.

Free. One email a week. Unsubscribe anytime.

Paste this into ChatGPT, Claude or your agent tool. See the prompt

  • Deal Review / Forecasting
  • intermediate
  • AE
  • Sales leader
  • RevOps
Category
Deal Review / Forecasting
Difficulty
Intermediate
Est. cost
Not stated by source; workflow hosting plus OpenAI usage for each analyzed opportunity
Want this running on your team by next week? We'll set it up with your tools.

What problem does this solve?

Big deals stall when the economic buyer, finance or legal never got involved, and nobody notices until late in the cycle. Contact roles in the CRM look complete, but a name on the opportunity is not the same as someone who has actually engaged.

How is the agent set up?

WeblineIndia's n8n template watches Salesforce for updated opportunities. It pulls the opportunity and its Opportunity Contact Roles, then a code step decides which roles the deal should have: an executive sponsor and economic buyer always, a technical buyer from a set deal size, finance and procurement above a larger size, and legal once the deal reaches negotiation or proposal. It searches a connected Gmail mailbox for messages to or from the opportunity's contacts and pulls events from a Google Calendar, merges both into one interaction list, and sends everything to an OpenAI model (gpt-4o-mini by default) with a published system prompt. The prompt separates a contact existing in Salesforce from a contact actually engaging, marks unclear roles as unknown, and returns strict JSON with expected, engaged, missing and unknown roles, a 0 to 100 risk score, the single biggest gap and one recommendation for the AE. Code nodes parse and validate that JSON before the workflow writes status, score, insight, missing roles and a timestamp into custom Salesforce fields, and posts a Slack alert when the score is 61 or higher. The template's notes suggest swapping in HubSpot, Pipedrive or Dynamics, or adding Gong, Chorus or Outlook as interaction sources.

Want this built for your team? Let's talk.

What prompt does it use?

Prompt · 77 lines
You are an enterprise sales stakeholder engagement analyst.

Your job is to analyze Salesforce opportunity stakeholder coverage.

Determine:

1. Which stakeholder roles are expected?
2. Which stakeholder roles are actually engaged?
3. Which expected roles are missing?
4. Which missing stakeholders create the greatest deal risk?
5. Whether the opportunity is LOW, MEDIUM, or HIGH risk.
6. A risk score from 0 to 100.
7. The single most important engagement gap.
8. A practical recommendation for the account executive.

Use evidence from:
- Salesforce contacts and opportunity contact roles
- Email interactions
- Calendar meetings

Rules:
- Do not claim that a stakeholder was engaged unless there is evidence from the provided data.
- If a stakeholder role cannot be determined confidently, classify it as UNKNOWN.
- Distinguish between a contact existing in Salesforce and that contact actually being engaged.
- A Salesforce contact alone does not prove engagement.
- An email interaction indicates communication evidence.
- A calendar meeting indicates meeting participation evidence.
- Consider both the stakeholder's role and their interaction history.
- Do not invent contacts, roles, emails, meetings, or other information.
- Base the risk assessment only on the provided data.

Risk guidelines:
- LOW: Most important expected stakeholder roles are engaged with sufficient evidence.
- MEDIUM: One or more important stakeholder roles have limited or missing engagement.
- HIGH: A critical decision-maker, economic buyer, executive sponsor, finance, procurement, or other important stakeholder is missing or has no meaningful engagement evidence.

Risk score:
- 0-30 = LOW
- 31-60 = MEDIUM
- 61-100 = HIGH

Return ONLY valid JSON.
Do not include markdown.
Do not include ```json.

Return JSON using exactly this structure:

{
  "opportunityId": "string",
  "opportunityName": "string",
  "riskLevel": "LOW | MEDIUM | HIGH",
  "riskScore": 0,
  "expectedStakeholderRoles": [],
  "engagedStakeholderRoles": [],
  "missingStakeholderRoles": [],
  "unknownStakeholderRoles": [],
  "highestRiskMissingStakeholder": "string",
  "engagementGap": "string",
  "recommendation": "string",
  "evidence": [
    {
      "stakeholder": "string",
      "role": "string",
      "emailInteractions": 0,
      "meetingInteractions": 0,
      "engagementStatus": "ENGAGED | NOT_ENGAGED | UNKNOWN",
      "reason": "string"
    }
  ]
}

Rules for the output:
- riskLevel must be exactly LOW, MEDIUM, or HIGH.
- riskScore must be an integer from 0 to 100.
- Use empty arrays when there are no items.
- Use UNKNOWN when evidence is insufficient.
- Do not add fields outside the specified structure.

Replace every {{PLACEHOLDER}} before running. Works with any capable LLM and runner.

Get 5 setups like this every week, free.

Real agent setups with prompts, sources and failure modes, in one short weekly email.

Free. One email a week. Unsubscribe anytime.

What tools does it use?

How do you set it up?

  1. Add custom fields to the Salesforce Opportunity for stakeholder status, risk score, engagement insight, missing roles and last-analysis time.
  2. Import the n8n template and connect Salesforce, Gmail, Google Calendar, OpenAI and Slack credentials.
  3. Edit the expected-roles code step so the deal-size and stage rules match your sales methodology.
  4. On each opportunity update, the workflow gathers contact roles plus email and meeting history and sends it to the model with the stakeholder prompt.
  5. Validated results write back to the opportunity, and deals at or above the alert threshold post to a Slack channel with the missing roles and a recommended action.
  6. Tune the alert threshold (the template suggests lowering it for mid-market teams) and review the first alerts with the AEs before relying on the score.

What results are reported?

No results are claimed; this is a published workflow template. Its notes list uses such as checking economic buyer and champion coverage before deals move to decision stages and catching missing legal or procurement early.

What goes wrong

Where does this break?

  • If an opportunity has no contact roles, the template treats every expected role as missing, so AEs need to keep Opportunity Contact Roles filled in.
  • When there are too many contacts for one Gmail search, the template falls back to a default filter, which can miss or mix up interactions.
  • Malformed model output is caught by parse and validate steps before anything writes to Salesforce; keep those steps if you change the prompt.
  • It only sees one connected mailbox and one calendar. Threads in other reps' inboxes or a call recorder will look like missing engagement unless you add them. (editor note)
  • Triggering on every opportunity update can run the model many times a day on busy deals; consider a daily schedule or a change filter to control cost. (editor note)

This is where most teams get stuck. Want us to handle the setup?

Source and credit

n8n.io ›

WeblineIndia, n8n workflow template · vendor

Source dated 2026-10-13 · last reviewed 2026-10-19. Summarized in our own words; see the source for details.

Related.

Draft stalled-deal rescue emails that cannot cite a wrong number or date

For a stalled deal, an agent reads the CRM record, recent outside news and the last meeting transcript, then drafts a rescue plan and email. A strict checker blocks any draft whose dates, amounts or names don't match the record.

Works with SalesforceGoogle Drive

  • Deal Review / Forecasting
  • advanced

Stamp each deal with a structured profile and backtest the scoring blind

This agent builds a consistent profile of each open deal from calls and CRM data, and first tests whether that profile actually separates past wins from losses. Leaders get a deal score they have checked before trusting it.

Works with any of SalesforceHubSpotGong +6

  • Deal Review / Forecasting
  • advanced
  • Reference setup

Morning deal-risk brief from yesterday's Gong calls and Attio deals

Every morning this agent reads yesterday's recorded calls, checks each deal in the CRM and posts a ranked list of deals most likely to slip to Slack. Managers see objections and competitor mentions before standup.

Works with GongAttioSlack

  • Deal Review / Forecasting
  • advanced