A weekly audit that finds dirty data in HubSpot, fixes what is safe, and queues the rest.
This system keeps HubSpot clean without hand checks. It reads all contacts, checks five common issues, fixes titles with AI, flags contacts that should not be mailed, merges duplicates safely, and posts one Slack summary. The baseline test had 38 flagged out of 56. After the first fix run, flagged dropped and duplicates went to zero on rerun.
It is built with HubSpot for contacts, n8n for the scheduled workflow, Gemini for title cleanup, and Slack for reporting. Email verification is simulated in n8n for now and can be swapped to Clay with one URL.
Each part can run alone. Detection runs with zero external calls. Verification can swap from simulated to real Clay with no other changes. Writes are idempotent.
https://www.loom.com/share/538da9efa4224e54a686e4ebd3628481
| Tool | Role |
|---|---|
| HubSpot | Holds contacts and receives status flags and merges |
| n8n | Runs on schedule, checks all conditions, writes back, posts to Slack |
| Gemini 2.5 Flash | Cleans job titles into structured Persona and Seniority |
| Slack | One audit card with counts and a link to HubSpot |
| Clay Simulated | Local heuristic for verification. Real webhook path is scaffolded |
graph LR
A[HubSpot<br/>Read All Contacts] --> B[Check 5 Conditions<br/>Local]
B --> C[Verify Email<br/>Simulated Clay]
C --> D[Fix Titles<br/>Gemini<br/>Persona and Seniority]
D --> E[Flag Unmarketable<br/>invalid or catch all<br/>or departed]
E --> F[Merge Duplicates<br/>name plus domain<br/>no conflicting emails]
F --> G[Slack<br/>Audit Card<br/>counts and Top 5]
style A fill:#111111,stroke:#111111,color:#ffffff
style B fill:#111111,stroke:#111111,color:#ffffff
style C fill:#111111,stroke:#111111,color:#ffffff
style D fill:#111111,stroke:#111111,color:#ffffff
style E fill:#111111,stroke:#111111,color:#ffffff
style F fill:#111111,stroke:#111111,color:#ffffff
style G fill:#111111,stroke:#111111,color:#ffffff
Classify every contact against five dirty conditions with no API spend. Write per contact hygiene_status as clean or flagged or needs review, plus hygiene_flags and hygiene_last_audited.
| Step | Check | What it does |
|---|---|---|
| 1 | Read Contacts | Fetch all contacts with Hygiene props and company association. Portals over 100 need pagination. Sandbox is under 100 so it is correct here |
| 2 | missing_fields | No email, no jobtitle, no lifecyclestage, or no company. 10 hits at baseline |
| 3 | malformed_title | Junk title: all caps, Boss, Chief-Thing, has slash or comma, or !!! . 13 hits go to Gemini |
| 4 | catch_all and invalid_email | From verification status or inferred from disposable domain or catch all local part. 4 plus 4 hits |
| 5 | departed | Departed checkbox or hard bounce flags. Sandbox uses Hygiene checkbox as stand in. 7 hits |
| 6 | duplicate | Same normalized name plus company domain. Needs non empty name and domain. Refuses conflicting emails. 5 pairs found |
| 7 | Write hygiene props | Set hygiene_status, hygiene_flags and hygiene_last_audited per contact |
Per contact status with clean or flagged or needs_review and flags CSV. Run summary with baseline 18 clean and 38 flagged, steady state 37 clean and 16 flagged after merges. Workflow file is importable SDK source and fixture is hubspot-contact-read.json.

Live Contacts in HubSpot — every row has a flag, status and audited date. This is the detector firing.