Quick Overview
This workflow monitors a Google Drive folder for new SOP Google Docs, uses Google Gemini to draft a training checklist and multiple-choice quiz, then sends the draft for approval via Gmail and records approval decisions in Google Sheets.
How it works
- Triggers when a new file is created in a specific Google Drive folder.
- Retrieves the SOP text from Google Docs, validates that it is present and meets the minimum length, and emails the reviewer via Gmail if the SOP is invalid.
- Sends the SOP to Google Gemini to generate a draft checklist and a multiple-choice quiz in the configured language.
- Validates Gemini’s JSON output (checklist length, question structure, and evidence quotes that must exist verbatim in the SOP) and emails the reviewer via Gmail if the draft fails validation.
- Checks Google Sheets for an existing review record for the same document ID and skips saving if a prior decision or pending review already exists.
- Saves valid drafts to a Google Sheets review tab, emails the reviewer a formatted approval request via Gmail with Approve/Reject actions, and updates the same sheet row with Approved, Rejected, or Timed out after 7 days.
Setup
- Connect credentials for Google Drive, Google Docs, Google Sheets, Gmail, and Google Gemini.
- Set the Google Drive folder ID to watch and ensure it contains Google Docs SOPs.
- Create or select a Google Sheets spreadsheet and a tab (for example, “Training Reviews”) with columns for documentId, documentName, createdTime, draftCreatedAt, outputLanguage, checklist, questions, reviewStatus, reviewerEmail, reviewedAt, reviewDecision, and reviewNotes.
- In the configuration values, set your spreadsheet ID, sheet name, reviewer email address, output language, minimum SOP length, and desired question count.
- If self-hosting n8n, set WEBHOOK_URL (or the equivalent public URL settings) so the Gmail approval links can route back to your n8n instance.