Skip to content
GTM Agent Weekly

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.

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

Problem

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.

Setup

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.

Prompt

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.

Tools

Steps

  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.

Results

Tutorial with no outcome data.

What goes wrong

Gotchas

  • 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.

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

Fill most CRM deal fields from calls and answer deal questions in Slack

After every sales call, this agent fills in the key deal fields in the CRM, like pain points and next steps, and answers deal questions in a chat channel. Reps stop retyping notes and handoffs to customer success get easier.

Works with AttentionSlack

  • Pipeline Hygiene / CRM
  • intermediate