Send a Slack alert when a Salesforce deal changes stage using Flow Builder

low complexityCost: $0 (included)

Prerequisites

Prerequisites
  • Salesforce org with access to Flow Builder (Enterprise, Unlimited, or Developer edition)
  • Slack workspace with either the Salesforce for Slack app installed or an Incoming Webhook URL
  • Admin or System Administrator profile in Salesforce (required to create and activate flows)

Why Flow Builder?

Flow Builder is the simplest approach because everything stays inside Salesforce — no external tools, no API keys, no hosting. Record-Triggered Flows fire instantly when an Opportunity's stage changes, and the native Send Slack Message action delivers the alert within seconds. There's zero ongoing cost beyond your existing Salesforce license.

The trade-off is formatting flexibility. The native Slack action sends plain text messages — no Block Kit, no buttons, no rich formatting. For custom Block Kit messages, you need an HTTP Callout to a Slack webhook, which requires Named Credentials setup. If rich formatting matters, consider n8n instead.

How it works

  • Record-Triggered Flow fires automatically when an Opportunity's StageName field changes
  • Decision element (optional) filters for specific stages like Negotiation, Closed Won, or Closed Lost
  • Send Slack Message action (native) or HTTP Callout (custom formatting) delivers the alert to your Slack channel
  • $Record and $Record__Prior variables provide both current and previous field values for the message

Overview

Salesforce Record-Triggered Flows fire automatically when a record is created or updated. You'll create a flow that watches the Opportunity object for changes to the StageName field, then sends a Slack notification with the deal details and a link back to the record.

Record-Triggered Flows replace Workflow Rules and Process Builder

Salesforce retired Workflow Rules and Process Builder in December 2025. All new automations should use Record-Triggered Flows. If you have existing Process Builder automations sending Slack alerts, migrate them to flows.

Step 1: Create a new Record-Triggered Flow

Navigate to Setup → Flows → New Flow → Record-Triggered Flow.

Configure the trigger:

  • Object: Opportunity
  • Trigger the Flow When: A record is updated
  • Condition Requirements: All Conditions Are Met
  • Condition 1: StageName — Is Changed — True

Set When to Run the Flow for Updated Records to Only when a record is updated to meet the condition requirements.

This ensures the flow only fires when the StageName field actually changes, not on every Opportunity save.

Step 2: Add a Decision element (optional)

If you only want alerts for specific stage transitions, add a Decision element after the trigger:

  • Label: Check Stage
  • Outcome 1 — High-Value Stages:
    • StageName Equals Negotiation/Review
    • OR StageName Equals Closed Won
    • OR StageName Equals Closed Lost
  • Default Outcome: No alert needed

Route the High-Value Stages outcome to the Slack action. Route the default outcome to the end of the flow.

Skip this step if you want alerts for every stage change.

Step 3: Send a Slack notification

You have two options depending on your Slack setup.

Option A: Salesforce for Slack app (native action)

If your org has the Salesforce for Slack app installed:

  1. Add an Action element
  2. Search for Send Slack Message
  3. Configure:
    • Channel or DM: Enter your Slack channel ID (e.g., C0123456789)
    • Message: Use merge fields to build the message text

Example message:

🔄 Deal Stage Changed
{!Opportunity.Name} moved to {!Opportunity.StageName}
Amount: {!Opportunity.Amount}
Owner: {!Opportunity.Owner.Name}
View: {!Opportunity.Id}

Option B: HTTP Callout to Slack Incoming Webhook

For custom Block Kit formatting, use an HTTP Callout action:

  1. Go to Setup → Named Credentials and create a credential for your Slack webhook URL
  2. Go to Setup → External Services and register a new service pointing to the Slack webhook
  3. In your flow, add an Action element using the External Service callout

The HTTP body should be:

{
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "🔄 *Deal Stage Changed*\n*Acme Corp — Enterprise License* moved to *Negotiation/Review*\nAmount: $125,000\nOwner: Jane Smith"
      }
    },
    {
      "type": "context",
      "elements": [
        {
          "type": "mrkdwn",
          "text": "<https://yourorg.my.salesforce.com/006XXXXXXXXXXXXXXX|View in Salesforce>"
        }
      ]
    }
  ]
}

In Flow Builder, replace the hardcoded values with merge fields like {'{'}!Opportunity.Name{'}'} and {'{'}!Opportunity.StageName{'}'}.

Named Credentials keep secrets out of flows

Never hardcode a Slack webhook URL directly in a flow. Use Named Credentials so the URL is stored securely and can be rotated without editing the flow.

Step 4: Activate the flow

  1. Click Save and give your flow a name (e.g., "Opportunity Stage Change → Slack Alert")
  2. Click Activate
  3. Test by editing an Opportunity's stage in Salesforce and verifying the Slack message appears
Governor limits in bulk updates

Record-Triggered Flows fire per record in bulk operations (Data Loader, API batch updates). Salesforce enforces governor limits — up to 2,000 records per transaction. If you bulk-update thousands of opportunities, the flow executes for each one. Consider adding entry conditions to limit which records trigger alerts in bulk scenarios.

Troubleshooting

Common questions

Can I send Block Kit messages from Flow Builder?

Not with the native Send Slack Message action — it only supports plain text. For Block Kit formatting, use an HTTP Callout action pointed at a Slack Incoming Webhook. This requires setting up Named Credentials in Salesforce and building the JSON payload manually.

Will this flow fire during bulk data loads?

Yes. Record-Triggered Flows fire per record in bulk operations (Data Loader, API batch updates). Salesforce enforces governor limits — up to 2,000 records per transaction. If you bulk-update thousands of Opportunities, the flow executes for each one. Add entry conditions to limit which records trigger alerts in bulk scenarios.

Can I include the previous stage in the Slack message?

Yes. Use the $Record__Prior.StageName variable in Flow Builder to access the field value before the update. This lets you show "Discovery -> Negotiation" instead of just "Negotiation."

Cost

Record-Triggered Flows and the Salesforce for Slack app are included in Enterprise, Unlimited, and Developer editions at no additional cost.

Looking to scale your AI operations?

We build and optimize automation systems for mid-market businesses. Let's discuss the right approach for your team.