Automate Salesforce Account and Contact Creation with n8n

This n8n workflow automates importing company and contact data from an online Excel spreadsheet into Salesforce, eliminating manual data entry errors and saving hours of repetitive work. It checks for existing accounts to avoid duplicates and creates new contacts efficiently.
salesforce
manualTrigger
httpRequest
+7
Workflow Identifier: 1443
NODES in Use: Manual Trigger, HTTP Request, Spreadsheet File, Salesforce, Merge, Item Lists, Set, If, Rename Keys, Sticky Note

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Automation Does

This n8n workflow takes company and contact data from an Excel file and moves it into Salesforce.

It saves time by checking if companies already exist in Salesforce.

New companies get added; existing ones are updated.

Contacts are linked correctly to their accounts.

The result is less manual work, fewer mistakes, and cleaner Salesforce data.


Tools and Services Used

  • Salesforce API: For searching, creating, and updating accounts and contacts.
  • n8n Automation: To design the workflow with nodes like Manual Trigger, HTTP Request, Spreadsheet File, Merge, Salesforce, and others.
  • Excel Spreadsheet File: The input data source containing company and contact details.
  • OAuth2 Credentials: To securely connect n8n with Salesforce.

Inputs → Processing Steps → Output

Inputs

  • An Excel file URL that holds company names, contact emails, first and last names.

Processing Steps

  • Download the file using an HTTP GET request.
  • Parse the spreadsheet into JSON data records.
  • Search Salesforce for each company name using SOQL queries with correct escaping of quotes.
  • Filter out existing companies to avoid duplicate account creation.
  • Remove duplicates from the new companies list.
  • Create new Salesforce accounts for companies not found.
  • Merge data of existing accounts with the imported contacts.
  • Use conditional checks to separate processing paths for existing and new accounts.
  • Rename Salesforce account ID key to “Account ID” to link contacts properly.
  • Create or update Salesforce contacts with linked account IDs.

Output

  • New and updated accounts in Salesforce.
  • Contacts linked via correct Account IDs.
  • Clean, de-duplicated Salesforce data matching the spreadsheet input.

Beginner Step-by-Step: How to Use This Workflow in n8n

Step 1: Import the Workflow

  1. Click the Download button on this tutorial page to get the workflow file.
  2. Open n8n editor where you make workflows.
  3. Select “Import from File” and choose the downloaded workflow JSON file.

Step 2: Configure Credentials

  1. Add your Salesforce OAuth2 credentials in the credentials manager.
  2. Double check the HTTP Request node URL is set to https://static.thomasmartens.eu/n8n/Excel-File-to-Salesforce.xlsx.
  3. If the spreadsheet columns differ, update any field mappings accordingly in the nodes.

Step 3: Test the Workflow

  1. Run the workflow manually by clicking the execute button on the Manual Trigger node.
  2. Watch the progress and check node outputs for errors or missing data.

Step 4: Activate Workflow for Production

  1. Once testing works, activate the workflow to run on manual or schedule triggers.
  2. If you want automated runs, replace the Manual Trigger with a Cron node.
  3. Ensure your Salesforce API limits and n8n setup are stable.
  4. Use a self-host n8n instance if you want full control and security.

Customization Ideas

  • Add phone numbers or job titles in the contact create node under Additional Fields.
  • Switch the input from HTTP Request to FTP or cloud storage nodes if needed.
  • Use a Cron node for automatic scheduling instead of manual trigger.
  • Log created accounts into a Google Sheet for tracking or auditing.

Troubleshooting

  • Problem: SOQL query returns no results but companies exist.
    Cause: Improper escaping of single quotes in company names.
    Fix: Use replace(/'/g, '\\') in the SOQL expression.
  • Problem: Contacts not linked to correct accounts.
    Cause: Account ID field not renamed before contact upsert.
    Fix: Rename Keys node must rename Id to Account ID.
  • Problem: Duplicate companies created.
    Cause: Duplicates not removed properly.
    Fix: Ensure Item Lists node removes duplicates on the Company Name field.

Pre-Production Checklist

  • Test Salesforce credentials and connection in the Salesforce node.
  • Check the spreadsheet URL downloads the file correctly.
  • Confirm the spreadsheet columns match expected names like Company Name, First Name, Last Name, Email.
  • Run workflow manually to verify account and contact creation/updating.
  • Backup Salesforce data or have rollback plan to avoid data loss.

Deployment Guide

Activate the workflow in n8n after setup.

Run it manually or replace the trigger with a Cron node to automate imports on schedule.

Watch the n8n logs for errors and adjust mappings or queries when Salesforce schema changes.

Summary of Results

✓ Workflow imports company and contact data efficiently.

✓ Avoids duplicate Salesforce accounts with smart searching.

✓ Links contacts properly to accounts by Salesforce IDs.

→ Saves hours of manual data entry work.

→ Keeps Salesforce CRM data clean and updated.


Frequently Asked Questions

Yes, but the parsing node must be changed to a CSV parser instead of the Spreadsheet File node.
Yes, each search, create, or update uses Salesforce API calls. Monitor API limits to avoid issues.
Data moves directly between n8n and Salesforce using OAuth2 tokens. Secure the n8n instance properly.
Large datasets may require batching or chunking to avoid timeouts and API rate limits.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free