Daily E-commerce Customer Synchronization with Deduplication - n8n Workflow

Use this powerful n8n workflow to automate the daily synchronization of new Magento 2 customer data to Google Contacts and Google Sheets, ensuring zero duplication using the Compare Datasets n8n node.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • E-commerce store managers needing up-to-date customer records in their contact database.

  • Marketing teams who use Google Contacts for segmentation and outreach.

  • Developers seeking reliable n8n templates for API data synchronization.

  • Users who need a scheduled n8n workflow solution to prevent duplicate contact entries across multiple services.

Overview

Managing customer data across multiple platforms without creating duplicates can be a significant headache, especially for active e-commerce sites. This robust n8n workflow is designed to solve that precise problem. It runs on a schedule, identifies new customers added to your Magento 2 store since the last sync, and meticulously checks a Google Sheet logging previous syncs before creating a new entry.

By leveraging the built-in logic of the n8n platform, this n8n workflow ensures that only truly new customers are pushed to Google Contacts, and then their email is immediately logged in the Google Sheet, closing the loop and preparing for the next run. It is an essential n8n node combination for maintaining clean data hygiene.

How it Works

The entire process is initiated by a scheduled n8n trigger, which activates the daily sync routine.


  1. Schedule Trigger: The n8n trigger starts the process, typically set to run once daily.

  2. Date Calculation: A custom Code n8n node calculates the required date range (e.g., 'since yesterday') needed for the subsequent API request.

  3. Fetch Existing Data: Simultaneously, the workflow retrieves the master list of already-synced emails from a designated Google Sheet.

  4. Fetch New Data: Using the calculated date, an HTTP Request n8n node queries the Magento 2 API (or similar e-commerce backend) for new customer records.

  5. Preparation and Comparison: The incoming customer records are split into individual items. The crucial Compare Datasets n8n node then cross-references the list of new customer emails against the existing emails retrieved from Google Sheets. Only customers marked as 'not existing' (truly new customers) are passed forward.

  6. Contact Creation: For each unique new customer, the workflow uses the Google Contacts n8n node to create a new contact entry.

  7. Logging: Finally, the email address of the newly synced customer is immediately appended to the Google Sheet using the Google Sheets n8n node, updating the master list for the next time the n8n trigger runs.

Installation Guide

To deploy this n8n workflow, follow these steps:


  1. Import: Copy the provided JSON data and paste it into your n8n instance using the 'New' menu -> 'Import from JSON'.

  2. Credentials Setup: You must configure credentials for the following services:

HTTP Request: Needs credentials (API key/token) for your Magento 2 instance or relevant e-commerce platform.
Google Sheets: Requires OAuth credentials for read/write access to the Sheet that stores synced emails.
Google Contacts: Requires OAuth credentials for creating new contacts.

  1. Configure Nodes:

Schedule Trigger: Adjust the run time in this n8n trigger to match your desired schedule (e.g., daily at 2 AM).
Code Node (GET PREVIOUS DATE): Ensure the date calculation logic correctly formats the date needed by your Magento API.
Google Sheets Nodes: Specify the correct Spreadsheet ID and Sheet Name for both reading and writing operations.

  1. Activation: Once configured, activate the n8n workflow to enable the automated sync.

Node Details

This n8n workflow leverages several powerful nodes:

Schedule Trigger: This is the initial n8n trigger, configured to start the synchronization process at specified intervals (e.g., daily).
GET PREVIOUS DATE (Code Node): A custom n8n node used to dynamically generate the required date filter (e.g., updated_at > YYYY-MM-DD) for the Magento API call. This is vital for fetching only the most recent data.
Get Existing Emails (Google Sheets n8n node): Reads a column from a specified spreadsheet to retrieve the comprehensive list of emails already processed, serving as the source of truth for deduplication.
Get New Customers (HTTP Request n8n node): Connects to the external API (Magento 2) using parameters derived from the Code node, retrieving a list of customer objects.
Compare Datasets (n8n node): The core deduplication tool. It compares the emails fetched from Google Sheets (Dataset 1) against the new customer emails (Dataset 2). It outputs data only when the email is unique to Dataset 2, effectively filtering out duplicates.
Create Google Contact (Google Contacts n8n node): Creates the contact record in Google Contacts using the filtered customer data (name, email) outputted by the Compare Datasets n8n node.


  • Log Synced Email (Google Sheets n8n node): Appends the newly synced customer's email to the master Google Sheet, updating the existing email list for future runs of this n8n workflow.

Related n8n Workflows

Paid

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
Kanaka Kishore Kandregula
Kanaka Kishore Kandregula

Experienced Magento 2 Developer with 10+ years of expertise in building and optimizing eCommerce solutions. Over the past year, I’ve expanded my skills into workflow automation using n8n, streamlining business processes and integrating systems for efficiency. Passionate about solving complex problems, enhancing performance, and leveraging automation to drive smarter workflows.

Featured*