Skip to main content

Assess Salesforce deal risk with Gmail, Outlook, OpenAI and Slack alerts

Workflow preview

Workflow preview
100%
Assess Salesforce deal risk with Gmail, Outlook, OpenAI and Slack alerts preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow runs every six hours to pull open Salesforce opportunities, enriches selected deals with Gmail and Microsoft Outlook email context, uses OpenAI to score deal risk, writ...

Best for

  • CRM automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.code, n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.slack, n8n-nodes-base.salesforce, n8n-nodes-base.gmail, n8n-nodes-base.microsoftoutlook, @n8n/n8n-nodes-langchain.openai

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by WeblineIndia.

Original n8n.io source

1.1 Workflow description

Title
Assess Salesforce deal risk with Gmail, Outlook, OpenAI and Slack alerts
Workflow name
Assess Salesforce deal risk with Gmail, Outlook, OpenAI and Slack alerts

Quick Overview

This workflow runs every six hours to pull open Salesforce opportunities, enriches selected deals with Gmail and Microsoft Outlook email context, uses OpenAI to score deal risk, writes the assessment back to Salesforce, and notifies teams in Slack with optional email escalation for critical deals.

How it works

  1. Runs every 6 hours and queries Salesforce for up to 100 open Opportunities via the REST API.
  2. Stops the run and posts a Slack message if the Salesforce fetch returns an error.
  3. Normalizes each Opportunity, computes activity/close-date metrics, and routes deals with missing required fields to a Slack channel for manual data cleanup.
  4. Applies a heuristic triage and immediately marks non-risky deals as healthy in Salesforce to avoid unnecessary AI analysis.
  5. For triaged deals, pulls recent related messages from Gmail and Microsoft Outlook, merges them, and builds a compact email engagement context (participants, reply counts, and silence gap).
  6. Sends the CRM and email context to OpenAI to produce a structured risk score, drivers, and recommended actions, then validates and cleans the AI output.
  7. Updates Salesforce with the assessed risk fields and, for non-low risk deals, posts a detailed Slack alert (with cooldown suppression) and emails leadership when the risk level is Critical.

Setup

  1. Add Salesforce OAuth2 credentials, set the SALESFORCE_INSTANCE_URL environment variable, and ensure the Opportunity custom fields used for risk tracking (for example Risk_Score__c, Risk_Level__c, Risk_Summary__c, and Deal_Health__c) exist.
  2. Add OpenAI credentials and confirm the selected model (gpt-4o-mini) is available in your OpenAI account.
  3. Add Slack OAuth2 credentials and update the target channel IDs for Salesforce failure alerts, incomplete-deal alerts, and risk alerts.
  4. Add Gmail OAuth2 credentials and Microsoft Outlook credentials (optional) so the workflow can retrieve deal-related email threads.
  5. Set the LEADERSHIP_EMAIL environment variable (or edit the node default) to define where Critical-risk escalation emails are sent.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Clean & Prepare Deal Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 2 - Standardize Deal Fields (Set Node)

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Check for Missing Deal Information

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 4 - Send Incomplete Deals for Manual Review

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Alert Slack on Incomplete Deal Data

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

Block 6 - Filter Important Deals (Risky / High Value)

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 7 - Mark Deal as Healthy (Skip AI Analysis)

Type / Role
n8n-nodes-base.salesforce - salesforce
Config choices
Version 1

Block 8 - Get Deal Emails from Gmail

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 9 - Get Deal Emails from Outlook

Type / Role
n8n-nodes-base.microsoftOutlook - microsoftOutlook
Config choices
Version 2

Block 10 - Combine All Email Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Prepare Email Insights for AI

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Analyze Deal Risk Using AI

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 2.1

Block 13 - Validate & Clean AI Results

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 14 - Is This Deal Risky Enough to Act?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 15 - Update Deal Risk in Salesforce

Type / Role
n8n-nodes-base.salesforce - salesforce
Config choices
Version 1

Block 16 - Save Low-Risk Deal Status

Type / Role
n8n-nodes-base.salesforce - salesforce
Config choices
Version 1

Block 17 - Prevent Duplicate Alerts

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 18 - Send Risk Alert to Slack Channel

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

Block 19 - Check if Deal is Critical Risk

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 20 - Non-Critical — No Email Escalation

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 21 - Send Suppressed Alert Notification to Owner

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 22 - Auto Trigger: Run Deal Risk Check (Every 6 Hours)

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 23 - Fetch Open Deals from Salesforce

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 24 - Check: Salesforce API Error

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Showing the first 24 of 35 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Assess Salesforce deal risk with Gmail, Outlook, OpenAI and Slack alerts
Complexity advanced
Nodes 35
Categories CRM, AI Summarization
Author WeblineIndia
Published 17 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16444/16444.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Assess Salesforce deal risk with Gmail, Outlook, OpenAI and Slack alerts do?

Quick Overview This workflow runs every six hours to pull open Salesforce opportunities, enriches selected deals with Gmail and Microsoft Outlook email context, uses OpenAI to score deal risk, writ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your CRM, AI Summarization use case.