
This workflow demonstrates how to automatically generate and host a premium, interactive human-in-the-loop email approval dashboard using CustomJS and OpenAI.
Instead of letting an AI reply to emails fully autonomously (which is highly risky) or copy-pasting drafts manually, this workflow fetches unread emails, uses AI to draft reply suggestions, and compiles them into a beautiful inbox-style dashboard. The dashboard is hosted instantly on CustomJS, allowing you to review, edit, and send the replies with a single click.
The result is a secure, production-ready feedback loop that ensures absolute human quality control over automated AI interactions.
Fully autonomous AI agents can hallucinate or send incorrect details to clients. However, manually building a dashboard interface to review AI draft suggestions requires setting up hosting, databases, and authentication, which is overkill for simple automation.
This workflow solves this by utilizing CustomJS as a static file server to host a single-page app (SPA) built with Tailwind CSS and Alpine.js. The entire "inbox" dashboard is generated on-the-fly and hosted instantly. Once you review or edit a draft and click "Approve & Send", the dashboard sends the approval back to n8n via a webhook, which handles the final email dispatch and archives the thread.
no-reply@ addresses from the queue.Human-in-the-Loop Control
Keep final approval of all outgoing correspondence. Review and edit drafts before they are sent.
Inbox-Style UI Sidebar
A modern dark-mode interface built with Tailwind CSS and Alpine.js. It features a responsive sidebar containing all pending emails, dynamic search, and a side-by-side view comparing the original inquiry with the editable AI draft.
Instant CustomJS Hosting
Deploys the static HTML dashboard immediately, eliminating the need to set up Vercel, Netlify, or custom web servers.
Threaded Gmail Responses
Approved emails are sent as threaded replies to the original message, preserving email thread integrity for the recipient.
Auto-Clean/Archive
Once sent, the email is marked as read in Gmail so it drops off the dashboard on the next run.
no-reply and notification addresses.To deploy this workflow, complete the following setup steps:
Open the Build Approval Page Code node. Locate line 22 (or the configuration section) and update the N8N_BASE_URL with your n8n instance's URL:
// ⚙️ CONFIGURE: Set your n8n instance base URL here.
const N8N_BASE_URL = "https://your-n8n-instance.com";