Automated Email Bounce Detection and Daily Reporting - n8n Workflow

Use this powerful n8n workflow to automatically detect bounced emails via Gmail, update contact statuses in Google Sheets, and send daily cleanup summaries to Slack. Streamline your list hygiene with this n8n template.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Marketing Teams: Who need to maintain clean, high-deliverability email lists.

  • Sales Operations: Looking to automatically identify invalid leads.

  • n8n Users: Seeking robust, real-world examples of combining Gmail, Google Sheets, and custom Code/Function nodes.

  • Automation Specialists: Who want a ready-to-use n8n template for email hygiene.

Overview

Maintaining email list hygiene is crucial for maximizing deliverability and minimizing sender reputation damage. Manually tracking bounce-back notifications is time-consuming and prone to errors. This comprehensive n8n workflow solves this by fully automating the detection, logging, and reporting process.

This single solution is divided into two distinct parts: a real-time detection path that uses an n8n node to fetch Gmail bounce notifications and update your contact list in Google Sheets, and a scheduled daily report path that utilizes an n8n trigger (Cron) to summarize the cleanup results and notify your team via Slack. By implementing this n8n workflow, you ensure your contact data is always current, allowing you to focus on valid leads and save costs on email service providers.

How it Works

The n8n workflow operates in two connected flows:

Flow 1: Bounce Detection and Sheet Update


  1. Trigger: The main workflow path starts either manually (for testing) or via a scheduled n8n trigger (like a Cron or Webhook, though this template uses a manual trigger). It simultaneously initiates two branches.

  2. Fetch Bounces (Gmail): An n8n node dedicated to Gmail fetches emails specifically filtered for the sender [email protected] (standard bounce notification).

  3. Limit and Parse: A Code n8n node sorts the results to focus only on the latest 5 bounces. A subsequent Function n8n node uses custom JavaScript and regex to parse the email body snippet, extracting the specific failed email address.

  4. Fetch Contacts (Google Sheets): Simultaneously, a Google Sheets n8n node reads the entire contact list from the designated spreadsheet.

  5. Merge and Match: The Combine Bounce & Contact Data Merge n8n node consolidates the list of bounced emails with the master contact list. The Match & Update Contact Status Code n8n node then compares these lists. If a contact's email is found in the bounce list, its status is set to 'Not Found' (Invalid); otherwise, it is set to 'Not Sent'.

  6. Write Back: The final Google Sheets n8n node updates the spreadsheet, matching on the 'Name' column and writing the new 'Status' and 'Last Updated' timestamp back to the sheet.

Flow 2: Daily Reporting


  1. Daily Trigger: A Cron n8n trigger fires every day at 7 PM.

  2. Read Data: A Google Sheets n8n node reads the entire updated dataset.

  3. Calculate Stats: A Code n8n node processes all rows, tallying the counts of 'Not Found' (invalid) and 'Not Sent' statuses.

  4. Report to Slack: The Slack n8n node sends a formatted daily summary report to a specified channel, keeping the team informed of the list hygiene status. This ensures continuous monitoring using a robust n8n template.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import the n8n template: Copy the provided JSON data and paste it into your n8n canvas using the 'Import Workflow' function.

  2. Gmail Credentials: Set up your Gmail credentials. The Fetch Bounce Notifications n8n node requires OAuth2 access to read your inbox. Ensure permissions allow reading emails.

  3. Google Sheets Credentials: Configure the Google Sheets credentials. This n8n workflow requires both read and write access to the specific spreadsheet document (Fraud Email).

  4. Google Sheet Setup: Ensure your Google Sheet has the required columns: Name, Email, Status, and Last Updated.

  5. Slack Setup: Configure your Slack credentials and specify the target channel (#email-cleanup is the default) in the Send Slack Daily Summary n8n node.

  6. Activate: If you intend to use automated execution, replace the 'When clicking Execute workflow' n8n trigger with a suitable production trigger (like a Scheduled Trigger set to run hourly or daily), then activate the n8n workflow.

Node Details

Manual Trigger (When clicking ‘Execute workflow’): Serves as a manual starting point for the bounce detection flow. Useful for initial testing of this n8n template.
Gmail Node (Fetch Bounce Notifications): The core email n8n node. It retrieves all emails sent from [email protected], ensuring only hard bounce notifications are processed.
Code Node (Get Latest 5 Bounces): Sorts all fetched Gmail items by internalDate descending and slices the array to process only the top 5 newest bounce reports, limiting strain on subsequent steps of the n8n workflow.
Function Node (Parse Bounced Email Addresses): Executes custom JavaScript containing a regex pattern (wasn't delivered to\s+([\w.-]+@[\w.-]+\.\w+)) to reliably extract the bounced email address from the email snippet.
Google Sheets Node (Fetch All Email Contacts): Reads all rows from the target sheet (Fraud Email > Sheet1) to provide the contact list needed for comparison in the n8n workflow.
Merge Node (Combine Bounce & Contact Data): This crucial n8n node combines the two incoming data streams (bounced emails and contact list) so they can be processed together in the next step.
Code Node (Match & Update Contact Status): Contains logic to compare the list of bounced emails against the contact list. It dynamically sets the 'Status' to 'Not Found' or 'Not Sent' and updates the 'Last Updated' timestamp.
Google Sheets Node (Write Status Back to Sheet): Updates the sheet using the 'update' operation. It matches on the 'Name' column and writes the calculated 'Status' and 'Last Updated' values generated by the previous n8n node.
Cron Trigger (Daily 7PM Report Trigger): This n8n trigger handles the reporting schedule, running every day at 19:00 (7 PM).
Code Node (Calculate Summary Statistics): Processes the full sheet data, aggregating counts for 'Invalid emails' and 'No activity' based on the 'Status' field, preparing data for the Slack n8n node.


  • Slack Node (Send Slack Daily Summary): Formats the summary statistics and posts the daily report to the designated Slack channel.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by

Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.

Featured*