CRM
Nightly Duplicate-Contact Sweep with Survivorship Scoring
On a nightly schedule, scans the full HubSpot contact database for duplicate clusters, applies survivorship scoring to elect a master record per cluster, merges them, and stores…
How it runs
The automated pipeline, trigger to output.
- TriggerNightly schedule fires
- ActionRead all HubSpot contacts into Postgres staging tablePostgres
- LogicCluster duplicates and compute survivorship scores
- ActionMerge clusters onto elected master in HubSpotHubSpot
- ActionWrite per-cluster audit log to PostgresPostgres
- OutputSend merge digest to SlackSlack
What it does
This is the batch counterpart to event-driven dedupe. Every night it pulls the entire contact set, groups records into duplicate clusters by deterministic match keys, then elects one master per cluster using a survivorship score that weights source trust, field completeness, and recency. It merges each cluster and records a full audit log.
When to use it
Use it for periodic database-wide cleanup when duplicates accumulate faster than real-time merging catches them, or after a large import. It is the safety net that reconciles records the event trigger missed.
How it works
- 1A nightly schedule starts the sweep.
- 2The flow reads all contacts from HubSpot and stages them in a Postgres working table.
- 3A logic step clusters records by email, normalized phone, and fuzzy name, then scores each for survivorship.
- 4For every multi-record cluster it merges fields onto the elected master and marks the rest for archival in HubSpot.
- 5A per-cluster audit log (cluster id, master, merged ids, winning sources) is written to Postgres.
- 6A Slack digest reports clusters merged, records archived, and any low-confidence clusters held for manual review.
Set it up
What you configure once, before turning it on.
- 1Connect HubSpotCRM, deals, marketing, support.
- 2Connect PostgresAny Postgres URL — query, write, migrate.
- 3Connect SlackChannels, DMs, threads, mentions.
- 4Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
- 5Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
- 6Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.
More CRM workflows
Backfill Intercom conversation topics onto stale HubSpot contacts
Finds HubSpot contacts with no recent Intercom topic, pulls their conversation history from Intercom, classifies the dominant topic with OpenAI.
Daily orphaned-opportunity sweep with manager Slack digest
Each morning this scans Salesforce for open opportunities owned by inactive users and posts a per-manager digest in Slack listing the orphaned deals that need a new owner.
AI-Personalized Dormant Account Win-Back
On a dormancy anniversary, an agent researches the account's history and recent public signals, drafts a genuinely personalized win-back email.
Dormant Account Anniversary Re-engagement Email
Each day, finds Attio accounts whose last activity was exactly N months ago and sends each owner's contact a personalized re-engagement email from Gmail.
Dormant Account Check-In Call Scheduler
On the anniversary of an account's last touch, books a tentative check-in call on the owner's Google Calendar and emails the contact a scheduling invite.
Weekly Dormant-Anniversary Cohort Digest
Every week, groups dormant Attio accounts by which last-touch anniversary they hit that week, builds a prioritized digest.
Run it inside a business
This workflow drops into a full company template. Import the org, and this is one of the playbooks its agents run.

Run this workflow in your colony.
14-day trial. No DevOps. No Sales call. Provisioned in under a minute.
