Data Synchronization: Google Sheets to Salesforce Accounts and Contacts - n8n Workflow

Use this powerful n8n workflow to automatically sync lead data from Google Sheets, checking for existing Salesforce accounts and performing an upsert operation on contacts for perfect data hygiene.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Sales Operations teams needing automated data entry.
CRM Managers focused on maintaining high data quality and preventing duplicates.
Users looking for advanced n8n templates for complex business synchronization.
Businesses migrating leads or performing bulk updates from external spreadsheets.

Overview

Maintaining accurate customer and prospect data across multiple platforms is crucial yet time-consuming. This specialized n8n workflow provides a robust solution for syncing lead data stored in Google Sheets directly into Salesforce, ensuring data hygiene and operational efficiency.

The automation starts with an n8n trigger to initiate the sync. It intelligently handles existing records: it reads the lead list, searches Salesforce for the corresponding company names, and splits the data path. New companies are automatically deduplicated and created as Salesforce Accounts using a dedicated n8n node. For existing companies, the n8n workflow retrieves the necessary Account ID. Finally, the flow converges to use another powerful n8n node to upsert the contact information against the correct Account, minimizing manual intervention and maximizing data consistency. This n8n workflow is a prime example of leveraging automation for complex CRM tasks.

How it Works

This powerful n8n workflow manages a dual process of account creation and contact upserting based on source data from a Google Sheet.


  1. Initiation: The n8n trigger, configured as 'On clicking execute,' starts the synchronization process.

  2. Data Extraction: The 'Read Google Sheet' n8n node pulls all relevant lead and company data from the specified spreadsheet.

  3. Account Lookup: The 'Search Salesforce accounts' n8n node queries Salesforce, attempting to find existing Accounts matching the 'Company Name' found in the sheet.

  4. Deduplication and Splitting: The data is split into two streams. The 'Keep new companies' n8n node filters out accounts already found. The remaining new company records are processed by the 'Remove duplicate companies' n8n node to ensure only unique account creation requests proceed.

  5. New Account Creation: The 'Create Salesforce account' n8n node creates the new Account record. The output (including the new Salesforce ID) is captured by the 'Set new account name' n8n node.

  6. Existing Account ID Retrieval: For existing accounts, 'Merge existing account data' combines the sheet data with the Salesforce search results. The 'Account found?' n8n node confirms the presence of the Salesforce ID, which is then renamed by 'Set Account ID for existing accounts' for consistent mapping.

  7. Contact Upsert: The flows merge via 'Retrieve new company contacts.' The final step, the 'Create Salesforce contact' n8n node, performs an upsert operation using the contact's 'Email' as the external ID. This ensures contacts are updated if they exist, or created if new, and correctly linked to the corresponding Account ID (whether newly created or existing). This demonstrates an efficient n8n templates structure.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import: Copy the provided n8n workflow JSON code and import it into your n8n instance.

  2. Google Sheets Setup: Configure the 'Read Google Sheet' n8n node. You must provide the correct sheetId and ensure your Google Sheets OAuth2 API credentials are set up and selected.

  3. Salesforce Credentials: Update all Salesforce n8n node instances ('Search Salesforce accounts', 'Create Salesforce account', 'Create Salesforce contact') with your valid Salesforce OAuth2 API credentials.

  4. Testing: Execute the n8n trigger manually to test the flow with sample data from your Google Sheet. Verify that Accounts are created correctly and Contacts are upserted with the right Account ID linkage.

Node Details

This n8n workflow leverages several key n8n node types for complex data manipulation and CRM integration:

Manual Trigger (n8n trigger): Initiates the n8n workflow upon manual execution.
Google Sheets (Read Google Sheet): Reads all rows from the designated Google Sheet, acting as the primary data source for the n8n workflow.
Salesforce (Search Salesforce accounts): A crucial n8n node that performs a query to check if a company name already exists in the Salesforce 'Account' object. It utilizes a dynamic N8N expression to format the query.
Merge (Keep new companies / Merge existing account data): These n8n nodes handle data routing. 'Keep new companies' uses removeKeyMatches to isolate new accounts, while 'Merge existing account data' merges the sheet data with search results.
Item Lists (Remove duplicate companies): An important utility n8n node that uses the removeDuplicates operation based on the 'Company Name' field, preventing multiple account creation attempts for the same company in a single run.
Salesforce (Create Salesforce account): Creates a new Account record in Salesforce for all unique, new companies.


  • Salesforce (Create Salesforce contact): The final n8n node that performs an upsert operation on the Contact object, linking the contact to the correct Account ID based on the flow's output, using Email as the external identifier.

Related n8n Workflows

Free

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

Featured*