Skip to content

Weekly

Get a weekly report of duplicate leads

Each week you get the groups of leads that share an email address, ready for you to merge.

Runs
Weekly
Apps
Salesforce
AI
Not needed
Access
api (read)

Send this to your assistant

Create a ClickRuntime automation: every Sunday at 6pm, find Salesforce leads that share an email address and email me each group with names and created dates.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Lead duplicates creep into Salesforce from every direction: a prospect fills out a form twice, a list import overlaps with leads reps typed in, two reps each add the same contact from a trade show. The effect is quiet but costly. Two reps email the same person, reporting counts one buyer as two, and lead conversion rates look worse than they are. Salesforce's duplicate rules block some cases at creation, but anything that arrived before the rules, or by import, slips through.

Weekly, the automation runs an aggregate SOQL query that groups leads by Email and returns any address that appears more than once. It then fetches the matching records and emails you the list with names, owners and creation dates, so you can see which ones to merge. It only reads data. Sales operations teams use it to keep the lead table clean.

What you get out of it

  • Reps stop contacting the same person twice

    When two owners have the same prospect, someone gets a confusing second email. Finding these pairs weekly prevents the awkward duplicate outreach that makes a company look disorganized. A prospect receiving the same intro twice from different reps often replies to neither.

  • Reports reflect real buyers

    Lead counts, conversion rates and source analysis all depend on unique records. Cleaning duplicates weekly means marketing and sales are arguing about real numbers, not inflated ones. If 12 percent of leads are duplicates, your conversion rate is understated by about that much.

  • Merge decisions made with context

    The list shows owner and creation date for each pair, so you can keep the older record with history and merge the newer one. That avoids losing notes when records are combined.

  • Problems get found at the source

    If duplicates repeatedly come from one form or import, the weekly list shows the pattern. You can fix the intake process rather than cleaning the same mess every Monday. Three duplicates from the same webinar form usually mean its hidden field mapping is wrong.

  • Small cost, steady hygiene

    Checking for duplicates manually is a chore nobody schedules. A weekly email makes it a ten-minute task that fits into an ordinary week and prevents a large cleanup later. Ten minutes on Monday beats the afternoon needed to dedupe 2,000 records after a year.

How it works

What happens, step by step

  1. Once a week, ClickRuntime looks for email addresses that appear on more than one Salesforce lead.

  2. It fetches each of those leads with its name and created date.

  3. You get an email grouping the duplicates by email address, ready for you to merge.

Before it runs live

  • Connect Salesforce

What you get

RunsWeekly
Get a weekly report of duplicate leadstoday, 9:00Succeeded
Email · 3 duplicate lead emailsops@acme.example - Jo Acme (created 2026-08-02) - Jo Smith (created 2026-10-11)

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Salesforce steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
weekly_duplicate_lead_report.pyexample
from clickruntime import on_trigger, credentials, http, notify

API = "https://yourcompany.my.salesforce.com/services/data/v61.0"

@on_trigger
def run(event):
    headers = {"Authorization": f"Bearer {credentials.connection('salesforce', 'work')}"}
    query = lambda q: http.get(f"{API}/query", headers=headers, params={"q": q}).json()["records"]
    groups = query("SELECT Email, COUNT(Id) n FROM Lead WHERE Email != null AND IsConverted = false "
                   "GROUP BY Email HAVING COUNT(Id) > 1 LIMIT 200")
    if not groups:
        return {"groups": 0}
    emails = ",".join("'" + g["Email"].replace("'", "") + "'" for g in groups)
    leads = query(f"SELECT Name, Email, CreatedDate FROM Lead WHERE Email IN ({emails}) ORDER BY Email, CreatedDate")
    lines, last = [], None
    for lead in leads:
        if lead["Email"] != last:
            lines.append(f"\n{lead['Email']}")
            last = lead["Email"]
        lines.append(f"  - {lead['Name']} (created {lead['CreatedDate'][:10]})")
    notify.email_me(f"{len(groups)} duplicate lead emails", "\n".join(lines).strip())
    return {"groups": len(groups)}

FAQ

Common questions

Does it detect duplicates only by exact email match?
Yes, the query groups on the Email field, so it finds identical addresses. Variations in spelling or the same person with two different emails will not be caught. Matching on name and company needs a different query.
What if some leads have no email address?
Leads with a blank email are grouped together by the query unless excluded, so the setup should skip empty values. Your AI assistant can add that condition so blank addresses are not reported as one big duplicate.
Does the automation merge the duplicates for me?
No. It reports them. Merging is left to a person, because the right survivor depends on notes, ownership and activity history. Salesforce's standard merge tool can then be used on the listed pairs. Merge works best when someone compares owners, last activity and open tasks on each pair first.
What permissions does it need?
api (read). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (weekly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Get a weekly report of duplicate leads” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.