Opportunity Stage Change Pipeline Notifier
Polls Salesforce for opportunities whose stage changed in the last hour, posts a formatted pipeline update to a Teams sales channel showing deal name, old stage to new stage, amount, and close date.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
The Opportunity Stage Change Pipeline Notifier keeps sales teams and executives in lockstep with pipeline movement without requiring them to live inside Salesforce. On a recurring schedule (hourly), the flow queries Salesforce for opportunities whose stage changed within the last hour, formats a digest message for each one, and posts it to a designated Microsoft Teams sales channel. Each post highlights the deal name, the stage transition (old stage to new stage), the deal amount, and the expected close date so that anyone scanning the channel can see momentum at a glance.
The flow uses a scheduled trigger, a Salesforce records query, and a Teams post action. It is built to be configuration-driven via environment variables: the target Teams group and channel, the Salesforce stage-change lookback window, and the message template are all surfaced as settings so the same solution can be re-targeted at a different region, team, or sandbox tenant without editing the flow.
Use Case
Sales leaders frequently want a real-time pulse on pipeline movement but do not want to give every executive a Salesforce seat or train them to build dashboards. Posting stage transitions into a Teams channel meets people where they already collaborate, surfaces deals that have advanced (or slipped) in the last hour, and gives sales managers a low-friction prompt to congratulate reps or jump on at-risk opportunities. The flow also reduces noise from Salesforce-native notifications by consolidating multiple updates into a single hourly stream.
The flow is ideal for teams that:
- Sales teams that want lightweight pipeline visibility inside Microsoft Teams
- Executives who track deal momentum but do not work directly in Salesforce day-to-day
- Revenue operations groups that need a consolidated, low-noise stream of stage changes
- Organizations standardizing on Teams as the sales war-room collaboration surface
Flow Architecture
Recurrence
RecurrenceRuns every hour to check for recently-changed opportunities. Frequency and time zone are configurable on the trigger.
Compute lookback window
Initialize variableInitializes a varLookbackUtc string variable to addHours(utcNow(), -1) so the Salesforce query only returns opportunities whose stage changed in the last hour.
Get changed opportunities
Get records (Salesforce)Queries the Salesforce Opportunity object filtered by LastModifiedDate greater than or equal to the lookback variable and StageName changed. Returns deal name, old stage, new stage, amount, and close date for each hit.
If any opportunities changed
If conditionChecks whether the Salesforce query returned at least one record before posting to Teams.
- For each opportunity — Iterates the Salesforce records collection so every changed opportunity gets its own Teams post.
- Post message in chat or channel — Sends a formatted message to the configured Teams sales channel including deal name, old stage to new stage transition, amount (formatted as currency), and close date.
Empty branch - no action.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_TeamsGroupId | String | <configure> | Microsoft Teams group (team) ID that hosts the sales pipeline channel. |
| flowlibs_TeamsChannelId | String | <configure> | Channel ID inside the Teams group where stage-change updates should be posted. |
| flowlibs_LookbackHours | Number | 1 | Number of hours back from the current run time to look for Salesforce stage changes. Should match the recurrence frequency. |
| flowlibs_SalesforceOpportunityView | String | <configure> | Optional Salesforce list view or SOQL filter name used to scope which opportunities are eligible for notification (e.g. AllOpenOpps). |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Salesforce | shared_salesforce | GetOpportunityRecords (queries opportunities filtered by LastModifiedDate and stage change) |
| Microsoft Teams | shared_teams | PostMessageToChannelV3 (posts the formatted stage-change update to the sales channel) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Adjust the lookback window to match your run cadence
- If you change the recurrence from hourly to every 15 minutes or to daily, update flowlibs_LookbackHours (or convert it to minutes) so the Salesforce query window aligns with the run frequency. Mismatched values cause either duplicate notifications or missed stage changes.
- Filter to specific stages or deal sizes
- Extend the Salesforce Get records filter to only fire on material moves (for example, transitions into Closed Won or Closed Lost, or opportunities above a minimum amount) to keep the Teams channel signal-to-noise high.
- Route different segments to different channels
- Promote the target channel to a lookup keyed on Salesforce region, business unit, or owner. Replace flowlibs_TeamsChannelId with a switch or a SharePoint config list so enterprise, mid-market, and SMB pipelines each land in their own channel.
- Add an adaptive card with deep links
- Swap the plain Teams post for an adaptive card that includes a 'Open in Salesforce' button (https://your-tenant.lightning.force.com/lightning/r/Opportunity/<Id>/view). This shortens the click path for managers who want to inspect the deal.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Hourly lookback window
Computes the UTC timestamp used to filter the Salesforce Opportunity query so only stage changes inside the lookback window are returned.
EXPR.02Format opportunity amount as currency
Formats the Salesforce Amount field as a whole-dollar currency string (e.g. $125,000) for the Teams message.
EXPR.03Format close date
Formats the Salesforce CloseDate as a friendly month-day-year string in the Teams post.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.