How HubSpot's Data Agent Enriches Company Records Inside Your Workflows
Every new company record, researched, summarised and segmented the moment it's created, with no Zapier and no manual research. Here's how to build it, and what to check before you let it write to the CRM.
Most CRMs are graveyards of half-filled company records and "I will fix it later" descriptions. But what if every new company that entered your portal was automatically researched, summarised, and segmented? Here is how to use HubSpot's native AI to build a self-cleaning, self-enriching lead engine.
Why is this hack helpful?
We are all for "mates first, colleagues second," but we are also for "efficiency first, manual grunt work never." Here is what actually changes once this is running: a rep opens a new lead and the company is already described and categorised, instead of a blank record they have to go and research themselves.
- Eliminate "tab fatigue": Your sales reps shouldn't have to be private investigators. By the time they open a lead, the AI has already told them what the company does and how big they are.
- Standardised data: Teams are creative, which is great for art but terrible for CRM data. AI follows your rules exactly, so every segment is labelled "SMB" or "Enterprise" without typos or "close enough" guesses.
- Instant, accurate routing: Because the segmentation happens the second the record is created, your routing workflows actually work. No more leads sitting in limbo because the "Company Size" field was left blank.
- No extra tool required: You don't need Zapier, Make, or a third-party enrichment tool with its own monthly line item for something similar. This is all happening inside HubSpot itself, which you are already paying for.
The governance side, because this is an automated decision
Before the steps: this workflow makes a decision about a business (SMB, Enterprise or Startup) and writes it to the record with nobody checking it first. That is worth naming plainly, because from 10 December 2026 the Australian Privacy Principles pick up a transparency obligation for automated decision making, and an AI writing a classification straight into a CRM record is exactly the shape of thing that obligation is aimed at.
APP 10, quality of personal information, is the other side of it. If the AI's two-sentence summary or its segment call is wrong and nobody corrects it, that is now an inaccurate record sitting in your CRM, not a harmless guess. Build in a way to tell a person made this apart from a machine did: keep the AI Research Summary and AI Segment properties clearly separate from properties a person fills in, and check a sample of them each month rather than assuming the model is always right.
This is the same posture we use whenever an agent gets write access to a CRM, covered in the checklist to run before you switch on an agent. And if you're wondering whether this needed to be an agent at all rather than a plain workflow, that's a fair question, one we answer in HubSpot AI agent or simple workflow.
Steps to set it up
Phase 1: Create the properties for AI output
AI needs somewhere to store its answers. That is your first job.
Step 1: Open the Properties settings
- In HubSpot, click the Settings gear icon
- In the left sidebar, go to Data Management > Properties
Step 2: Create the summary property
We want a free text field to store the AI generated company description.
- Click Create property
- Object: Company
- Group: pick whatever is logical for your portal (for example "AI" or "Enrichment")
- Label: AI Research Summary
- Field type: Multi-line text
- Click Next then Create
This will hold the two sentence summary the AI writes.
Step 3: Create the segment property
We want a dropdown that directly matches what the AI is allowed to output.
- Click Create property again
- Object: Company
- Label: AI Segment
- Field type: Dropdown select
- Add these options exactly:
- SMB
- Enterprise
- Startup
- Save the property
Important: the spelling and capitalisation here must match what you tell the AI. If the AI says "enterprise" and your dropdown says "Enterprise", that will not match.
Phase 2: Create the company-based workflow
Now we wire up the automation.
Step 1: Create the workflow
- Go to Automations > Workflows
- Click Create workflow > From scratch
- Choose Company based
- Click Next
Step 2: Set the enrolment trigger
We want this to run for every new company.
- Click Set up triggers
- Search and select Company properties
- Pick Create date
- Condition: is known
- Click Apply filter, then Save
This means: as soon as a company record exists (with a create date), it can enter this workflow.
Phase 3: Add and configure the Data Agent AI step
This is where HubSpot AI behaves like a tiny research assistant.
Step 1: Add the Data Agent action
- Inside the workflow, click the + icon to add an action
- Open the AI tab
- Choose Data Agent: Custom Prompt
You should now see the configuration panel for the Data Agent action.
Step 2: Choose the properties that the AI can read
Find the section Property to include with prompt (wording may vary slightly depending on your HubSpot version). Add:
- Name
- Company Domain Name (or Website depending on your property label)
- Description
These properties will be available inside your prompt as context for the AI.
Step 3: Write the AI prompt
In the Prompt box, paste this:
You are a research assistant. Look at the company Name, Domain, and Description provided.
- Write a 2-sentence summary of what this company does.
- Categorise this company as exactly one of the following: "SMB", "Enterprise" or "Startup".
- Return your answer as a JSON object with two keys: "summary" and "segment".
Why this works technically:
- You constrain the AI to three valid values: "SMB", "Enterprise", "Startup"
- You define a JSON structure so HubSpot can break the response into separate fields
- The keys summary and segment will be referenced in the next step
If the AI does not return valid JSON or uses different key names, the outputs will not map cleanly.
Step 4: Define the action outputs
This is the most important technical piece. You are telling HubSpot: "When the AI returns JSON, here is what each field is."
Scroll to the Action output section and set:
Output 1: summary
- Click Add output
- Key: summary
- Type: String
The key must match the JSON key from your prompt exactly ("summary").
Output 2: segment
- Click Add output again
- Key: segment
- Type: Enumeration
Add enumeration values: SMB, Enterprise, Startup. Again, case and spelling should match the prompt options.
Click Save on the Data Agent action. At this point, HubSpot now knows the AI will return a JSON object, and that object should contain summary (String) and segment (Enumeration).
Phase 4: Map Data Agent outputs into your properties
Right now, the AI's answers live only inside the action. We need to copy them into the company properties you created in Phase 1.
Step 1: Add an Edit record action
- Under the Data Agent step, click the + icon
- In the action search, look for Edit record
- Select Edit company (if HubSpot asks which record type)
Step 2: Map the summary output
In the Edit record action:
- Under Property to update, choose AI Research Summary
- In the New value field, click into the field, choose Action outputs, and select the summary output from your Data Agent step
This tells HubSpot: take the summary string from the AI and write it into the AI Research Summary property.
Step 3: Map the segment output
In the same Edit record action (or a second one if you prefer to separate them):
- Add another Property to update
- Choose AI Segment
- In the New value field, click into the field, choose Action outputs, and select the segment output from your Data Agent step
Click Save. Your workflow should now look roughly like: trigger (company create date is known), then Data Agent: Custom Prompt (with inputs, prompt, outputs), then Edit record (update AI Research Summary and AI Segment from action outputs).
Phase 5: Test the AI workflow
Do not skip this. It is much easier to debug one record than 5,000.
Step 1: Use the workflow Test tool
How much of your company data is still half filled in?
Most portals have a description field nobody has touched in years.
- In the top right of the workflow editor, click Test
- Choose Test with existing company
- Pick a real company record that has a website domain, and a sensible name and description if possible
- Click Run test
Step 2: Inspect the results
Once the test finishes, expand the Data Agent step in the Test panel and check that it returned a valid JSON response. You should see something like {"summary": "Example Ltd provides cloud-based accounting tools for small businesses.", "segment": "SMB"}.
Then check the Edit record step and confirm both properties were updated successfully. Open the company record itself and verify:
- AI Research Summary is filled with a two sentence summary
- AI Segment is one of SMB, Enterprise, or Startup
If one or both are empty, check that your output keys in Action output match the JSON exactly (summary, segment), and that your AI Segment property options match the enumeration values exactly, no extra spaces, no different case.
Optional: chain multiple AI agents in one workflow
Once the basics work, you can stack more intelligence on top. For example, directly after the Edit record action, you could add another Data Agent or Run AI action, use the new properties as input (AI Research Summary, AI Segment, Lifecycle stage), and ask the AI to generate a personalised intro line for a sales email, suggest talking points for the first call, or draft a short, segment-specific outreach email.
Because the first agent has already normalised and enriched the data, the second agent can focus purely on messaging.
Three rules so this doesn't fail silently
- Match your types and values. Dropdown options in HubSpot must match the allowed AI outputs word for word. If the AI answers with something not on that list, the update simply will not write.
- Always test with a single real record first. Use the Test button in the workflow editor, and check the Data Agent logs and the company record, not just one or the other.
- Watch your HubSpot AI credits. Each workflow run that hits the AI step consumes AI credits. Normal inbound volume is usually fine. If you plan to backfill tens of thousands of records, check your limits before you hit "Review and publish".
Set this workflow live, wait a week, then ask your sales team: "On a scale from 'I still have 20 tabs open' to 'I can actually focus on selling', how much did this help?"
Wrapping up
This hack is a simple but powerful way to bring AI into your HubSpot workflows without writing a single line of code. By automatically summarising and segmenting every new company, you save your sales team from tedious research and keep your CRM data clean and actionable.
Set it up and let the workflow do the research so your team can spend the time on the calls that actually close. If you're running several of these across the business, that's exactly the coordination problem Agent Hub is built to solve.
Worried an AI step could fail without anyone noticing?
Nothing errors when a workflow writes a confident wrong answer.
Ready to take your HubSpot automation further? Our AI engineering team can help, or let's chat about building smarter workflows that actually work for your team.