{"product_id":"gmail-support-email-replies-with-openai-claude-n8n","title":"Gmail Support Email Replies with OpenAI \u0026 Claude (n8n)","description":"\u003ch3\u003eDrafts and quality-checks Gmail support replies with OpenAI \u0026amp; Claude—only sending when it’s confident\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow reads your latest knowledge base from Google Drive, understands incoming support emails, and automatically drafts Gmail responses using OpenRouter LLMs (OpenAI \u0026amp; Claude style models). It then runs a second “critic” quality check and sends replies \u003cstrong\u003eonly when citations and critic scores pass\u003c\/strong\u003e—otherwise it routes the ticket to a human reviewer with weekly metrics.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNightly knowledge sync:\u003c\/strong\u003e Lists files in a Google Drive folder and compares versions against a Postgres ingest ledger to ingest only new or changed documents.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eBuilds a vector knowledge base:\u003c\/strong\u003e Downloads changed files, deletes existing chunks for that document, splits text, generates \u003cstrong\u003eOpenAI embeddings\u003c\/strong\u003e, and stores vectors in \u003cstrong\u003epgvector\u003c\/strong\u003e with document metadata.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIngests support tickets:\u003c\/strong\u003e Triggers on new unread Gmail messages with a support label or receives helpdesk tickets via a \u003cstrong\u003eheader-authenticated webhook\u003c\/strong\u003e, normalizing into one ticket format.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePolicy + sensitive handling:\u003c\/strong\u003e Masks PII in the ticket body, classifies the request with an OpenRouter chat model, logs it to Postgres, and applies routing rules to drop noise, restrict sensitive categories, or allow auto-answering.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAuto-reply with citations:\u003c\/strong\u003e For eligible tickets, an OpenRouter drafting agent searches the pgvector knowledge base and generates a cited reply with confidence\/unsupported-claims metadata.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCritic-gated delivery:\u003c\/strong\u003e A second OpenRouter model critiques the draft; the workflow gates delivery using critic score\/verdict, drafter confidence, citation presence, and zero unsupported claims.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eSaaS support teams that want \u003cstrong\u003esafe, grounded Gmail auto-responses\u003c\/strong\u003e from a controlled knowledge base.\u003c\/li\u003e\n  \u003cli\u003eAutomation engineers implementing an \u003cstrong\u003eLLM + pgvector\u003c\/strong\u003e support assistant with human fallback.\u003c\/li\u003e\n  \u003cli\u003eTeams that need audit-friendly routing and \u003cstrong\u003eweekly metrics emailed\u003c\/strong\u003e to reviewers.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes\/tools:\u003c\/strong\u003e if, code, gmail, switch, webhook, postgres\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eKnowledge source:\u003c\/strong\u003e Google Drive → Postgres\/pgvector embeddings\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLLMs:\u003c\/strong\u003e OpenRouter chat models for classification, drafting, and criticism (OpenAI embeddings used for vectorization)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSafety checks:\u003c\/strong\u003e PII masking, citation requirement, critic score\/verdict gating, and unsupported-claims filtering\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45931092246707,"sku":"N8N-18957","price":42.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/x3OQ1ofQM2hV9bzOKlId8_o88ryPhP.png?v=1788254207","url":"https:\/\/buyflowscripts.com\/products\/gmail-support-email-replies-with-openai-claude-n8n","provider":"N8N Commerce","version":"1.0","type":"link"}