Automated Seller Data Enrichment using Web Scraping and Database Sync - n8n Workflow

Use this n8n workflow to automatically enrich seller data in PostgreSQL by scraping Google Search results for missing primary emails and domains using the Bright Data n8n node.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Data Analysts and Researchers needing automated data cleaning and enrichment.
E-commerce platforms or CRM administrators maintaining comprehensive seller databases.
Users looking for advanced examples of conditional logic (Switch nodes) combined with external scraping services (Bright Data).
Anyone interested in creating robust, self-healing n8n templates for contact verification.

Overview

Maintaining clean and complete contact data is critical for B2B operations. This powerful n8n workflow solves the problem of missing primary contact information (emails and domains) by automating targeted web scraping.

Starting from a Postgres database, the n8n workflow retrieves records lacking emails and initiates a multi-stage search process using Bright Data to simulate precise Google searches. The key value provided by this n8n template lies in its verification logic: it not only scrapes potential emails and websites but also uses custom code nodes to cross-validate if the extracted domain matches the seller's name or trade name before saving the data back to Postgres. This ensures high data quality and accuracy, making this a highly valuable n8n workflow for data teams.

How it Works

This comprehensive n8n workflow operates on a scheduled basis or can be manually started using the manual n8n trigger.


  1. Trigger & Read: The n8n trigger starts the process. The first n8n node connects to PostgreSQL to select a batch of seller records where the primary_email field is NULL. Records are processed in batches of 5 using the Split In Batches n8n node.

  2. Domain Check (Switch): An n8n Switch node determines the subsequent search strategy. If a domain already exists, the workflow uses that domain for a specific search. If not, it relies on the seller's trade name and business address.

  3. Search Strategy 1 (Domain Search): If a domain exists, the BrightData n8n node searches Google using the query [domain] + email. The extracted HTML is then parsed, and potential emails are filtered to ensure they contain the known root domain.

  4. Update or Retry: If a matching email is found, the workflow uses a Postgres n8n node (Postgres1) to update the database immediately, and the batch processing moves forward via a Wait n8n node. If no email is found, the workflow pauses briefly (Wait1) and then moves to the secondary, broader search strategy.

  5. Search Strategy 2 (Name/Address Search): The BrightData1 n8n node performs a broader Google search using email + [seller name/trade name] + [business address] to find associated contact information.

  6. Advanced Verification (Code): Extracted URLs and emails are passed to a custom Code n8n node. This code implements a robust verification algorithm that normalizes the company and trade names and compares them against the extracted root domains to ensure the discovered website genuinely belongs to the seller.

  7. Final Update (Switch1): A final Switch1 n8n node routes the data based on verification results. If the extracted email matches the verified domain, both fields are updated (Postgres3). If only a verified domain is found, only the domain is updated (Postgres4). Records that yield no useful data are marked as processed (via Postgres2), ensuring the next iteration of the n8n workflow only targets truly unprocessed items. All paths converge, allowing the next batch to be processed.

Installation Guide

To deploy this n8n template, follow these steps:


  1. Import: Copy the provided JSON code and import it into your self-hosted n8n instance or n8n Cloud account.

  2. PostgreSQL Credentials: You must configure the required Postgres credential used across the Postgres n8n nodes (Read the Database, Postgres1, Postgres2, etc.). Ensure this account has read and write permissions to your sellerdata table.

  3. Bright Data Credentials: Configure the Bright Data API credential. This is essential for the BrightData n8n node to perform the Google search scraping.

  4. Database Schema: Verify that your PostgreSQL database contains a table named sellerdata with columns such as sellerid, primaryemail, domain, sellername, tradename, and business_address as referenced in the various Postgres n8n node configurations.

  5. Activation: Once credentials are set up, activate the n8n workflow to run according to the Schedule Trigger, or run the n8n workflow manually for testing.

Node Details

Schedule Trigger & Manual Trigger: The designated n8n trigger points for running the automation, allowing scheduled periodic execution or instant testing.
Postgres (Read the Database): Uses the select operation to pull up to 60 items at a time where primaryemail is NULL. This is the source n8n node for data.
Split In Batches: This core n8n node manages data flow, processing items in batches of 5 to optimize resource usage and manage rate limits.
Switch (e513e68c): Directs the flow. Output 'Domain exists' triggers the targeted domain search via Bright Data. The 'No domain but with business address and trade name' output triggers the broader search.
BrightData: The specialized web scraping n8n node used twice, configured to use the webunlocker1 zone for proxy management when querying Google Search.
Code (5fa56857): A critical custom n8n node that runs verification functions (isWebsiteBelongsToCompany) comparing normalized seller names/trade names against extracted website root domains to validate ownership.
Filter / Filter1: These n8n nodes filter extracted emails to confirm they contain the root domain found, drastically improving the relevance of the enriched data.
Postgres (Update): Multiple instances of this n8n node perform the final data enrichment by executing the update operation on the sellerdata table, matching records by sellerid and setting the new primary_email or domain values.

Related n8n Workflows

Free

Nodes: 15 Nodes
Updated: December 26 2025
View all

Featured*