ADO Pull Request Review Reminder
Scheduled flow queries Azure DevOps for open PRs pending review longer than 24 hours. For each stale PR, sends a Teams DM to the assigned reviewer and a daily Outlook digest to the project lead listing all aging PRs with repo, title, age, and direct link.
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 demo cloud flow that monitors Azure DevOps pull request review queues using the Azure DevOps connector's HttpRequest action — a real connector call, not an inline fixture. The flow queries the ADO REST API for active pull requests, computes each PR's age using ticks-based arithmetic, filters for stale PRs exceeding a configurable hour threshold, then delivers an HTML digest email via Outlook and posts a summary alert to a Teams channel.
Use Case
Engineering teams lose velocity when pull requests sit idle in review queues. This flow automates the "stale PR" nudge by querying Azure DevOps for all active PRs, calculating their age in hours, and filtering those that exceed the configured threshold. The digest is sent to both email and Teams so project leads and developers stay aware of aging reviews. As a FlowLibs demo, the flow ships Off — turn it on after configuring the ADO connection, environment variables, and connection references for your tenant.
Flow Architecture
Recurrence
RecurrenceScheduled trigger — runs daily at 08:00 AM Eastern (US & Canada).
Init varAdoOrganization
Initialize variableString variable bound to the `flowlibs_AdoOrganization` env var.
Init varAdoProject
Initialize variableString variable bound to the `flowlibs_AdoProject` env var.
Init varDigestRecipientEmail
Initialize variableString variable bound to the `flowlibs_DigestRecipientEmail` env var.
Init varDigestSubjectPrefix
Initialize variableString variable bound to the `flowlibs_DigestSubjectPrefix` env var.
Init varAdminCcEmail
Initialize variableString variable bound to the `flowlibs_AdminCcEmail` env var.
Init varTeamsGroupId
Initialize variableString variable bound to the `flowlibs_TeamsGroupId` env var.
Init varTeamsChannelId
Initialize variableString variable bound to the `flowlibs_TeamsChannelId` env var.
Init varPrStaleThresholdHours
Initialize variableInteger variable cast from the string env var: `int(parameters('flowlibs_PrStaleThresholdHours'))`.
Get Active Pull Requests
Azure DevOps — HttpRequestSends `GET {project}/_apis/git/pullrequests?searchCriteria.status=active&api-version=7.0` to the ADO organization specified in `varAdoOrganization`.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_AdoOrganization | String | <configure> | Azure DevOps organization name (passed to ADO connector `account` param). Set to your ADO organization. |
| flowlibs_AdoProject | String | FlowLibsDemo | Target ADO project name for PR monitoring. |
| flowlibs_PrStaleThresholdHours | String | 24 | Age threshold (hours) before a PR is flagged as stale — cast to integer at runtime via `int()`. |
| flowlibs_DigestRecipientEmail | String | you@yourcompany.com | Primary recipient of the daily stale PR digest email. |
| flowlibs_DigestSubjectPrefix | String | [FlowLibs] | Subject line prefix for all FlowLibs notification emails. |
| flowlibs_AdminCcEmail | String | alerts@yourcompany.com | CC recipient for administrative visibility. |
| flowlibs_TeamsGroupId | String | <configure> | Microsoft Teams team ID (GUID) for channel posting. |
| flowlibs_TeamsChannelId | String | <configure> | Microsoft Teams channel ID for stale PR alerts. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Azure DevOps | shared_visualstudioteamservices | HttpRequest (Queries active pull requests from the ADO REST API via connector) |
| Office 365 Outlook | shared_office365 | SendEmailV2 (Sends HTML digest email with stale PR table) |
| Microsoft Teams | shared_teams | PostMessageToConversation (Posts summary alert to Teams channel via Flow bot) |
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 Recurrence trigger's frequency, interval, startTime, or timeZone.
- Adjust staleness threshold
- Update the flowlibs_PrStaleThresholdHours environment variable value. No flow edit required.
- Point at a different ADO org or project
- Update the flowlibs_AdoOrganization and flowlibs_AdoProject env vars.
- Change digest recipient
- Update the flowlibs_DigestRecipientEmail env var.
- Filter by repository
- Add &searchCriteria.repositoryId={repoGuid} to the ADO API URI in the Get Active Pull Requests action.
- Add reviewer-level DMs
- Insert a For Each loop after the Filter Array to iterate stale PRs and send individual Teams DMs to each reviewer's UPN from the parsed reviewers array.
- Add escalation tier
- Duplicate the If branch with a higher threshold (e.g., 72 hours) and post to a management channel.
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.01String-to-integer env var cast
Casts the string env var to an integer for numeric comparison.
EXPR.02ADO API URI construction
Builds the relative URI for the Azure DevOps active pull requests endpoint.
EXPR.03Compute PR age in hours (ticks)
Divides tick delta by 36,000,000,000 (ticks per hour) to get age in hours.
EXPR.04Filter stale PRs
Used inside the Filter array Query — keeps only PRs older than the configured threshold.
EXPR.05Check if stale PRs exist
Drives the If condition — only sends notifications when at least one stale PR was found.
EXPR.06Select PR summary fields
Field accessors used inside the Select action when building the digest rows.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.