New Contact Hygiene Workflow
Build a HubSpot workflow that auto-enriches and stages new contacts upon creation. Sets lifecycle stage via the v4 Automation API, copies company name and industry from the associated company (UI step), and branches on completeness.
Run this skill in Claude Code:
/plugin marketplace add tomgranot/hubspot-admin-skills
/plugin install hubspot-admin@hubspot-admin-skills
/new-contact-hygiene-workflowNew Contact Hygiene Workflow
Build a workflow that automatically enriches every new contact at creation time. This ensures contacts enter the database with a lifecycle stage, company name, and industry before any human touches them.
What Is and Isnβt Scriptable
The v4 Automation API (stable) creates workflows programmatically, including βis unknownβ enrollment conditions via LIST_BASED filter criteria. Two pieces of this particular design still belong in the UI:
- Copy from associated object actions (copy company name/industry from the associated company) have no documented v4 action fields. Add them in the UI during review β or build the action once in the UI,
GET /automation/v4/flows/{flowId}, and extend the script with the exact field shapes your portal returns. - The notification branch (alert admin when a contact still has no company after the delay) depends on portal-specific recipients.
So the split is: the script creates the default-lifecycle-stage workflow via API; the enrichment copy actions and the notification branch are added in the UI. If you already run /enrich-company-name and /enrich-industry, their dedicated workflows cover the copy actions and this skillβs API-created workflow completes the intake picture.
Prerequisites
- HubSpot Marketing Professional or Enterprise plan
- A HubSpot private app access token (
HUBSPOT_ACCESS_TOKENin.env) with theautomationscope (for the API path) - Python 3.10+ with
uv - Workflow creation permissions in HubSpot
- Company association enrichment completed (run
/enrich-company-nameand/enrich-industryfirst for existing contacts)
Scripts
| Stage | Script | Run with |
|---|---|---|
| Before | scripts/before.py | uv run skills/new-contact-hygiene-workflow/scripts/before.py |
| Execute | scripts/execute.py | uv run skills/new-contact-hygiene-workflow/scripts/execute.py |
| After | scripts/after.py | uv run skills/new-contact-hygiene-workflow/scripts/after.py |
execute.py creates one workflow β βHYGIENE: Default Lifecycle Stage for New Contactsβ (enrollment: create date known AND lifecycle stage unknown; action: set stage to Lead; re-enrollment on) β disabled, for review before enabling. Extend it in the UI with the copy actions and notification branch per the design below.
Building the Workflow: Two Options
Option A (primary): run the scripts, then extend the created workflow in the UI with the copy-from-associated-company actions, the delay, and the no-company notification branch (Stage 3, steps 3-6).
Option B: build the whole workflow manually in the UI (all of Stage 3).
Alternatives: HubSpot Breeze AI provides minimal value for this workflow β it creates event-based (OR) triggers, and cannot create βis unknownβ conditions, copy-from-association actions, or re-enrollment rules. The Claude Chrome extension can drive the workflow builder UI directly and handles those cases. Both are secondary options.
Workflow Design
TRIGGER: Contact create date is known
(fires for every new contact)
β
βΌ
βββββββββββββββββββββββββββ
β Set lifecycle stage β
β = "Lead" (if empty) β
ββββββββββββββ¬βββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Copy company name from β
β associated company β
ββββββββββββββ¬βββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Copy industry from β
β associated company β
ββββββββββββββ¬βββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Delay: short wait β
β (3-10 min, rec: 5) β
ββββββββββββββ¬βββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β IF/THEN BRANCH: β
β Company name is unknown? β
ββββββββββββ¬βββββββββββββββ
β YES β NO
β β
βΌ βΌ
Retry Continue
copy (enriched)
+ notify
adminStep-by-Step Build Instructions
Stage 1: Plan
- Confirm the default stage for new contacts (Lead, unless your funnel differs).
- Decide who receives the βno company associationβ notification.
Stage 2: Before
- Confirm company enrichment processes have run for existing data.
- Run
uv run skills/new-contact-hygiene-workflow/scripts/before.pyto inventory workflows and check name collisions.
Stage 3: Execute
Option A: run uv run skills/new-contact-hygiene-workflow/scripts/execute.py, then open the created workflow in the UI and continue from step 3 below (copy actions, delay, branch). Option B: open HubSpot > Automation > Workflows > Create workflow, select βContact-basedβ, start from scratch, and follow all steps.
Set enrollment trigger:
- Property: βCreate dateβ > βis knownβ
- This enrolls every new contact automatically.
Add action: Set property value
- Property: βLifecycle stageβ
- Value: βLeadβ
- Condition: Only if lifecycle stage is unknown (use an if/then branch before this step, or rely on HubSpotβs βonly if emptyβ option if available in your plan).
Add action: Copy property
- Source: Associated company > βCompany nameβ
- Target: Contact > βCompanyβ property
Add action: Copy property
- Source: Associated company > βIndustryβ
- Target: Contact > βIndustryβ property
Add delay: a short delay (3-10 minutes, recommended: 5)
- Purpose: Allow time for company associations to sync (especially for form submissions or integrations that create contacts before associating them). Adjust the duration based on how quickly your integrations typically create associations.
Add if/then branch:
- Condition: Contact βCompanyβ property is unknown
- YES branch: Add internal notification to CRM admin β βNew contact {firstname} {lastname} ({email}) has no company association after enrichment attempt.β
- NO branch: No further action needed (contact is enriched).
Review settings:
- Re-enrollment: OFF (each contact should only go through this once)
- Unenrollment: None needed
- Time zone: Not applicable (no time-based actions beyond delay)
Turn on the workflow.
Stage 4: After
- Run
uv run skills/new-contact-hygiene-workflow/scripts/after.py(API path) to confirm the workflow exists and report enabled state. - Create a test contact manually. Confirm:
- Lifecycle stage is set to βLeadβ
- Company name copied from associated company
- Industry copied from associated company
- Create a test contact with no company association. Confirm:
- Admin notification fires after the configured delay
- Check workflow history for any errors in the first 24 hours.
Rollback
- Turn off the workflow in HubSpot > Automation > Workflows.
- Contacts already enriched retain their values β no destructive changes to undo.
- If lifecycle stages were set incorrectly, use the Search API to find contacts created after the workflow activation date and reset as needed.
Edge Cases
- Contacts created via import: These fire the trigger. If imports include company name/industry, the copy action will overwrite with the associated companyβs values. Consider excluding imported contacts via a list filter.
- Contacts without company associations: The copy action silently fails. The branch handles notification.
- Multiple associated companies: HubSpot copies from the primary associated company only.
Problems this skill solves
Related skills in Automation Workflows
/bounce-monitoring-workflowBuild a workflow to protect sender reputation through automated bounce monitoring. Auto-suppresses contacts above a configurable bounce threshold, alerts on hard bounces, and flags high-bounce contacts for weekly manual review.
/engagement-suppression-workflowBuild a two-tier sunset workflow that re-engages dormant contacts before suppressing them. Tier 1 triggers a re-engagement campaign after a configurable inactivity window. Tier 2 suppresses contacts that fail to re-engage within a configurable re-engagement window.
/lifecycle-progression-workflowBuild workflows to automate contact progression through the sales funnel: Lead to MQL to SQL to Opportunity to Customer. Each transition is triggered by a specific event (score threshold, meeting booked, deal created, deal won).
/workflows-as-codeExport all HubSpot workflows to versioned JSON files via the v4 Automation API, diff exports over time, and restore or recreate workflows from JSON. Treats workflow definitions like code: backed up, reviewable, and recoverable.