Verify email content against Google Sheets and Gmail logs
How it works
Input: Google Sheets provides “Expected Content” rows (one per block/section). HTML Parse:** A JS/HTML step extracts Actual Content from the email’s HTML (from Gmail or any provided HTML source). Merge:** Expected and Actual items are merged into aligned pairs for comparison. Compare:** A JS node compares strings and produces a Result (Pass/Fail). (This flow intentionally stops at the result and does not compute a mismatch reason.) Log:** The workflow writes back “Actual Content” + “Result” to Google Sheets for reporting.
Setup steps
Google Sheets** Create a sheet with columns: SectionId, ExpectedContent, ActualContent, Result. Populate SectionId + ExpectedContent for each content block you want to verify. Email HTML source** Use a Gmail node to pull message HTML or use HTTP Request/Read Binary File + HTML/JS to supply the HTML. Extraction logic (JS/HTML)** Implement selectors/XPaths/DOM parsing for each SectionId to extract Actual Content. Normalize whitespace and trim HTML entities for a fair comparison. Merge & Compare** Merge on SectionId to align Expected ↔ Actual. In the Code (JS) node, compare strings and set Result to Pass if equal (or meets your rule), otherwise Fail. Write back** Use Google Sheets to update ActualContent and Result for each row.
Requirements
n8n with access to: Google Sheets, Code/HTML, and (optionally) Gmail nodes. A Google Sheets document with at least these columns:
SectionId (or Key) ExpectedContent ActualContent (output) Result (output: Pass/Fail)
Access to the email HTML (Gmail node, HTTP fetch, or paste‑in).
Related Templates
Automatic News Summarization & Email Digest with GPT-4, NewsAPI and Gmail
📰 AI News Digest Agent: Auto News Summarizer & Email Newsletter Create an intelligent news curation system that automat...
Generate Food Recipes from Gmail & Form Requests with Ollama & Llama 3.2
This n8n template demonstrates how to create an intelligent food recipe assistant that accepts requests via Gmail and we...
Auto-classify Gmail emails with AI and apply labels for inbox organization
Who is this for? Professionals and individuals who receive high volumes of emails, those who want to automatically organ...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments