{"product_id":"replay-safe-gmail-drafts-from-webhook-batches-n8n","title":"Replay-Safe Gmail Drafts from Webhook Batches (n8n)","description":"\u003ch3\u003eReplay-safe Gmail drafts generated from webhook batches—without ever sending\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow validates an authenticated multi-client report batch, renders deterministic tenant-branded HTML, and creates replay-suppressed \u003cstrong\u003eGmail drafts\u003c\/strong\u003e (no sending) for each confirmed report—designed to prevent duplicates and content drift.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives a single authenticated webhook batch\u003c\/strong\u003e containing \u003cstrong\u003e1–20\u003c\/strong\u003e client reports from your upstream system.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eVerifies \u003cem\u003eCLIENT_REPORT_INTAKE_TOKEN\u003c\/em\u003e before any Data Table or Gmail work\u003c\/strong\u003e, and removes authorization data from the normalized payload.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eValidates exact batch\/per-report keys and strict scalar bounds\u003c\/strong\u003e (including locale, a \u003cstrong\u003esix-digit brand color\u003c\/strong\u003e, explicit-offset source time, narrative arrays, nonnegative integer metrics, and funnel ordering). Invalid siblings are rejected with bounded errors \u003cem\u003ewithout blocking valid reports\u003c\/em\u003e, and invalid scalar values are never reflected.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRenders deterministic, HTML-escaped tenant-branded email\u003c\/strong\u003e for complete reports, or an explicit \u003cstrong\u003eno-data statement\u003c\/strong\u003e when \u003cem\u003ecomplete_no_data\u003c\/em\u003e contains an empty metrics object. The workflow uses \u003cstrong\u003eno AI\u003c\/strong\u003e and \u003cstrong\u003enever fetches\u003c\/strong\u003e CRM, analytics, finance, or other source systems.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePrevents Gmail draft replay\u003c\/strong\u003e by computing deterministic \u003cstrong\u003eSHA-256 scope, recipient, content, and fingerprint identities\u003c\/strong\u003e, then reading every physical Data Table row in the exact tenant-period-template scope.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCreates drafts only after privacy-minimal “Draft Intent” metadata is persisted\u003c\/strong\u003e and \u003cstrong\u003eexactly one matching acknowledgement\u003c\/strong\u003e is received. Gmail creates a \u003cstrong\u003edraft\u003c\/strong\u003e—it never sends.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eBatch-generating tenant-branded report emails from your webhook source while ensuring reruns don’t create duplicate drafts.\u003c\/li\u003e\n  \u003cli\u003eSafely handling mixed-validity batches: some reports fail validation while others still receive drafts.\u003c\/li\u003e\n  \u003cli\u003eOperating SaaS workflows where deterministic HTML and replay protection are required for auditability.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003en8n nodes: \u003cstrong\u003ewebhook\u003c\/strong\u003e, \u003cstrong\u003eif\u003c\/strong\u003e, \u003cstrong\u003ecode\u003c\/strong\u003e, \u003cstrong\u003edata table\u003c\/strong\u003e, \u003cstrong\u003egmail\u003c\/strong\u003e, \u003cstrong\u003esticky note\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eDeterministic hashing: \u003cstrong\u003eSHA-256\u003c\/strong\u003e for scope\/recipient\/content\/fingerprint.\u003c\/li\u003e\n  \u003cli\u003eStrict schema validation (locale, brand color, explicit-offset time, narrative arrays, integer metrics, funnel ordering).\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45938262638771,"sku":"N8N-19006","price":4.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/J8w5gLlhbZUwvV3QGTadU_NRLdj2KH.png?v=1788340941","url":"https:\/\/buyflowscripts.com\/products\/replay-safe-gmail-drafts-from-webhook-batches-n8n","provider":"N8N Commerce","version":"1.0","type":"link"}