Skip to content

Catch duplicate leads and missing fields with an n8n Salesforce agent

This agent checks new and changed leads for duplicates, including the same company spelled differently, and cleans them up with narrow, careful steps. The CRM stays tidy without someone hunting duplicates by hand.

Curated by Andrew Donato, Editor. Reviewed .

Get one setup like this every Thursday, by email.

Written for sales leaders running leaner teams.

Free. One email a week. Unsubscribe anytime.

Paste this into ChatGPT, Claude or your agent tool. See the prompt

  • Pipeline Hygiene / CRM
  • intermediate
  • RevOps
Category
Pipeline Hygiene / CRM
Difficulty
Intermediate
Est. cost
Not stated by source

Works with

Want this running on your team by next week? We'll set it up with your tools.

What problem does this solve?

Flow rules cannot read free text or spot that two leads are the same company spelled differently. Someone has to notice and fix those records by hand.

How is the agent set up?

A Salesforce Trigger node in n8n polls for new or changed leads and hands each to an AI Agent node. The agent has one narrow Salesforce tool per action (search, get, update) and searches by company domain before creating anything. Every create or update passes through a Slack approval step; searches run without approval.

Want this built for your team? Let's talk.

What prompt does it use?

Starter prompt by The GTM Agent Weekly, written from the setup described on this page. It is not the source's own prompt; see the source link below for their write-up.

Starter prompt · 27 lines
# ROLE
You check each new or changed lead for duplicates and missing fields before anything new is
created in the CRM. Any change you want to make needs human approval.

# TOOLS
- search(query): find leads, contacts and accounts. Runs without approval.
- get(id): read a record. Runs without approval.
- update(id, fields): change a record. Needs approval.

# INPUTS
- {{LEAD}}: the new or changed lead. {{REQUIRED_FIELDS}}: fields every lead must have.

# TASK
1. Search by company email domain first, then by exact email, then by company name.
2. If a likely duplicate exists, propose a merge or link, showing both records side by side
   and the fields that match.
3. If required fields are missing, propose values only where another record or the lead's
   own data supports them; otherwise list them as "needs rep input".
4. Send every proposed change to {{APPROVAL_CHANNEL}} with approve and reject.

# OUTPUT
"Duplicate: yes or no", matching records with links, proposed changes, missing fields.

# GUARDRAILS
- Never create or update without approval. Never delete.
- Never treat a personal email domain (gmail and similar) as a company match.
- One narrow action per tool call; log every proposal and decision.

Replace every {{PLACEHOLDER}} before running. Works with any capable LLM and runner.

Get 5 setups like this every week, free.

Real agent setups with prompts, sources and failure modes, in one short weekly email.

Free. One email a week. Unsubscribe anytime.

What tools does it use?

How do you set it up?

  1. Start in a sandbox or on one object no other team depends on.
  2. Add Salesforce nodes as separate tools for search, get and update instead of one broad tool.
  3. Have the agent search leads and contacts by domain before creating or updating anything.
  4. Leave fields blank when the source text does not support a value.
  5. Gate writes behind Slack approval and loosen only the lowest-risk writes after weeks of correct results.

What results are reported?

Tutorial with no outcome data.

What goes wrong

Where does this break?

  • Every call counts against the org's daily API limit; search, get and update per record can triple usage.
  • An agent that invents a plausible value is worse than one that leaves the field blank.
  • Salesforce feeds reporting and compensation, so unreviewed writes can break other teams' numbers.

This is where most teams get stuck. Want us to handle the setup?

Source and credit

www.theagentecosystem.com ›

Muhammad Qasim Hammad, The Agent Ecosystem · newsletter

Source dated 2026-08-06 · last reviewed 2026-10-11. Summarized in our own words; see the source for details.

Related.

Flag booked meetings where the prospect barely committed

When a meeting gets booked, this agent reviews the call and flags ones where the prospect barely committed. Managers can firm up or requalify those meetings before a salesperson spends time on them.

Works with any of NooksOrumOutreach +11

  • Pipeline Hygiene / CRM
  • intermediate
  • Reference setup

Clean the CRM weekly with an agent that proposes fixes you approve

Once a week, this agent reviews the CRM for duplicates, bad values, gaps and dead deals and proposes fixes that a person approves before anything changes. Cleanup becomes routine instead of a rushed purge.

Works with HubSpotSalesforceSlack +1

  • Pipeline Hygiene / CRM
  • intermediate

Keep the CRM clean with a Clay pipeline that only fills blanks

Every new or changed contact runs through Clay rules that merge true duplicates, catch job changers and fill empty fields without overwriting what a person typed. Bulk writes wait for the CRM owner's sign-off.

Works with HubSpotSalesforceSlack

  • Pipeline Hygiene / CRM
  • advanced