At-Risk Deal Escalation Flow
Daily flow identifies Salesforce opportunities past their close date or stalled in the same stage for 30+ days, escalates to sales managers via Teams alert and sends the rep a coaching email with suggested next steps.
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
A scheduled Power Automate Cloud Flow that runs every weekday morning to identify at-risk Salesforce opportunities, send each deal owner a coaching email with suggested next steps, post an escalation notice to a sales Teams channel for every flagged deal, and send the sales manager a daily summary email.
Use Case
Revenue leaders lose visibility into deals that are silently slipping — opportunities that blew past their close date or have been frozen in the same stage for weeks. By the time a sales rep realizes a deal needs intervention, the competitive window is often closed. This flow acts as a daily early-warning system that escalates at-risk opportunities before they are lost.
For every flagged deal, the owner receives a coaching email suggesting a decision-maker call within 48 hours, the sales manager channel gets a Teams post with full deal context, and the manager receives a consolidated daily summary email.
The flow is ideal for teams that:
- Opportunity is not closed (IsClosed = false)
- AND (CloseDate is in the past OR LastModifiedDate is older than the configurable stagnation threshold in days)
Flow Architecture
Run Daily At 8AM EST
RecurrenceRecurrence trigger — fires daily at 8:00 AM Eastern Standard Time to kick off the at-risk deal sweep.
Init varStagnantDaysThreshold
Initialize variableReads the flowlibs_AtRiskStagnantDaysThreshold environment variable (default "30") into a string variable for use in the SOQL cutoff calculation.
Init varFallbackCoachEmail
Initialize variableReads flowlibs_SalesFallbackCoachEmail so opportunities whose Owner has no email still receive coaching outreach.
Init varTeamsGroupId
Initialize variableReads flowlibs_TeamsGroupId — the GroupId of the Teams team that hosts the escalation channel.
Init varTeamsChannelId
Initialize variableReads flowlibs_TeamsChannelId — the ChannelId of the escalation channel within the Teams team.
Init varSalesManagerEmail
Initialize variableReads flowlibs_SalesAlertRecipientEmail — the recipient of the daily manager summary email.
Compose Stagnation Cutoff ISO
ComposeComputes the SOQL-compatible cutoff timestamp: formatDateTime(addDays(utcNow(), mul(int(varStagnantDaysThreshold), -1)), 'yyyy-MM-ddTHH:mm:ssZ').
Compose SOQL Query
ComposeBuilds the Salesforce query string: SELECT Id, Name, Amount, CloseDate, StageName, LastModifiedDate, Owner.Email, Owner.Name FROM Opportunity WHERE IsClosed = false AND (CloseDate < TODAY OR LastModifiedDate < <cutoff>) ORDER BY CloseDate ASC LIMIT 100.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_AtRiskStagnantDaysThreshold | String | 30 | Number of days an opportunity can remain in the same stage before being flagged as stagnant. |
| flowlibs_SalesFallbackCoachEmail | String | alerts@yourcompany.com | Fallback coaching recipient used when the opportunity Owner.Email is empty. |
| flowlibs_TeamsGroupId | String | <configure> | GroupId of the Microsoft Teams team that hosts the escalation channel. |
| flowlibs_TeamsChannelId | String | <configure> | ChannelId of the escalation channel within the Teams team. |
| flowlibs_SalesAlertRecipientEmail | String | <configure> | Email address that receives the daily manager summary of flagged deals. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Salesforce | shared_salesforce | ExecuteSOQLQuery (Query opportunities via SOQL) |
| Office 365 Outlook | shared_office365 | SendEmailV2 (Coaching emails + manager summary) |
| Microsoft Teams | shared_teams | PostMessageToConversation (Post escalation notices to a 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.
- Change the schedule
- Edit the Run Daily At 8AM EST trigger. To switch to a weekday-only cadence, add a weekDays array such as ["Monday","Tuesday","Wednesday","Thursday","Friday"] to the recurrence schedule. To run at a different hour, edit the hours array.
- Adjust the stagnation window
- Change the value of flowlibs_AtRiskStagnantDaysThreshold in the solution. No flow edits needed.
- Target different Salesforce stages
- Add AND StageName IN ('Negotiation','Proposal') to the SOQL in the Compose SOQL Query action to restrict escalation to specific stages.
- Include amount filter
- Append AND Amount >= 10000 to the SOQL to skip low-value deals from escalation noise.
- Redirect coaching emails
- Update flowlibs_SalesFallbackCoachEmail to change where deals with missing owner emails are routed. To always route through a sales-ops mailbox regardless of owner email, replace the coalesce(...) expression in Send Coaching Email To Owner with just @variables('varFallbackCoachEmail').
- Move to a different Teams channel
- Update flowlibs_TeamsGroupId and flowlibs_TeamsChannelId — no flow edits required.
- Extend the summary email
- Replace the summary body with an HTML table by piping the opportunity array through a Select + Create HTML Table pattern before the summary action.
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.01Stagnation cutoff timestamp
Computes the SOQL-compatible cutoff timestamp by subtracting the stagnation-threshold days from now.
EXPR.02Escalation reason classification
Classifies each flagged opportunity as Past Close Date vs Stage Stagnation for the coaching email and Teams post.
EXPR.03Owner email with fallback
Sends coaching email to the opportunity owner, falling back to the configured fallback address when Owner.Email is empty.
EXPR.04Owner name with fallback
Greets the owner by name in the coaching email, with a friendly default when the name is missing.
EXPR.05Deal count for summary subject
Counts the records returned by the SOQL query for use in the manager summary subject line.
EXPR.06Human-readable summary date
Formats the run date as e.g. 'Wednesday, May 7, 2026' for the manager summary header.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.