BACK TO BLOG
USE CASESOctober 26, 202610 min read

Clean CRM Duplicates and Stale Deals With an n8n Agent

JH

By Joris van Huët

Enterprise Interim CMO & Marketing Leader · 15+ years · 50+ orgs

Published

2026-10-26

The short answer: if nobody owns the upkeep of a HubSpot or Pipedrive account with a few thousand contacts, a weekly n8n agent that lists duplicate pairs and stale deals, and merges nothing until one person approves each pair in Slack, costs $24 a month on n8n Starter and uses 4 or 5 of its 2,500 monthly executions, because a Schedule Trigger counts one execution each time it fires, per the n8n pricing page (checked on 26 October 2026) and its executions page. HubSpot's own duplicates tool needs a Professional subscription; merging by hand or through the API works on the free tools. For example, if the Monday cleanup takes 2 hours by hand and 30 minutes as a review of the agent's list, 90 minutes x 4 weeks = 360 minutes, six hours a month back.

Disclosure: I may earn a commission through some links on this site. It does not change what this page says.

The job: a buyer exists twice, once from the webinar and once from the demo form, so their history is split and two reps think they own them. Meanwhile the pipeline carries deals nobody has touched since summer, and the forecast counts them. Both problems are dull to find and risky to fix, because a merge in either CRM is permanent. So the agent does the finding and a person does the fixing, one approval at a time. Background on the tools is in the HubSpot, Pipedrive and n8n entries.

What to settle first:

  1. The cost of one run. A Schedule Trigger counts one execution every time it fires, per n8n's executions page. For example, a weekly run is 52 executions a year. The model only reads the candidate pairs a Code node builds, so 40 pairs a week means 40 short comparisons, not a pass over 4,000 contacts.
  2. The rules your CRM already uses. HubSpot's duplicates tool compares first name, last name, email, IP country, phone, zip code and company name, per its duplicates article; Pipedrive flags people who share a name and also a phone number, an email or an organization, per its matching rules. Copy the rule you trust into the Code node, so the agent's list and the CRM's own logic agree.
  3. A definition of stale you did not invent. HubSpot sets Is Stalled After Timestamp when a deal's time in its stage runs 20% longer than the owner's closed-won average for that stage, per its deal properties. In Pipedrive, the rotting days you set per stage do the same job; the Pipedrive how-to covers setting them.
  4. Permissions and one reviewer. A HubSpot service key with read and write access to contacts and deals, as n8n's credentials page recommends; in Pipedrive, merging is for admins or users given that permission, per its merge article. Name one reviewer, the person who answers for the CRM.
  5. The baseline, dated. Before the first run, write down three numbers: candidate pairs per 1,000 contacts, open deals past the stale line, and the value of those deals.

The weekly run, step by step

  1. Trigger. A Schedule Trigger on a Weeks interval, Monday at 07:00, with the workflow's timezone set. The docs are blunt about one thing: save and publish the workflow, or the schedule never runs.
  2. Pull and pair. The HubSpot node runs Get all contacts and Search deals. A Code node, once for all items, groups contacts by lowercased email and then by name plus company, and passes on only the pairs. It also keeps the open deals whose Last Activity Date is older than your line, or that carry a stalled timestamp. On n8n Cloud the Code node cannot import npm modules, so write the matching in plain JavaScript.
  3. The agent reads and proposes. An AI Agent node takes the pairs and the stale deals. Its read tool is the HubSpot node with Get a contact, which the node page says can run as an agent tool, so it can compare both records' activity. For each pair it answers same person, different people or unsure, and for a match it names the surviving record and says why. For each stale deal it writes one line to the owner: last activity, its date, and the question to answer. It has no tool that edits a deal.
  4. The human check. The merge tool is an HTTP Request node calling HubSpot's merge contacts endpoint, which keeps the primaryObjectId record and folds the other into it. It sits behind a Human review step on Slack, set up as in n8n's human-in-the-loop guide, so each proposed merge arrives as its own message with both records and the reason. Approve and the merge runs; deny and nothing happens. HubSpot's merge article states that merged records cannot be unmerged, which makes this click the only undo there is.
  5. Output. Approved merges land in HubSpot, where the Merged contact IDs property keeps the trail. A Slack node with the Send operation posts each owner's stale deals to the sales channel, the agent's question beside each, and the owners move, update or close the deals themselves. Add every denied pair to an exceptions list inside the Code node, so it stops coming back each Monday.

The law gives this job a deadline of sorts. Article 5(1)(d) of the GDPR requires personal data to be accurate and, where necessary, kept up to date, with every reasonable step taken to erase or rectify inaccurate data without delay. A dated weekly review with a named approver is a step you can show.

If the CRM is Pipedrive

The shape stays the same; three parts change. Pipedrive's plan features article lists Merge duplicate data on every plan, Lite included, so the in-app list of flagged pairs costs nothing extra. n8n's Pipedrive node has no merge operation, so the tool behind review calls the merge persons endpoint, where merge_with_id names the person who is kept and whose values win a conflict; the merge article adds that merged items cannot be un-merged.

Stale is where Pipedrive needs care. Its rotting article bases the timer on the deal's last updated time and says the feature disregards the next activity date, so a deal with a meeting booked for next month can still turn red. Tell the agent to read the next activity before it calls a rotten deal dead. The filters guide carries a recipe for a rotten-deals filter, which gives the Code node a ready list.

The free version

For a CRM one person can scan in an hour, the manual routine is the whole job.

  • HubSpot. Export the contacts, sort the sheet by email and then by name and company, and merge the pairs by hand from the record's Actions menu, which the merge article lists on all products and plans. For deals, a saved view filtered on Last Activity Date older than your line, also on every plan, is the Monday agenda with the owners.
  • Pipedrive. Open Merge Duplicates from Tools and apps, read each flagged pair and choose the primary record, per the merge article. Run the rotten-deals filter for the stale list.
  • Automation without a bill. n8n's Community Edition is self-hosted and free, per the pricing page. Slack approvals then need the instance on public HTTPS, per n8n's Slack approvals page.

What the agent adds is the reading. It opens both records of every pair, compares their activity and hands the reviewer a decision, not a spreadsheet.

What it costs

LineFree routePaid route
HubSpotMerge by hand or through the API, free toolsDuplicates tool on Professional; Sales Hub Professional is $100 per seat a month paid monthly
PipedriveMerge duplicate data on every planSeat prices on the pricing page
n8nCommunity Edition, self-hostedStarter, $24 a month, 2,500 executions
ModelYour own provider keyGateway credits or your own key

Checked on 26 October 2026. Billed annually, Sales Hub Professional is $90 per seat a month on the HubSpot pricing page and n8n Starter is $20 a month on the n8n pricing page. Pipedrive's pricing page refused automated reading on that date, so no Pipedrive price is quoted here; the two features this job needs, merging and rotting, are on every plan per its features article. The model line depends on the provider: n8n Cloud deducts Gateway credits at the rates on its service pricing page.

How to know it worked

  • Duplicate rate. Candidate pairs per 1,000 contacts each Monday, against the baseline. Once the backlog is merged, the level it settles at is the rate your forms and imports create new duplicates, and the source field on the newest pairs tells you where they are born.
  • Stale share. Open deals past the line, by count and by value. The value is the number the forecast was inflating.
  • Precision. Approved merges divided by proposed merges. Many denials mean the Code node's rule is too loose; tighten it before you trust the agent with more.
  • Holdout. Leave one pipeline, or one owner's book, out of the digest for six weeks. If its stale count falls as fast as the rest, the quarter end did the work, not the agent.

Where the upgrade pitch lands

HubSpot puts the duplicates tool on Professional and Enterprise subscriptions only, while the merge itself, from a record or through the API, works on every plan; the Professional seat pays for the list of pairs, and a weekly Code node writes that list for one execution. Buy the seat when the list stops being the bottleneck, for example when a reviewer works through hundreds of pairs a week and bulk merging, which the duplicates article puts on a Data Hub subscription, would save more than it costs.

FAQ

Can a merge be undone?

No, in either CRM. HubSpot's merge article says merged records cannot be unmerged, though for contacts you can create a new record from the merged email addresses; Pipedrive's merge article says the same of its merges. That is why the review step sits on the merge tool and nowhere else.

Why not let the agent merge exact email matches without asking?

It can: n8n's human-in-the-loop guide has you connect only the tools that need approval to the review step. Keep every merge reviewed until a few weeks of approvals show no denials on exact matches. A shared inbox address on two real people is the case that breaks the rule.

What should the agent do with a stale deal?

Ask, not act. HubSpot's stalled timestamp and Pipedrive's rotting both measure silence, and silence is not a lost deal; the owner knows whether the buyer went quiet or the deal moved to email nobody logged. The digest puts the question in front of the owner, and the owner changes the stage.

TAGS
CRM HygieneDuplicate RecordsAI Agentsn8nHubSpotPipedrive

ABOUT THE AUTHOR

I am Joris van Huët, an enterprise interim CMO. 15+ years, 50+ organizations, including ING, P&G, Nestlé, BNP Paribas, WeTransfer and Vinted. I take on innovation projects (venture building, design sprints), agentic marketing (setting up and running AI agents) and hands-on multi-channel work. See the track record.

I wrote and published this with AI assistance, and I answer for it. Claims about my own experience are limited to the track record above, and a statistic links to its source or is labelled as an example. I sell interim and fractional CMO work, which is why this site exists. How this site is written.

Agentic marketing, built for your team

The agents in this article, built into your workflows and handed over to your team: the first one within two weeks.