Send lead notifications and acknowledgements via webhook, Gmail and Data Tables
Quick overview This workflow receives new lead submissions via a header-authenticated webhook, validates and normalizes the payload, prevents duplicate notifications using an n8n Data Table, then sends two Gmail emails (admin alert and lead acknowledgement) and returns a JSON response with the processing result.
How it works Receives a POST request on a header-authenticated webhook containing lead details. Normalizes the incoming fields (for example trimming the name and lowercasing the email) and rejects invalid payloads with an HTTP 400 JSON response. Checks an n8n Data Table log for an existing row with the same leadId to prevent sending notifications twice. If the lead was already processed, returns a JSON response indicating the request is a duplicate. If the lead is new, sends an admin notification email and a lead acknowledgement email through Gmail while allowing either email to fail without stopping the run. Logs email send statuses and errors back to the n8n Data Table and responds to the caller with a JSON success payload.
Setup Create and attach a Header Auth credential to the webhook and configure the calling form/CRM to send requests to the webhook URL with the required header. Connect a Gmail OAuth2 credential and select it in both Gmail email-sending steps. Create an n8n Data Table named lead_notification_log with the expected columns (leadId, executionId, adminEmailStatus, adminEmailError, leadEmailStatus, leadEmailError, status, notifiedAt) and select it in both Data Table steps. Update the admin recipient email address (currently admin@example.com) and adjust the email subjects/bodies to match your branding.
Related Templates
Transform Gmail Newsletters into Insightful LinkedIn Posts Using OpenAI
Who Is This For? This workflow is perfect for content creators, marketers, and business professionals who receive regu...
Subscribe to new releases of a Github repository via Gmail
This is a very simple workflow that lets you subscribe to any github repository for the latest release (using n8n as ex...
AI Email Classifier & Auto-Delete for Gmail (SPAM/OFFER Cleaner)
This workflow is designed for freelancers, solopreneurs, and business owners who receive a high volume of irrelevant mes...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments