> ## Documentation Index
> Fetch the complete documentation index at: https://docs.os.default.com/llms.txt
> Use this file to discover all available pages before exploring further.

# HubSpot enrichment in Default

> Enrich HubSpot contacts and companies with Default when a form is submitted or a HubSpot record is created, then write the enriched fields back to HubSpot properties.

Default enriches HubSpot records with a workflow. A trigger starts the run when someone submits a form
or a new record appears in HubSpot, an **Enrich Data** node looks up the person and company through an
enrichment waterfall, and a CRM node writes the results to HubSpot properties.

Default supplies the enrichment providers, **Clearbit**, **Apollo**, **People Data Labs**, and
**Wiza**, and bills lookups in credits. For how a waterfall picks its answers, see
[How enrichment waterfalls work](/enrichment/waterfalls).

## How HubSpot enrichment works in Default

A HubSpot enrichment workflow in Default runs these steps:

1. **Something starts the workflow.** A visitor submits a form on your site, which fires the
   **Form Submission** trigger, or a new contact or company appears in HubSpot, which fires
   **CRM Record Created**.
2. **Default enriches the lead.** An **Enrich Data** node runs your waterfall for the person's email,
   the company's domain, or both.
3. **Default checks HubSpot.** For a form submission, a **Match Record** node looks for an existing
   HubSpot contact, so the workflow does not create a second contact for an email HubSpot already has.
4. **Default writes the fields to HubSpot.** A **Create Record** node creates the contact with the
   enriched properties, or an **Update Record** node adds them to the existing record.
5. **The run is logged.** The run log shows what each provider returned, the credits used, and the
   properties written. See [Run logs](/workflows/run-logs).

## Triggers for HubSpot enrichment

| Trigger | Fires when | Enrich from | Use it to |
| - | - | - | - |
| **Form Submission** | A visitor submits a form the Pixel tracks, including embedded HubSpot forms. | The submitted email. | Enrich leads before they reach HubSpot. |
| **CRM Record Created** | A new **Contact**, **Company**, or **Deal** appears in HubSpot. | The contact's email or the company's domain. | Enrich records that HubSpot creates, for example from imports, HubSpot's own forms, or reps. |
| **CRM Record Updated** | An existing HubSpot record changes. | The contact's email or the company's domain. | Fill missing fields on older records. See [Backfilling missing CRM fields](/enrichment/backfill). |
| **API** | Your server calls the workflow through the public API. | The submitted email. | Enrich leads from your own systems. |

The CRM triggers become available once HubSpot is connected. See
[HubSpot](/settings/integrations/hubspot) and [Triggers](/workflows/triggers).

## Enrichment starts before the form is submitted

On a form the Pixel tracks, Default starts enriching as soon as the visitor types an email address and
leaves the email field, before they submit:

* **What runs.** Default runs your workspace's **Primary Waterfall** for the email, and for the
  company domain when the email is a work address. It also runs the waterfall's email and IP
  validation checks when they are on.
* **What the workflow gets.** When the form's workflow reaches an **Enrich Data** node that uses the
  same waterfall, the node reads the person and company results that are already waiting instead of
  calling those providers again, and those lookups are not charged a second time. The waterfall's email
  and IP validation checks run again in the node and are charged again.
* **What it costs.** The early lookup uses credits like any other lookup, including for visitors who
  leave without submitting.
* **When it does not run.** Without a primary waterfall, Default skips the early lookup, and the
  **Enrich Data** node calls the providers when the workflow reaches it.

To get the benefit, set the waterfall your form workflow uses as the primary waterfall. See
[Set a waterfall as primary](/settings/configurations/waterfalls#set-a-waterfall-as-primary).

## Write enriched fields back to HubSpot

Default writes to HubSpot with CRM nodes from the **Records** section of **Add Node**:

| Node | Use it when | Where the enriched values go |
| - | - | - |
| **Create Record** | The contact or company does not exist in HubSpot yet. | **Mapped Fields** |
| **Update Record** | The record exists, because the trigger or a **Match Record** node supplied its ID. | **Fields** |

For each HubSpot property, open the data picker and choose a value under the **Enrich Data** node's
**Person** or **Company** result, for example **Title**, **Seniority**, **Industry**, or
**Employee Count**. Which fields come back depends on what the providers return for that lead.

How Default handles the values:

* **Empty results do not clear properties.** When the enrichment returned nothing for a field, Default
  skips that mapped property, so a miss never blanks out a HubSpot value. Choose **Set field to null**
  in the value picker only when you intend to clear a property.
* **Existing values are overwritten.** **Update Record** replaces the property's current value with
  the enriched one. If reps also edit a property by hand, write enriched values to separate properties,
  or leave existing contacts unchanged as in the form example below.
* **HubSpot's Create Record has no Update on conflict.** Check for an existing contact with
  **Match Record** first. If HubSpot rejects a create because a unique property already has that value,
  the node creates nothing, continues with the existing record when HubSpot reports its ID, and the run
  goes on. See [Duplicate CRM records](/enrichment/duplicates).

## Enrich new HubSpot contacts from a form

This example enriches every demo request, creates a HubSpot contact for new leads with the enriched
properties, and leaves existing contacts as they are.

<Steps>
  <Step title="Add the trigger">
    In **Workflows**, create a workflow and add the **Form Submission** trigger. Set
    **Connected Form** to your demo request form.
  </Step>

  <Step title="Add the Enrich Data node">
    Select **Add Node**, then choose **Enrich Data** in the **Enrichment** section. Set
    **Enrichment target** to **Both** and **Enrichment source** to your primary waterfall. Leave
    **Email / Domain (optional)** empty so Default uses the submitted email and its domain.
  </Step>

  <Step title="Check for an existing contact">
    Add **Match Record** from the **Records** section. Set **CRM** to **HubSpot** and **Record** to
    **Contact**, and under **Match Details** match the contact's email to the submitted email.
  </Step>

  <Step title="Create the contact on the No Match branch">
    On the **No Match** branch, add **Create Record**. Set **Platform** to **HubSpot** and
    **Record Type** to **Contact**. Under **Mapped Fields**, map the email and name from the form, then
    map enriched values into properties such as `Job Title` and `Phone Number`.
  </Step>

  <Step title="Leave the Match branch unchanged">
    Leave the **Match** branch without an **Update Record** node, so an existing contact keeps the
    values your team already has. Add an **Update Record** node there only for properties that Default
    owns.
  </Step>

  <Step title="Test, then publish">
    Select **Test**, choose the **Form Submission** trigger, enter a test email, and select
    **Run Test**. Check the new contact in HubSpot and the **Enrich Data** step in the run log. Then
    select **Publish** and turn on the [deployment switch](/workflows#the-enabled-switch) so the
    status reads **Live**.
  </Step>
</Steps>

<Warning>
  A workflow test performs real actions. It creates the HubSpot contact and uses enrichment credits.
  Use a test email you can delete.
</Warning>

## Enrich contacts created in HubSpot

This example enriches every contact that appears in HubSpot, whatever created it.

<Steps>
  <Step title="Add the trigger">
    Add the **CRM Record Created** trigger. Set **CRM** to **HubSpot** and **Record** to **Contact**.
    Optionally, add a **Condition**, for example on the contact's lifecycle stage.
  </Step>

  <Step title="Add the Enrich Data node">
    Add **Enrich Data**. Set **Enrichment target** to **Person** or **Both**, and
    **Enrichment source** to your waterfall. Set **Email / Domain (optional)** to the contact's email
    from the trigger.
  </Step>

  <Step title="Write the fields back">
    Add **Update Record**. Set **Platform** to **HubSpot**, **Record Type** to **Contact**, and
    **Record to update** to the contact's record ID from the trigger. Under **Fields**, map each
    HubSpot property to an enriched value.
  </Step>

  <Step title="Test, then publish">
    Test with a sample contact, confirm the properties in HubSpot, then select **Publish** and turn on
    the [deployment switch](/workflows#the-enabled-switch) so the status reads **Live**.
  </Step>
</Steps>

To enrich companies the same way, set **Record** to **Company**, set **Enrichment target** to
**Company**, pick the company's domain for **Email / Domain (optional)**, and update the **Company**
record.

<Note>
  The write-back is a change to the record. If another workflow uses **CRM Record Updated** on the same
  HubSpot object, the write can start it. Give that workflow a **Condition** that uses
  **Fields Updated** and watches only properties this enrichment workflow does not write.
</Note>

## What HubSpot enrichment costs

HubSpot enrichment uses the same enrichment credits as any other lookup in Default:

* Each provider in the waterfall that returns data is charged. A miss is free, except for Clearbit
  and the email and IP validation checks.
* **Both** runs a person lookup and a company lookup, and each is charged.
* Writing to HubSpot uses no credits.

The **Enrich Data** node shows its maximum cost on the canvas. See
[How enrichment credits work](/enrichment/waterfalls#how-enrichment-credits-work).

## Troubleshoot HubSpot enrichment

| What you see | What to check |
| - | - |
| The company fields are empty for some leads | The email is a personal or disposable address, such as `gmail.com`, so Default skipped the company lookup. The run log records the reason. |
| The person fields are empty | The trigger had no email or LinkedIn URL for the person, or no provider found them. Open the **Enrich Data** step in the run log to see each provider's attempt. |
| A HubSpot property was not written | The enrichment returned no value for it, so Default skipped the property. Check the **Enrich Data** result in the run log. |
| A second contact appeared for the same person | Add a **Match Record** node before **Create Record**, and create only on the **No Match** branch. |
| A rep's value was replaced | **Update Record** overwrites current values. Map enriched values to separate properties, or skip the update for existing records. |
| The workflow runs again after it writes to HubSpot | A **CRM Record Updated** workflow picked up the write. Add a **Condition** that uses **Fields Updated** and watches only properties the write-back does not change. |
| **CRM Record Created** is not offered for HubSpot | Connect HubSpot in **Settings** → **Integrations**. |

Related: [Lead enrichment software from Default](https://www.default.com/product/lead-enrichment-software)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.