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 why this specific setup is a game-changer for your ops and sales teams:

  • 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.
  • 100% Standardised Data: Teams are creative, which is great for art but terrible for CRM data. AI follows your rules perfectly, ensuring every segment is labelled exactly as "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.
  • Zero "Franken-stack" Required: You don't need Zapier, Make, or a third-party enrichment tool that costs an extra $200 a month. This is all happening inside the HubSpot ecosystem you are already paying for.

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

  1. In HubSpot, click the Settings gear icon
  2. 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.

  1. Click Create property
  2. Object: Company
  3. Group: pick whatever is logical for your portal (for example "AI" or "Enrichment")
  4. Label: AI Research Summary
  5. Field type: Multi-line text
  6. Click Next then Create

This will hold the 2 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.

  1. Click Create property again
  2. Object: Company
  3. Label: AI Segment
  4. Field type: Dropdown select
  5. Add these options exactly:
    • SMB
    • Enterprise
    • Startup
  6. 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

  1. Go to Automations → Workflows
  2. Click Create workflow → From scratch
  3. Choose Company based
  4. Click Next

Step 2: Set the enrolment trigger

We want this to run for every new company.

  1. Click Set up triggers
  2. Search and select Company properties
  3. Pick Create date
  4. Condition: is known
  5. 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

  1. Inside the workflow, click the + icon to add an action
  2. Open the AI tab
  3. 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 3 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

  1. Click Add output
  2. Key: summary
  3. Type: String

The key must match the JSON key from your prompt exactly ("summary").

Output 2: segment

  1. Click Add output again
  2. Key: segment
  3. 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
  • 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

  1. Under the Data Agent step, click the + icon
  2. In the action search, look for Edit record
  3. Select Edit company (if HubSpot asks which record type)

Step 2: Map the summary output

In the Edit record action:

  1. Under Property to update, choose AI Research Summary
  2. In the New value field:
    • Click into the field
    • Choose Action outputs
    • 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):

  1. Add another Property to update
  2. Choose AI Segment
  3. In the New value field:
    • Click into the field
    • Choose Action outputs
    • Select the segment output from your Data Agent step

Click Save.

Your workflow should now look roughly like:

  1. Trigger: Company create date is known
  2. Action: Data Agent: Custom Prompt (with inputs, prompt, outputs)
  3. Action: 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

  1. In the top right of the workflow editor, click Test
  2. Choose Test with existing company
  3. Pick a real company record that has:
    • A website domain
    • A sensible name and description if possible
  4. Click Run test

Step 2: Inspect the results

Once the test finishes:

1. In the Test panel, expand the Data Agent step
    • Check if it shows a valid JSON response

You should see something like:
json
Copy
{  

  "summary": "Example Ltd provides cloud-based accounting tools for small businesses.",  

  "segment": "SMB"  

}  

2. Check the Edit record step
    • Confirm that both properties were updated successfully

Then open the company record itself and verify:

  • AI Research Summary is filled with a 2 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)
  • Check 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:

  1. Add another Data Agent or Run AI action
  2. Use the new properties as input:
    • AI Research Summary
    • AI Segment
    • Lifecycle stage
  3. Ask the AI to:
    • Generate a personalised intro line for a sales email
    • Suggest talking points for the first call
    • 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.

3 golden rules so this does not quietly fail

  1. 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
  2. Always test with a single real record first
    • Use the Test button in the workflow editor
    • Check the Data Agent logs and the company record, not just one or the other
  3. 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 watch your workflows do the heavy lifting while you focus on what really matters, closing deals and growing your business.

Ready to take your HubSpot automation to the next level? Let’s chat about how to build smarter workflows that actually work for your team.