Stale PR Reminder
Weekly schedule lists all open PRs older than 7 days, emails each author a personalized Outlook reminder, and CCs the requested reviewer to unblock merges.
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
FlowLibs - Stale PR Reminder is a weekly scheduled cloud flow that hunts down neglected pull requests in a GitHub repository and nudges the author (with a CC to a dev-leads distribution list) so review queues keep flowing instead of piling up.
Every Monday at 8:00 AM Eastern the flow lists all open pull requests for a configured {owner}/{repo}, filters down to those whose updated_at timestamp is older than a configurable day threshold, and sends a personalized HTML email to each stale-PR author at {login}@{domain} with a summary of the PR and a polite ask to rebase or push updates.
Use Case
Engineering teams lose momentum when PRs sit open for weeks with no activity — reviewers forget context, branches drift behind main, and merge conflicts compound. Rather than relying on chat nudges or a human playing review-queue traffic cop, this flow automates the courtesy reminder on a predictable weekly cadence. The reminder is personalized, which makes it feel less like spam and more like a helpful heads-up.
The flow is ideal for teams that:
- Teams with persistent open-PR backlogs and no formal review SLA.
- Need visibility for dev leads without forcing them to scrape GitHub by hand.
- Want personalized reminders rather than a generic team broadcast.
- Already use Outlook for engineering communications.
Flow Architecture
Weekly Schedule Monday 8am
RecurrenceFires every Monday at 8:00 AM Eastern Standard Time.
Init 6 variables
InitializeVariablevarGitHubOwner, varGitHubRepository, varStalePrDaysThreshold, varPrReminderCcEmail, varPrAuthorEmailDomain, varStaleCutoffUtc — all from env vars except the cutoff which is computed.
Get Open Pull Requests
GitHub GetPullRequestsLists all open PRs in the target repo sorted by updated ascending, 100 per page.
For Each Pull Request
Apply to eachIterates every open PR and runs the staleness check.
Check If Pull Request Is Stale
If conditionEvaluates updated_at < varStaleCutoffUtc.
- Send Stale PR Reminder Email — Outlook SendEmailV2 with a personalized HTML reminder to the author and a CC to dev-leads.
Empty branch — no email is sent.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_GitHubOwner | String | your-org | GitHub Owner. |
| flowlibs_GitHubRepository | String | flowlibs-demo | GitHub Repository. |
| flowlibs_StalePrDaysThreshold | String | 7 | Days a PR may sit before it is considered stale (cast to int). |
| flowlibs_PrReminderCcEmail | String | devleads@yourcompany.com | PR Reminder CC Email. |
| flowlibs_PrAuthorEmailDomain | String | your-org.com | PR Author Email Domain — used to build {login}@{domain}. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| GitHub | shared_github | GetPullRequests |
| Office 365 Outlook | shared_office365 | SendEmailV2 (personalized HTML reminders) |
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 target repo
- Update flowlibs_GitHubOwner and flowlibs_GitHubRepository env vars.
- Adjust staleness threshold
- Update flowlibs_StalePrDaysThreshold (e.g. 3 for aggressive, 14 for lenient).
- Route CC to a different list
- Update flowlibs_PrReminderCcEmail to any single address or semicolon-separated list.
- Change email domain for author resolution
- Update flowlibs_PrAuthorEmailDomain. For non-aligned domains, replace with an Office 365 Users SearchUser lookup.
- Change schedule
- Modify the trigger recurrence (daily, twice-weekly, different time zone).
- Scale beyond 100 PRs
- Wrap GetPullRequests in a Do-Until loop incrementing the page query parameter until the response is empty.
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.01Stale cutoff computation
Runs once at flow start; used inside the For Each.
EXPR.02Staleness check
Drives the per-PR If condition.
EXPR.03Author email resolution
Maps GitHub login → {login}@{domain}.
EXPR.04Email subject
Personalizes the reminder with PR number.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.