CRM

Dedupe a Postgres contacts staging table before CRM import

On a new batch upload, it normalizes and clusters duplicate rows in a Postgres staging table, collapses each cluster into one survivor with a merge keymap.

CategoryCRM
Enginesim
Difficultyintermediate
Triggerevent
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerNew batch lands in staging tablePostgreSQLPostgres
  • LogicNormalize emails, phones, and names
  • LogicCluster rows and pick survivor per group
  • ActionWrite survivors and merge keymap to PostgresPostgreSQLPostgres
  • OutputPost collapse summary to SlackSlack

What it does

Cleans contact data in a Postgres staging table before it ever touches your CRM. It normalizes emails and phone numbers, groups duplicate rows, merges each group into a single survivor filling gaps from siblings, and records which source rows mapped to which survivor.

When to use it

Use this ahead of bulk imports or migrations when raw CSVs and integrations dump dirty rows into staging. It keeps duplicates out of the live CRM and preserves a keymap so you can trace any survivor back to its original rows.

How it works

  1. 1A new batch landing in the staging table triggers the run.
  2. 2Normalize email casing, strip phone formatting, and standardize names in place.
  3. 3Cluster rows by normalized email and name, then pick a survivor per cluster and coalesce non-null fields.
  4. 4Write survivors to a clean table plus a source-to-survivor keymap for lineage.
  5. 5Send a Slack summary of how many rows collapsed, the merge ratio, and any clusters needing manual review.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect PostgresAny Postgres URL — query, write, migrate.
  2. 2
    Connect SlackChannels, DMs, threads, mentions.
  3. 3
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  4. 4
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  5. 5
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.