Quick overview
This workflow runs every Friday to scan a Notion documentation database for pages not edited in 90+ days, marks them as “Needs review,” emails owners of critical stale docs via Gmail, and uses OpenAI to generate a prioritized weekly review plan that it posts to a Slack channel.
How it works
- Runs every Friday at 10:00 on a schedule.
- Retrieves all pages from a selected Notion database and calculates how many days it has been since each page was last edited, along with its title, URL, owner email, and importance.
- Filters the list to only documentation pages that have been untouched for 90 days or more.
- Updates each stale page in Notion by setting its Status to “Needs review.”
- Sends a Gmail email to the page owner when the stale document is marked as Critical and an owner email is present.
- Aggregates all stale documents and sends them to OpenAI to draft a short, risk-ranked weekly docs review plan.
- Posts the generated review plan to a specified Slack channel.
Setup
- Connect credentials for Notion, Gmail, OpenAI (Chat Model), and Slack.
- Select your target Notion database in the Notion “getAll” step and ensure it contains properties for Owner Email, Importance (Critical/Normal), and Status (including “Needs review”).
- Set the Slack channel (for example, #docs) where the weekly report should be posted.
- Confirm or adjust the staleness threshold (90 days) and the schedule time (Friday 10:00) to match your team’s cadence.