Automate a weekly Salesforce pipeline report using Flow Builder

medium complexityCost: $0 (included)

Prerequisites

Prerequisites
  • Salesforce org with Flow Builder access (available in Enterprise, Performance, Unlimited, and Developer editions)
  • A Slack workspace with an Incoming Webhook URL configured
  • Admin or Customize Application permission in Salesforce

Overview

Salesforce Flow Builder lets you create a Scheduled Flow that runs every Monday, queries open Opportunities via a Get Records element, aggregates metrics using Collection variables, and sends the result to Slack via an HTTP Callout action. Everything stays inside Salesforce — no external tools needed.

Step 1: Create a Scheduled Flow

In Salesforce Setup, search for Flows and click New Flow. Select Schedule-Triggered Flow.

Set the schedule:

  • Start date: Next Monday
  • Frequency: Weekly
  • Day: Monday
  • Time: 8:00 AM (your team's timezone)

Step 2: Add a Get Records element for open Opportunities

Add a Get Records element to query open Opportunities:

  • Object: Opportunity
  • Conditions:
    • IsClosed equals false
    • CloseDate equals or after THIS_FISCAL_QUARTER (use a formula resource for dynamic dates)
  • Fields: Id, Name, Amount, StageName, CloseDate, OwnerId
  • Store: All records → in a Record Collection variable (varOpportunities)
  • Sort: Amount, Descending

Step 3: Loop and aggregate metrics

Add a Loop element to iterate through varOpportunities. Inside the loop, use Assignment elements to:

  1. Increment total pipeline value — add each Opportunity's Amount to a Number variable (varTotalPipeline)
  2. Count deals per stage — use a Collection variable (Text Collection) to track stage names and counts. For simplicity, use separate counter variables for each stage (e.g., varProspectingCount, varNegotiationCount)
  3. Count total deals — increment a counter variable (varDealCount)
Keep it simple with fixed stages

Flow Builder doesn't have native map/dictionary types. The easiest approach is to create one Number variable per pipeline stage (matching your actual stages) and increment the right one inside the Loop using Decision elements.

Step 4: Build the report text

After the Loop, add an Assignment element to compose a Text variable (varReportBody) with your metrics. Use a Text Template resource for cleaner formatting:

Weekly Pipeline Report
 
Total Pipeline: ${varTotalPipeline}
Active Deals: {!varDealCount}
 
Deals by Stage:
• Prospecting: {!varProspectingCount}
• Qualification: {!varQualificationCount}
• Proposal: {!varProposalCount}
• Negotiation: {!varNegotiationCount}
• Closed Won This Week: {!varClosedWonCount}
 
Average Deal Size: {!varAvgDealSize}

Step 5: Send to Slack via HTTP Callout

Add an Action element using an HTTP Callout (available in Spring '23+). Configure it as an External Service or use an Apex invocable action:

HTTP Callout setup:

  • Method: POST
  • URL: Your Slack Incoming Webhook URL
  • Content-Type: application/json
  • Body:
{
  "blocks": [
    {
      "type": "header",
      "text": {
        "type": "plain_text",
        "text": "Weekly Pipeline Report"
      }
    },
    {
      "type": "section",
      "fields": [
        {
          "type": "mrkdwn",
          "text": "*Total Pipeline*\n${varTotalPipeline}"
        },
        {
          "type": "mrkdwn",
          "text": "*Active Deals*\n${varDealCount}"
        }
      ]
    },
    {
      "type": "divider"
    },
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*Deals by Stage*\n${varStageBreakdown}"
      }
    },
    {
      "type": "context",
      "elements": [
        {
          "type": "mrkdwn",
          "text": "Report generated ${varReportDate}"
        }
      ]
    }
  ]
}
Alternative: Apex invocable action

If HTTP Callout isn't available in your org, create a simple Apex class with an @InvocableMethod annotation that accepts the report text and POSTs to the Slack webhook. Call it from the Flow as an Action element.

Step 6: Handle the Reports API alternative

If you already have a Salesforce report that shows your pipeline data, you can skip the Get Records + Loop approach entirely. Instead, use an HTTP Callout to execute the saved report:

GET /services/data/v64.0/analytics/reports/{reportId}

Parse the response in a Code-based Flow element or Apex action, then forward the results to Slack. This is especially useful for complex reports with cross-filters or custom report types that are hard to replicate in Flow.

Governor limits on Get Records

Scheduled Flows can process up to 250,000 records per batch, but each Get Records element returns a maximum of 2,000 records per transaction. If your pipeline has more than 2,000 open Opportunities, use the Reports API approach or an Apex action with a SOQL query that uses GROUP BY StageName to aggregate server-side.

Step 7: Test and activate

  1. Click Debug in Flow Builder and run the Flow manually
  2. Check each element's output — verify the Opportunity count and amounts are correct
  3. Confirm the Slack message arrives with proper formatting
  4. Click Activate to enable the weekly schedule

Cost

Salesforce Flows are included with your Salesforce license at no additional cost. Slack Incoming Webhooks are free.

Limitations

  • Flow Builder's lack of dictionary types makes dynamic stage aggregation verbose — you need one variable per stage
  • HTTP Callout formatting is limited compared to building JSON in code
  • For complex reports with calculated fields, the Reports API approach is more practical
  • Scheduled Flows run in system context — they query all Opportunities regardless of sharing rules (which is usually what you want for a team report)

Next steps

Once the basic report is running, consider:

  • Owner breakdown — add a second Loop that groups by OwnerId and includes a per-rep section in the Slack message
  • Week-over-week deltas — store last week's totals in a Custom Setting or Custom Metadata Type and calculate the change
  • Stale deal flag — add a Decision element inside the Loop to flag Opportunities with no activity in 14+ days

Need help implementing this?

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