🀝 Detect and escalate Salesforce bottlenecks with Gemini, Slack, Gmail

⚑ 5 views · 🀝 CRM & Sales Operations

Description

Quick overview

This workflow runs daily to scan open Salesforce opportunities and related tasks, detect overdue or high-priority internal dependencies, generate an AI-written escalation summary with Google Gemini, and then notify stakeholders via Slack and Gmail while updating the opportunity and logging the incident to Google Sheets.

How it works

  1. Runs every day at 9:00 to start a bottleneck check.
  2. Retrieves all open Salesforce opportunities and Salesforce tasks linked to records, then matches tasks to their related opportunities.
  3. Flags tasks as bottlenecks when they are overdue or high priority and still open, assigns a dependency type from the task subject (for example legal, proposal, technical, or finance), and calculates a severity level.
  4. For each detected bottleneck, sends the opportunity and task context to Google Gemini to produce a JSON summary, escalation reason, recommended next action, owner team, and severity.
  5. Sends a formatted bottleneck alert to a Slack channel and a plain-text escalation email via Gmail.
  6. Updates the Salesforce opportunity Next Step field with the bottleneck details and appends an audit row to a Google Sheets log.

Setup

  1. Add Salesforce credentials with permission to query Opportunities and Tasks and to update Opportunities.
  2. Add Google Gemini credentials for the chat model used to generate bottleneck summaries.
  3. Add a Slack OAuth2 connection and select the channel where bottleneck alerts should be posted.
  4. Add a Gmail connection and configure the recipient(s) for escalation emails in the Gmail node.
  5. Add Google Sheets credentials and set the target spreadsheet and sheet tab used to append bottleneck audit rows.

Additional info

How To Customize Nodes

Add-ons & Enhancements

Use Case Examples

  1. Detect overdue legal reviews blocking deal closure
  2. Identify high-priority proposal approvals not completed
  3. Track finance approvals delaying revenue recognition
  4. Alert teams about technical dependencies in late-stage deals
  5. Maintain an audit trail of all escalated bottlenecks

There can be many more use cases depending on your internal processes.

Troubleshooting Guide

IssuePossible CauseSolution
No data returnedSalesforce query issueVerify SOQL queries and permissions
AI output parsing failsInvalid JSON from AICheck prompt formatting and enforce strict JSON
Slack message not sentIncorrect credentials or channelReconnect Slack and verify channel ID
Email not deliveredGmail config issueCheck Gmail OAuth and recipient field
Salesforce update failsField length limitEnsure text is within 255 characters
Missing bottlenecksLogic too strictAdjust detection conditions in Code node

Need Help?

If you need assistance setting up this workflow, customizing it for your business or building advanced automation solutions, feel free to reach out.

Contact WeblineIndia for:

We are happy to help you scale your automation journey.

πŸ”— Nodes Used

Google Sheets, Slack, Salesforce, Gmail, Schedule Trigger, Basic LLM Chain

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup