Use this powerful n8n workflow to automatically scan Gmail for delivery failures, extract bounced email addresses, and update your Google Sheets contact list instantly for better hygiene.
Download this n8n workflow template and start using it instantly.
Marketing teams running email campaigns.
Sales operations specialists managing large contact lists.
Users who need reliable methods to clean up databases after bulk sending using an n8n workflow.
Anyone looking for advanced n8n templates integrating Gmail and Google Sheets.
Email deliverability is crucial. After launching a large campaign, managing bounced emails manually is time-consuming and inefficient. This specialized n8n workflow solves this by continuously monitoring your Gmail inbox (or specified folder, like Spam) for automatic delivery error notifications. When a bounce message is detected, the n8n node uses custom code to accurately extract the problematic recipient email address. It then seamlessly interacts with your Google Sheets contact database, locating the user and setting an 'Error' flag (e.g., column err='Y'). This automated cleanup process ensures that subsequent communications generated by your main n8n templates or systems avoid sending emails to non-existent addresses, dramatically improving your list hygiene and campaign success rate.
settings n8n node initializes the Google Sheet ID required for subsequent operations.readspamfolder Gmail n8n node connects to Gmail, pulling emails from the specified folder (configured here as 'SPAM').undeliveredfailure IF n8n node filters these messages, continuing the flow only if the subject contains the delivery error keywords "Undelivered" or "Failure."geterremail custom code n8n node executes a regular expression search on the email body to extract the bounced recipient's email address. This ensures a clean data point is passed forward by the n8n workflow.lookupemail Google Sheets n8n node searches your contact sheet for the row corresponding to the extracted email address. It is crucial that this n8n node retrieves the internal Google Sheet rownumber.updateerr Google Sheets n8n node uses the retrieved rownumber to update the contact's row, setting the err column value to 'Y', effectively flagging the recipient as a permanent bounce. This fully automated n8n workflow simplifies list maintenance.readspamfolder n8n node) and Google Sheets (used by the lookupemail and update_err n8n nodes).email and a designated error flag column, like err. Locate your Google Sheet ID (the long string between /d/ and /edit in the URL).settings: Open the settings n8n node and replace the placeholder value in googlesheetid with your actual Google Sheet ID.readspamfolder: Verify the folder (labelIds) the Gmail n8n node is monitoring matches where your mail server deposits delivery error messages (e.g., 'SPAM' or 'INBOX'). When clicking ‘Test workflow’ (Manual Trigger n8n trigger): Initiates the execution of the n8n workflow for testing or scheduled runs.
readspamfolder (Gmail n8n node): Fetches all messages from the specified label ('SPAM'). It uses the getAll operation to process multiple potential bounce messages.
undeliveredfailure (IF n8n node): Filters incoming emails by checking if the subject line contains "Undelivered" OR "Failure," confirming it is a bounce notification before continuing the n8n workflow path.
geterremail (Code n8n node): This is a critical custom code n8n node. It uses a JavaScript regex to parse the body text of the bounce message and extract the target email address that failed delivery.
lookupemail (Google Sheets n8n node): Searches the Google Sheet (sheet 'contacts') for the row where the email column matches the extracted email address (extractedEmails). Crucially, it retrieves the internal Google Sheet rownumber required for the update.
updateerr (Google Sheets n8n node): An essential Google Sheets n8n node. It updates the row identified by rownumber. It sets the column named err to 'Y', marking the contact as invalid.
Fix incorrect guest order emails in Magento 2 efficiently using this n8n workflow. It combines MySQL updates and Magento REST API calls to ensure confirmations are resent correctly.

Deploy this robust n8n workflow to automatically scrape targeted news sites using FireCrawl, filter content by keywords, summarize articles with OpenAI (GPT-4o-mini), and deliver daily market intelligence summaries directly to your team's Slack channel.

Use this powerful n8n workflow to schedule daily market news retrieval via Finnhub API and automatically post summaries to a Slack channel. This n8n template helps financial analysts monitor key stocks.

Use this dynamic n8n workflow to automate currency rate uploads to SAP Business One (SAP B1) from multiple sources (JSON, SQL, Sheets). Features OpenAI for complex data transformation and date validation, making this one of the most powerful n8n templates available.

Deploy a powerful data analytics n8n workflow that uses a Telegram bot to instantly visualize CSV flight data into professional Bar, Pie, Doughnut, and Line charts using the QuickChart API and custom n8n code.

Automate sophisticated travel planning with this n8n workflow. It scrapes live flight prices, fetches destination weather data, uses GPT for complex analysis, and publishes the results automatically to WordPress and Slack. Get this n8n template today.








































