Step by step guide to syncing Salesforce contacts with HubSpot using N8n

Wish your Salesforce contacts would magically show up in HubSpot? You’re not alone. If you’re tired of CSV exports, copy-pasting, or hoping your team remembers to update both systems, this guide is for you. We’ll walk through making Salesforce talk to HubSpot using N8n—an open-source automation tool that’s powerful, flexible, and doesn’t require you to be a programmer (though it helps if you’re not afraid of a little tinkering).

This isn’t a fluffy “just connect and go” article. We’ll get into the weeds, flag the tricky parts, and help you dodge common headaches.


Why bother syncing Salesforce and HubSpot?

If you’re reading this, you probably already know the pain: sales and marketing teams living in different apps, contacts getting stale, leads falling through the cracks. Manual updates don’t scale, and buying pricey middleware just to sync a few fields feels like overkill.

A good sync means: - No more double entry - Up-to-date info, everywhere - Fewer “wait, which system is right?” moments

But let’s be real: syncing two big platforms isn’t plug-and-play. You’ll hit weird field mismatches, inconsistent data, and permissions issues. That’s why we’re using N8n—it gives you control without locking you in.


What you’ll need

Before you dive in, here’s what you’ll want on hand:

  • Salesforce account: With API access (not all plans have this—check before you start)
  • HubSpot account: Free tier is fine for basic contact syncing
  • N8n instance: Can be self-hosted, desktop, or cloud (cloud is easiest for most people)
  • API credentials: For both Salesforce and HubSpot
  • A little patience: This is doable, but you’ll hit a snag or two

Step 1: Set up N8n

If you haven’t used N8n before, it’s a bit like Zapier, but open-source and way more customizable. You can run it on your own server, a Raspberry Pi, or just sign up for their cloud version. For most, cloud is the path of least resistance.

To get started: 1. Go to n8n.io and sign up for an account or download the desktop app. 2. Once you’re in, you’ll land on the workflow editor. This is where you’ll build your integration.

Pro tip: If you’re just experimenting, the desktop app is fine. For anything “real,” use the cloud or a server—desktop N8n only runs when your machine is on.


Step 2: Get Salesforce API access

Salesforce is notoriously picky about API access. Here’s what you need:

  • Enterprise, Unlimited, Developer, or Performance edition gives you API access by default.
  • Professional edition sometimes lets you buy API access, but not always. (Check your contract.)

Set up a connected app in Salesforce: 1. In Salesforce, go to Setup > Apps > App Manager. 2. Click New Connected App. 3. Fill out the form (name, contact email). 4. Under API (Enable OAuth Settings), check the box. 5. Set the Callback URL to something like https://n8n.io/ (you’ll update this if self-hosting). 6. Select these OAuth scopes: - Access and manage your data (api) - Perform requests on your behalf at any time (refresh_token, offline_access) 7. Save the app. Copy your Consumer Key and Consumer Secret—you’ll need them in N8n.

Don’t skip: Sometimes you have to wait 10 minutes for API access to activate.


Step 3: Get HubSpot API credentials

HubSpot makes this a bit easier.

  1. In HubSpot, go to Settings > Integrations > Private Apps (Public API keys are being deprecated).
  2. Click Create a Private App.
  3. Give it a name and select the scopes you need (for syncing contacts, crm.objects.contacts.read and crm.objects.contacts.write).
  4. Save and copy the token—it only shows once.

Warning: Treat this token like a password. If someone gets it, they have access to your HubSpot data.


Step 4: Connect Salesforce and HubSpot in N8n

Now comes the fun part—building your workflow.

4.1. Add the Salesforce node

  1. In N8n, click + to add a node.
  2. Search for Salesforce and add it.
  3. Set the operation to Get All (to fetch contacts).
  4. Click Credentials > Create new and fill in:
  5. Username
  6. Password (sometimes you need a security token appended—Salesforce is weird like that)
  7. Consumer Key and Secret from earlier
  8. Environment (usually “Production”)
  9. Test the connection. If it fails, double-check permissions and security token.

Heads up: If you get “invalid_grant” errors, revisit your connected app settings—OAuth scopes are the usual culprit.

4.2. Add the HubSpot node

  1. Add another node, search for HubSpot.
  2. Set the operation to Create or Update (so you don’t make duplicates).
  3. Under Credentials, paste in your HubSpot private app token.
  4. Map the fields—at a minimum, you’ll want:
  5. First name
  6. Last name
  7. Email
  8. Company (optional)

Watch out: HubSpot fields are sometimes named differently. Double-check how they appear in HubSpot and match them carefully.

4.3. Connect the nodes

  • Drag the arrow from the Salesforce node (output) to the HubSpot node (input).
  • Set up the mapping: For each Salesforce contact, send the relevant fields to HubSpot.

Common pitfall: If you skip mapping required fields (like email), HubSpot will reject the contact, usually with a cryptic error.


Step 5: Test your workflow

This isn’t a “set it and forget it” moment. Test with just a few contacts first.

  1. In Salesforce, create a test contact.
  2. In N8n, click Execute Workflow.
  3. Check HubSpot—does the contact show up? Are the fields right?
  4. Fix any mapping issues or errors.

Pro tip: Use filters or conditions in N8n to only sync new or recently updated contacts, rather than sending the whole database every time.


Step 6: Set up automation (optional, but recommended)

Manual syncs are fine for a demo, but real value comes from automation.

  • Add a Schedule Trigger node in N8n to run the workflow every hour, day, etc.
  • Or, use Webhook triggers if you want near real-time syncing (advanced, and requires Salesforce outbound messaging).

Reality check: Real-time, bi-directional sync is possible, but it gets complicated fast. Start with one-way, scheduled syncs. Iterate as you go.


Step 7: Handle duplicates and data conflicts

No one tells you this, but syncing two big CRMs will surface data messes you didn’t know you had.

  • Decide on your “source of truth.” If Salesforce is right, overwrite HubSpot. If HubSpot sometimes wins, build logic for that.
  • Add deduplication logic in N8n (use email as a unique key, for example).
  • Set up alerts or error logging in N8n for failed syncs.

Don’t ignore: If you see lots of errors or duplicate contacts, fix your data before expanding the sync. Otherwise, you’ll just move the mess from one place to another.


Step 8: Monitor and maintain

This isn’t a “set it and forget it” job. APIs change, credentials expire, and weird edge cases pop up.

To stay sane: - Check N8n’s logs regularly. - Rotate API credentials every so often. - Document your workflow, so you (or someone else) can fix it later.


What to skip (for now)

  • Bi-directional sync: Tempting, but it doubles complexity. Only try this after you’ve nailed one-way sync.
  • Custom objects or fields: Start with the basics. Fancy mapping can wait.
  • Bulk imports: N8n can handle big batches, but start small to avoid API rate limits and surprises.

Wrapping up

Getting Salesforce and HubSpot to sync isn’t magic, but with the right tools (and a little patience), it’s totally doable. Start simple: get contacts flowing one way, make sure fields match, and automate on a schedule. Don’t try to build the Death Star on day one.

Iterate, watch for errors, and tweak as you go. You’ll save yourself and your team a ton of headaches. And if something breaks? At least you’ll know where to look.

Happy syncing.