🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Keep Pipedrive and MySQL contacts in sync

Lisa Granqvist Partner Workflow Automation Expert

Your contacts are probably “right” in two places. Which means they’re wrong somewhere. A rep updates a phone number in Pipedrive, ops fixes an email in MySQL, and now nobody trusts the CRM again.

This Pipedrive MySQL sync hits sales ops first, but marketing teams and client-focused agency owners feel the fallout too. You end up sending the wrong email, calling an old number, or creating duplicate people that never get cleaned up.

This automation keeps both systems aligned, creates missing records on either side, and resolves conflicts by syncing whichever record was updated most recently. You’ll learn what it does, what you need, and how it behaves in the real world.

How This Automation Works

Here’s the complete workflow you’ll be setting up:

n8n Workflow Template: Keep Pipedrive and MySQL contacts in sync

Why This Matters: Contact data drift between CRM and database

Contact data doesn’t “break” loudly. It quietly drifts. One person gets edited in Pipedrive after a call, while MySQL gets updated from a form submission or a back-office import. A week later, you’re staring at two versions of the same customer and you can’t tell which one is real. The cost isn’t just time spent searching. It’s the mental load of second-guessing every email field, every phone number, and every name spelling before you hit send.

It adds up fast. Here’s where it breaks down.

  • Duplicates multiply when a contact exists in one tool but not the other, so someone “creates them again” to move forward.
  • Small field mismatches (phone, email, name) create big downstream errors in outreach, reporting, and customer support handoffs.
  • Manual reconciliation turns into a weekly ritual, and honestly it rarely finishes because new edits keep coming in.
  • Without a clear rule for conflicts, teams argue about “source of truth” instead of serving customers.

What You’ll Build: A two-way Pipedrive ↔ MySQL contact sync

This workflow runs on a schedule and compares your Pipedrive People list against your MySQL contacts table. First, it pulls both datasets, then standardizes the fields it cares about (name, email, phone, and timestamps). Next, it detects who exists in Pipedrive but not in MySQL, and inserts those missing contacts into your database. It also catches the reverse case, creating new People in Pipedrive when they only exist in MySQL. For contacts that exist in both places but have different details, it checks which record was updated most recently and copies that version across so both sides match.

The workflow starts with a scheduled trigger, then fetches SQL records and retrieves CRM people. After dataset comparison, it either creates missing contacts or evaluates changes and resolves conflicts using “last updated wins.” Finally, it updates the correct side (Pipedrive or MySQL) so you end up with aligned records.

What You’re Building

Expected Results

Say you add or update about 50 contacts a week across forms, imports, and rep edits. Manually reconciling “is this in Pipedrive and MySQL?” often takes around 3 minutes per contact once you include searching, comparing, and fixing duplicates, which is roughly 2–3 hours weekly. With this workflow, the trigger is automatic and the sync runs in the background; you’ll spend maybe 10 minutes a week checking exceptions. That’s a couple hours back, and the data is calmer.

Before You Start

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Pipedrive for your CRM People database.
  • MySQL to store contacts in your own table.
  • Pipedrive API token (get it from Pipedrive personal settings).

Skill level: Intermediate. You’ll connect accounts, confirm field mappings, and be comfortable checking your MySQL table structure.

Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).

Step by Step

A scheduled sync kicks everything off. n8n runs this workflow on a timer (daily, hourly, or whatever you choose), so contact alignment doesn’t rely on someone remembering.

Both systems are pulled and normalized. It fetches your MySQL contacts and retrieves People from Pipedrive, then maps fields into a consistent shape so comparisons are reliable.

Records are compared, then created if missing. A dataset comparison step identifies “only in Pipedrive” and “only in MySQL” contacts. Those gaps get filled by creating a new Pipedrive Person or inserting a new MySQL row.

Conflicts are resolved using update time. If the same person exists in both places but the name, email, or phone differs, the workflow checks timestamps and syncs the most recently updated version to the other system.

You can easily modify which fields sync (or add more) based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Schedule Trigger

Set up the workflow to run on a recurring schedule so your CRM and SQL data stay synchronized.

  1. Add and open Scheduled Sync Trigger.
  2. In RuleInterval, define your desired schedule (the node is currently configured with an empty interval, so set this explicitly).
  3. Connect Scheduled Sync Trigger to Fetch SQL Records.

Tip: Use a conservative interval during testing to avoid frequent updates while validating the sync logic.

Step 2: Connect SQL and CRM Data Sources

Pull records from your SQL database and Pipedrive to prepare for dataset comparison.

  1. Open Fetch SQL Records and set Operation to executeQuery.
  2. Set Query to SELECT id, name, email, phone, updated_on FROM contact.
  3. Credential Required: Connect your mySql credentials in Fetch SQL Records.
  4. Open Retrieve CRM People and set Resource to person and Operation to getAll.
  5. Credential Required: Connect your pipedriveApi credentials in Retrieve CRM People.
  6. Connect Retrieve CRM People to Map CRM Fields.

Step 3: Normalize CRM Fields and Compare Datasets

Map CRM fields into a consistent structure and compare them with SQL records.

  1. Open Map CRM Fields and enable Keep Only Set.
  2. Set mapped fields in Map CRM Fields:
  3. id{{ $json["id"] }}, name{{ $json["name"] }}, email{{ $json["primary_email"] }}, phone{{ $json["phone"][0]["value"] }}, updated_on{{ $json["update_time"] }}.
  4. Open Dataset Comparison and set Resolve to includeBoth.
  5. Set Merge By Fields to match email from both inputs.
  6. Connect Fetch SQL Records to Dataset Comparison (input 1) and Map CRM Fields to Dataset Comparison (input 2).

⚠️ Common Pitfall: If CRM contacts have missing or inconsistent email values, matches may fail and create duplicates. Ensure email formatting is consistent in both systems.

Step 4: Create Missing Records in Both Systems

When records exist in one system but not the other, create them using the comparison outputs.

  1. Open Add CRM Person and set Name to {{ $json["name"] }}.
  2. In Add CRM Person set Email to {{ $json["email"] }} and Phone to {{ $json["phone"] }}.
  3. Credential Required: Connect your pipedriveApi credentials in Add CRM Person.
  4. Open Insert SQL Contact and set Table to contact with Columns set to name, email, phone.
  5. Credential Required: Connect your mySql credentials in Insert SQL Contact.
  6. Ensure Dataset Comparison outputs to Add CRM Person and Insert SQL Contact as configured.

Step 5: Detect Changes and Resolve Update Conflicts

Identify changed fields and determine which system has the latest update before syncing back.

  1. Open Check Data Changes and set the boolean condition to {{ !!$json["different"]["name"] || !!$json["different"]["phone"] }}.
  2. Open Format Timestamp and set Value to {{ $json["different"]["updated_on"]["input1"] }} with To Format set to YYYY-MM-DD HH:mm:ss.
  3. Open Compare Update Time and set the date comparison values to {{ $json["different"]["updated"]["input1"] }} {{ $json["different"]["updated_on"]["input1"] }} and {{ $json["different"]["updated"]["input2"] }} {{ $json["different"]["updated_on"]["input2"] }}.
  4. Confirm the execution flow: Check Data ChangesFormat TimestampCompare Update Time.

Step 6: Map and Apply Updates to CRM and SQL

Use the comparison results to update the correct system with the latest data.

  1. Open Map Fields Input A and set fields:
  2. id{{ $json["different"]["id"] ? $json["different"]["id"]["input2"] : $json["same"]["id"] }}, name{{ $json["different"]["name"] ? $json["different"]["name"]["input1"] : $json["same"]["name"] }}, phone{{ $json["different"]["phone"] ? $json["different"]["phone"]["input1"] : $json["same"]["phone"] }}.
  3. Open Update CRM Person and set Person ID to {{ $json["id"] }}, with Name {{ $json["name"] }} and Phone {{ $json["phone"] }}.
  4. Credential Required: Connect your pipedriveApi credentials in Update CRM Person.
  5. Open Map Fields Input B and set fields:
  6. id{{ $json["different"]["id"] ? $json["different"]["id"]["input1"] : $json["same"]["id"] }}, name{{ $json["different"]["name"] ? $json["different"]["name"]["input2"] : $json["same"]["name"] }}, phone{{ $json["different"]["phone"] ? $json["different"]["phone"]["input2"] : $json["same"]["phone"] }}.
  7. Open Modify SQL Contact and set Query to =UPDATE contact SET name = '{{$json["name"]}}', phone= '{{$json["phone"]}}' WHERE id = {{$json["id"]}}; with Operation set to executeQuery.
  8. Credential Required: Connect your mySql credentials in Modify SQL Contact.
  9. Confirm the execution flow from Compare Update Time to both Map Fields Input A and Map Fields Input B (no parallel branches are defined, but both outputs are configured).

Step 7: Test and Activate Your Workflow

Verify the sync in both directions and then enable scheduled execution.

  1. Click Execute Workflow to run a manual test from Scheduled Sync Trigger.
  2. Confirm that Dataset Comparison outputs new records to Add CRM Person and Insert SQL Contact.
  3. Verify updates flow through Check Data Changes, Compare Update Time, and then to Update CRM Person or Modify SQL Contact.
  4. When the output data looks correct, toggle the workflow to Active for production use.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Troubleshooting Tips

  • Pipedrive credentials can expire or need specific permissions. If things break, check your API token and app access in Pipedrive’s personal settings first.
  • If you’re using Wait-like timing or your database is under load, processing times vary. Bump up any timing buffers and re-run failed executions if downstream updates happen before the compare finishes.
  • Default field mapping is rarely “your” mapping. Confirm how you store phone formats, email casing, and name fields early or you’ll keep chasing tiny mismatches.

Quick Answers

What’s the setup time for this Pipedrive MySQL sync automation?

About an hour if your fields and credentials are ready.

Is coding required for this contact sync automation?

No. You’ll mainly connect Pipedrive and MySQL, then confirm which fields map to name, email, and phone.

Is n8n free to use for this Pipedrive MySQL sync workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in your MySQL hosting costs (usually already covered) and any Pipedrive plan limits.

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I modify this Pipedrive MySQL sync workflow for different use cases?

Yes, and you probably should. You can expand the “Map CRM Fields” and the two mapping steps that prepare updates for each side to include extra fields like organization, custom fields, or lead source. Many teams also adjust the comparison logic to treat email as the primary identifier, then phone as a fallback. If you want one-way sync instead of two-way, you can disable the “create on the other side” actions and keep only the update path you trust.

Why is my Pipedrive connection failing in this workflow?

Usually it’s an expired or wrong API token.

What volume can this Pipedrive MySQL sync workflow process?

On n8n Cloud Starter you can run thousands of executions per month, and self-hosting has no execution cap (it depends on your server). The practical limit is usually API paging and how many contacts you compare each run. If you’re syncing tens of thousands of People, schedule it during off-hours and consider syncing “changed since last run” instead of full-table comparisons. For most small teams, daily or hourly sync runs are smooth.

Is this Pipedrive MySQL sync automation better than using Zapier or Make?

Often, yes, because two-way sync with conflict resolution is where simple zaps start to get messy. n8n is better suited for “compare two datasets, then branch” logic, and you won’t pay extra just because you need multiple paths. If you self-host, high-volume syncs also become much cheaper. Zapier or Make can still be a good fit when you only need a lightweight one-way push (like “new Pipedrive person → create MySQL row”) and you want the fastest setup. If you’re unsure, Talk to an automation expert and we’ll sanity-check the approach.

Once this is running, contact data stops being a recurring project. Your CRM and database stay in agreement, and your team can get back to work that actually moves revenue.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal