Skip to main content

Automate stale deal follow-ups in Salesforce with GPT-5.1, email, Slack & tasks

Workflow preview

Workflow preview
100%
Automate stale deal follow-ups in Salesforce with GPT-5.1, email, Slack & tasks preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

How it works Runs every morning at 8:00 using the Schedule Trigger. Sets a value and queries Salesforce for Opportunities where equals that value and the stage is not Closed Won / Closed Lost. For ...

Best for

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

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.set, n8n-nodes-base.salesforce, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.httprequesttool, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.emailsend

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Automate stale deal follow-ups in Salesforce with GPT-5.1, email, Slack & tasks
Workflow name
Automate stale deal follow-ups in Salesforce with GPT-5.1, email, Slack & tasks

How it works

  • Runs every morning at 8:00 using the Schedule Trigger.
  • Sets a stale_days value and queries Salesforce for Opportunities where Stage_Unchanged_Days__c equals that value and the stage is not Closed Won / Closed Lost.
  • For each “stale” Opportunity, loads full deal details and sends them to an OpenAI model.
  • The model uses the query_soql tool to pull recent Notes, the primary Contact, and the Opportunity Owner, then returns a single JSON object with:
    • a personalized follow-up email for the client,
    • a short SMS template,
    • a concise Slack summary for the sales team,
    • and a ready-to-use Task payload for Salesforce.
  • n8n parses that JSON, sends the email via SMTP, posts the Slack message to your chosen channel, and creates a Salesforce Task assigned to the Opportunity Owner so every stalled deal has a clear next step.

Setup steps

Estimated setup time: ~30–45 minutes if your Salesforce, OpenAI, SMTP and Slack credentials are ready.

  1. Create Stage_Unchanged_Days__c on Opportunity (Salesforce)

    • Field Type: Formula (Number, 0 decimal places)
    • Formula:
      IF(
        ISBLANK(LastStageChangeDate),
        TODAY() - DATEVALUE(CreatedDate),
        TODAY() - DATEVALUE(LastStageChangeDate)
      )
      
    • This field tracks how many days the Opportunity has been in the current stage.
  2. Connect credentials in n8n

    • Salesforce OAuth2 for the Salesforce nodes and the query_soql HTTP Tool.
    • OpenAI (or compatible) credential for the “Message a model” node.
    • SMTP credential for the customer email node.
    • Slack credential for the internal notification node.
  3. Configure your follow-up rules

    • In Edit Fields (Set), set stale_days to the threshold that defines a stalled deal (e.g. 7, 14, 30).
    • In Perform a query, optionally refine the SOQL (record types, owners, minimum amount, etc.) to match your pipeline.
    • Update the Send Email SMTP Customer node with your real “from” address and tweak the wording if needed.
    • Point Send Message To Internal Team (Slack) to the right channel or user.
  4. Test safely

    • Turn off the Schedule Trigger and run the workflow manually with a few test Opportunities.
    • Inspect the AI output in Message a model and Parse JSON to confirm the structure (email, sms, slack, task.api_body).
    • Check that the email and Slack messages look good and that Salesforce Tasks are created, assigned to the right Owner, and linked to the correct Opportunity.
  5. Go live

    • Re-enable the Schedule Trigger.
    • Monitor the first few days to confirm that follow-ups, Slack alerts, and Tasks all behave as expected, then let the automation quietly keep your pipeline clean and moving.

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 - Schedule Trigger

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

Block 2 - Edit Fields

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

Block 3 - Perform a query

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

Block 4 - Get an opportunity

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

Block 5 - Message a model

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

Block 6 - query_soql

Type / Role
n8n-nodes-base.httpRequestTool - httpRequestTool
Config choices
Version 4.3

Block 7 - Create Task

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

Block 8 - Parse JSON

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

Block 9 - Send Email SMTP Customer

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

Block 10 - Send Message To Internal Team

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

Block 11 - Sticky Note

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

Block 12 - Sticky Note1

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

Block 13 - Sticky Note – Actions Summary

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

Block 14 - Sticky Note – AI Engine1

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

Block 15 - Sticky Note – Schedule & Threshold

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

Block 16 - Sticky Note – Opportunity Fetch

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

3. Summary Table

Workflow Automate stale deal follow-ups in Salesforce with GPT-5.1, email, Slack & tasks
Complexity advanced
Nodes 16
Categories Lead Nurturing, AI Summarization
Author Le Nguyen
Published 23 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11157/11157.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 Automate stale deal follow-ups in Salesforce with GPT-5.1, email, Slack & tasks do?

How it works Runs every morning at 8:00 using the Schedule Trigger. Sets a value and queries Salesforce for Opportunities where equals that value and the stage is not Closed Won / Closed Lost. For ...

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 Lead Nurturing, AI Summarization use case.