Out-of-Office Reviewer Removal
Each morning reads Outlook automatic replies for all reviewers; if a reviewer is OOO, calls Remove Requested Reviewer on their pending PRs and reassigns their backup based on a SharePoint mapping.
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 - Out-of-Office Reviewer Removal is a scheduled Power Automate Cloud Flow that automatically re-routes GitHub code review assignments whenever a primary reviewer has an active Outlook out-of-office (automatic reply) message. Every morning at 09:00 UTC, the flow reads a SharePoint list that maps primary reviewers to backup reviewers, checks each primary reviewer's Outlook mailbox for an active auto-reply, and — if the reviewer is OOO — removes them as the requested reviewer on all their open pull requests and requests a review from the pre-configured backup reviewer in their place.
Use Case
Engineering teams pay a tax every time a reviewer goes on vacation: the PRs assigned to them sit untouched in the review queue until somebody manually reassigns the work. This flow eliminates that manual intervention by treating Outlook's automatic-reply status as the source of truth for reviewer availability and pairing it with a static backup mapping that each reviewer pre-registers in SharePoint.
The flow is ideal for teams that:
- Engineering teams using GitHub PR reviews and Outlook automatic-reply for OOO.
- Teams that pre-register a backup reviewer per primary reviewer in SharePoint.
- Want PR throughput preserved during holiday and conference periods.
- Need an audit log of reassignments emailed to an IT admin daily.
Flow Architecture
Recurrence_Daily_At_9AM_UTC
RecurrenceDaily run, 09:00 UTC.
Init 6 scratch variables
InitializeVariablevarSharePointSiteUrl, varOOOReviewerListTitle, varGitHubOrgOrUser, varNotificationSenderEmail, varITAdminEmail, varReassignmentLog (empty string accumulator).
Get_Reviewer_Backup_Mapping_From_SharePoint
SharePoint GetItemsFilters by IsActive eq 1, returns up to 200 rows of primary→backup reviewer mappings.
Apply to each Reviewer / Check_If_Reviewer_Is_OOO
Foreach + IfPer-reviewer: Get_MailTips_For_Reviewer (automaticReplies). If OOO message has any content, the reviewer is considered out.
- Search_For_Open_Pull_Requests_Requesting_Review — GitHub SearchIssues with `is:pr is:open review-requested:{login} user:{org}`.
- Apply to each Pending PR — Inner Foreach: RemoveReviewersPullRequest (primary), RequestReviewersPullRequest (backup), append HTML log entry.
- Notify_Backup_Reviewer_Of_New_Assignments — Outlook SendEmailV2 to the backup with the count of pending PRs and a queue link.
Empty branch — no reassignment is performed.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_SharePointSiteURL | String | — | Root SharePoint site URL where FlowLibs demo lists live. |
| flowlibs_OOOReviewerListTitle | String | OOOReviewerMapping | Title of the SharePoint list mapping primary reviewers to backups. |
| flowlibs_GitHubOrgOrUser | String | — | GitHub owner whose PRs the flow manages. |
| flowlibs_NotificationSenderEmail | String | — | Mailbox used to send OOO backup notifications. |
| flowlibs_ITAdminEmail | String | — | Administrator mailbox for the daily reassignment summary. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| SharePoint | shared_sharepointonline | GetItems (reads the OOO mapping list) |
| Office 365 Outlook | shared_office365 | GetMailTips_V2 (automaticReplies probe) SendEmailV2 (backup notification + IT admin daily summary) |
| GitHub | shared_github | SearchIssues RemoveReviewersPullRequest RequestReviewersPullRequest |
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.
- SharePoint list schema
- Create OOOReviewerMapping with Title, PrimaryReviewerEmail/Login/Name, BackupReviewerEmail/Login/Name, IsActive (1/0).
- Change the schedule
- Edit the Recurrence trigger. frequency=Hour, interval=4 gives 4-hour polling for faster reassignment during peak PR hours.
- Filter to specific repos
- Modify the SearchIssues q to include repo:org/repo-a repo:org/repo-b or team-review-requested:@org/team-name.
- Expand to Microsoft Teams
- Replace the backup notification action with shared_teams/PostMessageToChannel to ping an on-call channel.
- Multi-level fallback
- Add a TertiaryReviewer* column set and chain a second MailTips check inside the If branch.
- Suppress self-OOO
- Filter out PRs whose author equals the primary reviewer login so authors don't lose their own review on their own PRs.
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.01MailTips OOO detection
Coalesce-guards the optional automaticReplies.message path.
EXPR.02Server-side PR search
Builds the GitHub Search Issues qualifier per iteration, scoped to the current owner.
EXPR.03Repo name extraction from API URL
Peels the repo slug from the PR's repository_url.
EXPR.04Summary log fallback
Guarantees the admin email is never silently empty.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.