CloudEmail & Graph APIScheduled

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.

Members OnlySign in or create a free account to download this solution.

Overview

Weekly scheduled flow that hunts down neglected pull requests in a GitHub repository and nudges the author (with CC to a dev-leads list) so review queues keep flowing instead of piling up. Every Monday at 8:00 AM Eastern lists all open PRs, filters down to those whose updated_at is older than the configurable day threshold, and sends a personalized HTML email with PR summary and a polite rebase/update ask.

**State:** Stopped (Off, demo)

Use Case

Engineering teams lose momentum when PRs sit open for weeks with no activity — reviewers forget context, branches drift behind main, merge conflicts compound. Rather than relying on chat nudges, this flow automates the courtesy reminder on a predictable weekly cadence.

**Key Benefits:** personalized (author name, specific PR, exact days stale) feels less like spam; dev leads CC for visibility/escalation.

Flow Architecture

Trigger: **Weekly Schedule Monday 8am** (Recurrence).

1. Init 6 vars (owner, repo, threshold, CC, author domain, stale cutoff = `addDays(utcNow(), -threshold)`)
2. **Get Open Pull Requests** (GitHub GetPullRequests sorted by updated asc, per_page=100)
3. **For Each Pull Request**
   - Check If Pull Request Is Stale (If: `updated_at < varStaleCutoffUtc`)
   - Send Stale PR Reminder Email (Outlook SendEmailV2 with author CC dev-leads)

Environment Variables

VariableSchema NameTypeDefaultPurpose
GitHub Ownerflowlibs_GitHubOwnerStringaronhomelabGitHub owner
GitHub Repositoryflowlibs_GitHubRepositoryStringflowlibs-demoRepository name
Stale PR Days Thresholdflowlibs_StalePrDaysThresholdString7Days threshold (cast to int)
PR Reminder CC Emailflowlibs_PrReminderCcEmailStringdevleads@aronco.comCC for reminder emails
PR Author Email Domainflowlibs_PrAuthorEmailDomainStringaronhomelab.comDomain for resolving GitHub login → email

Connectors & Connections

ConnectorAPI NameConnection FormatUsage
GitHubshared_githubb2585b1b8da6406cbb41ba7c48f66af5GetPullRequests — lists open PRs
Office 365 Outlookshared_office365shared-office365-ab123aff-...SendEmailV2 — personalized reminder

Customization Guide

1. Set 5 env vars (owner, repo, threshold, CC, author domain).
2. Update connection refs (GitHub PAT, Outlook).
3. Turn on.

**Common Modifications:** adjust threshold (3 = aggressive, 14 = lenient); route CC to different list; replace email domain mapping with Office 365 Users SearchUser; change schedule (timezone, weekDays); scale beyond 100 PRs via Do-Until + page increment.

Key Expressions

- addDays(utcNow(), mul(-1, variables('varStalePrDaysThreshold'))) — stale cutoff
- less(items('For_Each_Pull_Request')?['updated_at'], variables('varStaleCutoffUtc')) — staleness check
- concat(items('For_Each_Pull_Request')?['user']?['login'], '@', variables('varPrAuthorEmailDomain')) — author email resolution