Skip to content
FlowHubFluxonLab
C
AI Automationfree

Host an AI Gmail reply approval inbox with OpenAI and CustomJS

by CustomJSadapted from n8n official workflow galleryUpdated Aug 2026
RequiresCCodeGmailGmailOpenAI
Share Post Share
MaWhen clicking 'Execute workflow'When clicking '…PTUpsert Approval PageUpsert Approval…Get many messagesGet many messag…WeWebhook - Receive ApprovalWebhook - Recei…CoExtract Reply DataExtract Reply D…CoFilter No Reply EmailsFilter No Reply…Generate AI Draft ReplyGenerate AI Dra…CoFormat Email DraftsFormat Email Dr…CoBuild Approval PageBuild Approval …Reply to a messageReply to a mess…Mark a message as readMark a message …123456
1/5
FLOWS
STEPS · 6
Run manually by an operator

Quick overview Build super flexible and customizable Human-in-the-Loop (HITL) processes with n8n and CustomJS. Instead of letting AI reply autonomously, this workflow fetches data, drafts responses, and hosts interactive approval pages via CustomJS—ensuring full human quality control over your automations with optional custom domain hosting. How it works Trigger: Set to run manually (or scheduled on a cron job). Fetch Emails: Pulls unread messages from your Gmail inbox. Filter: Discards standard no-reply and notification addresses. AI Generation: OpenAI analyzes the email text and subject line to write a suggested reply. Build Dashboard: A Code node merges the dataset into a premium HTML template. Upsert Page: The CustomJS node hosts the generated HTML instantly. Setup Configure the Base URL: Open the Build Approval Page Code node, locate the configuration section (around line 22), and replace the placeholder with your actual n8n instance URL: Connect CustomJS: Add your CustomJS API token to your n8n to allow the workflow to automatically push and host the generated process pages.

Tags

n8nreference-onlygmailopen-ai
Connects
CCodegmailGmailOpenAI
CategoryAI Automation
Triggermanual
Complexitycomplex
Nodes11
AddedMay 20, 2026

Related workflows

See all AI Automation
ACDgmail
free

AI: Summarize podcast episode and enhance using Wikipedia

The workflow automates the process of creating a summarized and enriched podcast digest, which is then sent via email. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by n8n Team
Cgmailgoogledrive
free

Extract and validate invoice data from Google Drive using OCR.Space, Gemini, and Google Sheets

Quick overview This workflow monitors a Google Drive folder for newly uploaded invoice files, extracts text with OCR.Space, uses Google Gemini to convert the OCR text into structured invoice fields, validates required values, then stores results in Google Sheets and sends Gmail notifications for success or manual review. How it works Triggers when a new file is created in a specified Google Drive folder. Downloads the uploaded invoice file from Google Drive and checks that the MIME type is PDF, JPG, JPEG, or PNG. Sends the file to the OCR.Space API to extract the invoice text and stops if OCR reports a processing error. Uses Google Gemini to convert the OCR text into structured JSON containing supplier, invoice metadata, amounts, currency, and line items. Validates and normalizes the extracted fields, flags missing required values, and marks the record for manual review when needed. If manual review is required, sends a Gmail alert listing missing fields; otherwise, appends key invoice fields to Google Sheets and sends a Gmail confirmation email. Setup Connect Google Drive OAuth2 credentials and set the folder ID to watch for invoice uploads. Provide an OCR.Space API key and ensure

by WeblineIndia
ACgmailsheets
free

Recommend supplier consolidation with Google Sheets, Groq, Slack and Gmail

Quick overview This workflow runs weekly to read supplier spend data from Google Sheets, detect overlapping suppliers across departments, estimate potential consolidation savings, and use Groq-hosted LLM analysis to assess risk and produce recommendations that are sent to Slack and emailed via Gmail. How it works Runs every week on a scheduled trigger. Reads supplier records from a Google Sheets spreadsheet and keeps key fields like supplier name, department, spend, risk rating, and stakeholder email. Groups and normalizes supplier names to find suppliers used by multiple departments and calculates estimated savings and an opportunity level. Sends each consolidation opportunity to a Groq chat model to evaluate risk versus savings and return a JSON decision and recommendation. Parses the AI JSON output, merges it with the calculated savings data, and formats a final recommendation record. Posts the recommendation to a Slack channel and emails a formatted report to the supplier stakeholder email address. Setup Connect your Google Sheets OAuth account and update the spreadsheet ID and sheet/tab to match your supplier records. Add a Groq API credential for the chat model used to evalua

by WeblineIndia