Contract Expiry Alert System
Monitors a SharePoint list of contracts and sends escalating alerts as expiry dates approach. 90-day, 60-day, 30-day, and weekly reminders go to contract owners and legal for renewal action.
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
Every morning at 9 AM, this flow scans a SharePoint contracts list for items with Status eq 'Active', calculates the number of days remaining until each contract's expiry date, and then routes a tiered set of alerts based on how close the contract is to expiring. Contracts hitting 90, 60, or 30 days out, the final week countdown (7 through 1 days), and the day-of expiry each trigger their own escalation message to the appropriate stakeholders. Once a contract reaches zero or fewer days remaining, its SharePoint status is updated to Expired so it no longer triggers active-contract alerts.
Use Case
Contract lifecycle management lives or dies by renewal lead time. When expiry dates are tracked manually in a SharePoint list or spreadsheet, it is easy to miss the 90-day window most legal teams want for renewal negotiations — and even easier to let weekly check-ins lapse until a contract has already expired. This flow gives the contracts team an automated, tiered reminder system that escalates from a polite 90-day heads-up to a daily countdown in the final week, ensuring owners, legal, and management always have time to act.
The flow is ideal for teams that:
- Operations and legal teams managing renewable vendor or customer contracts
- Centralizing contract expiry tracking in SharePoint
- Automating tiered escalation as expiry dates approach
- Reducing the risk of unintentional lapse or auto-renewal
- Giving management visibility on imminent expirations
- Auto-updating contract status when expiry passes
Flow Architecture
Recurrence — Daily, 9 AM
RecurrenceFires once per day at 9:00 to evaluate all active contracts.
Get Active Contracts
SharePoint Get ItemsReads the configured contracts list and filters with `Status eq 'Active'` so the rest of the flow only operates on contracts that are still in force.
Loop Through Contracts
Apply to EachFor each active contract: computes the days remaining until expiry using `dateDifference(utcNow(), item()?['ExpiryDate'])` in a Compose action, then evaluates the tiered alert logic below.
Send Tiered Alerts
Switch on days remainingSwitch with cases for 90 (advance notice to contract owner), 60 (reminder to owner + legal), 30 (urgent reminder to all stakeholders), 7/6/5/4/3/2/1 (daily countdown to owner + legal + management), and 0 (EXPIRED alert to all parties). Each case sends an Outlook email tailored to its escalation level.
If Days Remaining <= 0
If conditionAfter the alert switch, evaluates whether the contract has already passed its expiry date and flips the SharePoint status if so.
- SharePoint Update Item — Sets `Status` to `Expired` for the current contract so subsequent runs skip it.
Empty branch — no action.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_ContractsSiteUrl | String | <configure> | SharePoint site URL hosting the contracts list (e.g. `https://your-tenant.sharepoint.com/sites/Legal`). |
| flowlibs_ContractsListName | String | Contracts | Name (or GUID) of the SharePoint list that stores contract records, including `Status`, `ExpiryDate`, `Owner`, and `ContractName` columns. |
| flowlibs_LegalEmail | String | alerts@yourcompany.com | Distribution email for the legal team — receives the 60-day, 30-day, weekly countdown, and expired alerts. |
| flowlibs_ManagementEmail | String | alerts@yourcompany.com | Distribution email for management — looped in on the final-week countdown and expired alerts. |
| flowlibs_TeamsChannelId | String | <configure> | Optional Teams channel ID for adaptive-card countdown dashboards. Leave blank to skip Teams posts. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| SharePoint | shared_sharepointonline | GetItems (Read active contracts) UpdateItem (Flip status to Expired once days remaining reaches zero) |
| Office 365 Outlook | shared_office365 | SendEmailV2 (Send tiered alert emails to owner, legal, and management) |
| Microsoft Teams | shared_teams | PostMessageToChannelV3 (Optional adaptive-card countdown dashboard) |
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.
- Deploying to another environment
- Import the solution into the target environment, then set flowlibs_ContractsSiteUrl and flowlibs_ContractsListName to point at your contracts list, and flowlibs_LegalEmail / flowlibs_ManagementEmail to the relevant distribution lists. Verify the SharePoint list has Status, ExpiryDate, Owner, and ContractName columns, then turn the flow on.
- Add a Teams adaptive-card dashboard
- Use flowlibs_TeamsChannelId and add a Post adaptive card action to the loop so the team gets a live visual countdown of contracts entering each tier.
- Include contract value for prioritization
- Pull the ContractValue column into each alert message so legal can sequence renewals by dollar impact.
- Renewal workflow trigger
- Add a 'Renew' button to the alert email that posts to a child flow which clones the contract record into a renewal draft and assigns a task to the owner.
- Custom escalation tiers
- Adjust the Switch cases (e.g. add a 14-day reminder, or replace the daily countdown with every-other-day) to match your legal team's SLAs.
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.01Days until expiry
Inside the Apply to Each, returns the integer number of days between today and the contract's expiry date. The Switch action operates on this value.
EXPR.02Active contracts OData filter
OData filter passed to SharePoint Get Items so expired or cancelled contracts are skipped before the loop.
EXPR.03Has the contract expired?
Condition expression that decides whether to flip the SharePoint Status column to `Expired`.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.