Quick overview
This workflow answers QA/QC compliance and non-conformance questions from a controlled GitHub knowledge base using Google Gemini, then classifies findings (Compliant/Observation/Minor/Major), logs an audit record to Google Sheets, and emails the QA team when escalation or manual review is required.
How it works
- Receives a user question via an n8n chat trigger and captures session metadata (query, session ID, timestamp, and source).
- Validates that the incoming query is present and long enough to be processed.
- Uses Google Gemini with a RAG agent to list approved QA/QC documents in a GitHub repository, retrieve the most relevant document text, and generate a structured, evidence-grounded assessment.
- Normalizes the structured result into fields such as classification, severity score, requirement violated, recommended action, escalation/CAPA flags, manual review flag, and source files.
- If the agent indicates insufficient evidence, it appends a “Pending Manual Review” record to Google Sheets and emails the QA team to review the case.
- Otherwise, it routes the result by classification, appends the decision to a Google Sheets audit log, and emails the QA team when escalation is required before marking the escalation as sent in the sheet.
Setup
- Add credentials for Google Gemini (Google AI) and ensure the selected model (models/gemini-3.5-flash-lite) is available in your account.
- Add GitHub access (or configure access to the public repo) and confirm the owner/repository/path point to your approved QA/QC knowledge base (fahimjilani/qa-qc-rag-knowledge-base in /docs).
- Add Google Sheets credentials, select the target spreadsheet and sheet, and ensure the sheet has columns matching the logged fields (for example Record_ID, Classification, Severity_Score, and Escalation_Status).
- Add Gmail credentials and update the recipient address ([email protected]) and any email wording to match your escalation and manual-review process.
- Enable the workflow and use the chat interface to submit QA/QC queries, then verify that logs and notifications are created as expected.