- Auto-research new leads
- Keep contact data current
- Provide sales context automatically
- Generate talking points for outreach
- Track enrichment history
Overview
This workflow automatically enriches contacts the moment they’re created or updated in HubSpot. It:- Receives webhook from HubSpot (contact created/updated)
- Looks up full contact details
- Searches web for company news and info
- Uses AI to analyze and summarize intelligence
- Updates contact with enrichment data
- Creates timeline event to track enrichment
What You’ll Need
HubSpot Setup
HubSpot Workflow (to trigger enrichment):- Trigger: Contact created OR Contact property changed
- Action: Send webhook to Agent.AI
- Payload includes:
contact_id
,contact_email
,contact_company
company_overview
(Multi-line text) - AI-generated company summaryrecent_news
(Multi-line text) - News summarytalking_points
(Multi-line text) - Sales talking pointsrelevance_score
(Number) - 1-10 priority ratingoutreach_approach
(Multi-line text) - Recommended approachlast_enriched
(Date) - Track when enriched
- Read Contacts
- Write Contacts
- Read Timeline Events
- Write Timeline Events
Agent.AI Setup
Actions needed:- Webhook Trigger
- Lookup HubSpot Object (V2)
- Get Search Results (web search)
- Invoke LLM
- Update HubSpot Object (V2)
- Create Timeline Event (V2)
- Web search API access (Google, Bing, or similar)
- LLM access (OpenAI, Anthropic, etc.)
Step-by-Step Setup
Step 1: Create the Agent.AI Workflow
Add trigger: Webhook Configuration:- Copy the webhook URL (you’ll need this for HubSpot)
- Expected variables from HubSpot:
_hubspot_portal
(automatically included)contact_id
(contact’s HubSpot ID)contact_email
(contact’s email)contact_company
(contact’s company name)
Step 2: Setup HubSpot Workflow
In HubSpot:- Go to Automation → Workflows
- Create workflow
- Trigger: Contact created OR Contact property “Email” is known
- Add action: Send webhook
- Webhook URL: Paste Agent.AI webhook URL from Step 1
- Method: POST
- Payload:
- Save and activate
Step 3: Lookup Full Contact Details
Add action: Lookup HubSpot Object (V2) Configuration:- Object Type: Contacts
- Lookup by: Lookup by Object ID
- Object ID: Click
{}
→ selectcontact_id
(from webhook) - Retrieve Properties: Click ”+ Add Property” and select:
firstname
lastname
email
company
jobtitle
phone
city
state
country
industry
hs_object_id
- Retrieve Associations: Select “Companies” (get associated company records)
- Output Variable:
contact_data
Step 4: Web Search for Company Info
Add action: Get Search Results (or Web Search) Configuration:- Query: Type text and insert variables:
- Click
{}
→contact_data
→properties
→company
- Type ” news funding products recent”
- Click
- Number of Results: 5
- Output Variable:
web_research
Step 5: AI Enrichment Analysis
Add action: Invoke LLM Configuration:- Prompt:
- Model: gpt-4 (or your preferred LLM)
- Output Variable:
enrichment_insights
Step 6: Update Contact with Enrichment
Add action: Update HubSpot Object (V2) Configuration:- Object Type: Contacts
- Identify by: Lookup by Object ID
- Identifier: Click
{}
→ selectcontact_id
(from webhook) - Update Properties: Click ”+ Add Property” and select custom properties:
company_overview
: Click{}
→enrichment_insights
→company_overview
recent_news
: Click{}
→enrichment_insights
→news_summary
talking_points
: Click{}
→enrichment_insights
→talking_points
relevance_score
: Click{}
→enrichment_insights
→relevance_score
outreach_approach
: Click{}
→enrichment_insights
→outreach_approach
last_enriched
: Type[now]
or use current date variable
- Output Variable:
updated_contact
Step 7: Log Enrichment Activity
Add action: Create Timeline Event (V2) Configuration:- Object Type: Contacts
- Target Object ID: Click
{}
→ selectcontact_id
- Event Type:
contact_enriched
- Event Title: “Contact Enriched with AI Insights”
- Event Description: Type “Enriched contact with company research and AI analysis. Relevance score: ” then click
{}
→enrichment_insights
→relevance_score
- Event Properties: (optional)
- Event Timestamp: Leave blank (uses current time)
- Output Variable:
enrichment_event
How It Works
Execution flow:- Contact created in HubSpot (e.g., from form submission)
- HubSpot workflow fires webhook to Agent.AI with contact ID
- Lookup gets full contact profile from HubSpot →
contact_data
- Web Search finds recent company news →
web_research
- AI Analysis combines contact + news → generates insights →
enrichment_insights
- Update writes enrichment data to contact record in HubSpot
- Timeline Event logs that enrichment occurred
Example Output
What the AI Generates
For contact “John Doe, VP Engineering at Acme Corp”:What Appears in HubSpot
In the contact record, sales reps see: Company Overview: “Acme Corp is a fast-growing enterprise AI platform company…” Recent News: “Recent $50M Series B funding announced. New enterprise features…” Talking Points: “1. Congratulate on recent $50M Series B funding 2. Discuss new enterprise features…” Relevance Score: 9 Outreach Approach: “High-priority contact. VP of Engineering at well-funded…” Timeline Event: “Contact Enriched with AI Insights - Relevance score: 9”Customization Ideas
Different Trigger Conditions
In HubSpot workflow:- Trigger on specific forms (only enrich demo requests)
- Trigger on lifecycle stage change (enrich when MQL)
- Trigger on company property change (re-enrich when company changes)
Industry-Specific Research
Customize web search query:- Tech companies: “[company] funding product launch tech news”
- Manufacturing: “[company] acquisitions capacity expansion news”
- Healthcare: “[company] FDA approvals clinical trials news”
Different Enrichment Focus
Adjust AI prompt for different goals: For sales:Conditional Enrichment
Add If Condition after lookup:- Only enrich if
jobtitle
contains “VP”, “Director”, “C-level” - Only enrich if
relevance_score
> 7 - Only enrich if company size > 100 employees
Multi-Language Support
For international contacts:- Detect
country
from contact data - Adjust web search language
- Request AI response in appropriate language
Troubleshooting
Webhook Not Firing
Agent.AI workflow doesn’t run when contact created Causes:- HubSpot workflow not active
- Webhook URL incorrect
- Contact doesn’t meet trigger criteria
- Check HubSpot workflow status (Automation → Workflows)
- Verify webhook URL matches Agent.AI URL exactly
- Test with a contact that definitely meets trigger conditions
- Check HubSpot workflow execution history
No Web Results
Web search returns empty or irrelevant results Causes:- Company name is generic or missing
- Search API limit reached
- Company is very small/new
- Check
contact_data.properties.company
has a value - Add fallback: If no company, skip web search
- Broaden search query (remove specific terms)
- Add If Condition to skip search if company is empty
AI Response Not Formatted
Enrichment insights malformed or not JSON Causes:- LLM didn’t follow format instructions
- Web results overwhelming token limit
- Make prompt more explicit: “Return ONLY valid JSON”
- Reduce web search results from 5 to 3
- Try GPT-4 instead of GPT-3.5 (better at structured output)
- Add error handling with Set Variable action
Properties Not Updating
Contact updated but enrichment fields empty Causes:- Custom properties not created in HubSpot
- AI returned unexpected format
- Variable path wrong
- Create all custom properties in HubSpot first
- Check execution log - what did AI return?
- Verify variable paths:
enrichment_insights.company_overview
notcompany_overview
Enrichment Too Slow
Workflow takes 30+ seconds Causes:- Web search slow
- LLM processing large context
- Multiple API calls stacking
- Reduce web search results (5 → 3)
- Simplify AI prompt
- Use faster LLM model (GPT-3.5 instead of GPT-4)
- Consider async processing
Tips & Best Practices
✅ Do:- Test with a few contacts before activating for all
- Create all custom properties in HubSpot first
- Use specific, relevant web search queries
- Monitor LLM costs (each contact = 1 LLM call)
- Review AI-generated insights for accuracy
- Add timestamp to track when enriched
- Log enrichment to timeline for audit trail
- Enrich every contact (filter for quality leads only)
- Use vague search queries (be specific)
- Forget to handle missing company names
- Skip error handling for web search failures
- Enrich contacts without email or company data
- Re-enrich same contact multiple times per day
- Only enrich contacts above certain score threshold
- Use cheaper LLM for simple enrichment
- Limit web search to 3 results
- Add cooldown period (don’t re-enrich within 30 days)
- Web search is public data only
- Don’t store sensitive info in custom properties
- Follow GDPR/privacy regulations
- Allow contacts to opt out of enrichment
Related Resources
Actions used: Related workflows:- HubSpot Deal Analysis - Similar AI analysis pattern
- HubSpot Customer Onboarding - Multi-step automation example
Last Updated: 2025-10-01