Free workflow: monthly "stale docs" audit for a Google Drive folder (Drive → Code → Gemini → Gmail)

Hi all,

Here’s a small workflow we built as a companion to a Drive-based RAG setup. If a chatbot answers from your docs, old docs mean confidently wrong answers. So once a month this flags what hasn’t been touched in a while.

What it does

  1. Schedule trigger, 1st of the month at 09:00.
  2. Google Drive: lists the files directly inside one folder (fields: *, so modifiedTime comes back).
  3. Code node: drops sub-folders, keeps files older than DAYS (default 180), and sorts them oldest first. DAYS and LANGUAGE are at the top of the node.
  4. IF: stops here when nothing is stale, so you don’t get an empty e-mail every month.
  5. Basic LLM Chain + Gemini 2.5 Flash: groups the stale files by likely topic, flags up to 5 that look business-critical (policies, prices, procedures), and suggests obvious duplicates to archive. The model only gets file names, dates and links, never file contents.
  6. Gmail: sends that summary to the doc owner.

Setup

  • Credentials: Google Drive OAuth2, Gmail OAuth2, Google Gemini API.
  • Replace REPLACE_FOLDER_ID and REPLACE_OWNER_EMAIL.
  • Run it once manually, read the e-mail, then activate.

Honest limits

  • Only scans the top level of one folder (no recursion).
  • Lists 80 files max in the e-mail.
  • Import-tested on n8n 2.44.4 (self-hosted). The Code logic was tested with mock data, but it has not been run end-to-end against real Google accounts yet, so please try it on a test folder first. If something breaks on your version, post the error here and I’ll fix the JSON.

Workflow JSON

Where it comes from (disclosure)
This audit is one of 4 workflows in a paid pack we sell. The other 3 do the RAG part: a Drive indexer into Qdrant, a password-protected chat page, and a Slack bot that answers in threads with sources. If that’s useful to you, it’s here: Internal Docs Assistant – Google Drive RAG with Gemini or OpenAI – 4 n8n workflows (web chat + Slack bot) ($29). There’s also a 14-workflow bundle with a WhatsApp/Telegram support agent and a content pipeline. The audit above is free with no strings attached: no e-mail gate, use and modify it as you like.

Questions or improvement ideas welcome. Recursive folder scanning is the obvious next step.