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

# How bidirectional syncs work

> An in-depth explanation of how syncs work between HubSpot and Unify.

## Overview

Unify can create and update HubSpot records in response to Play runs and
Sequence enrollments. This page summarizes the rules used to determine when and
how to create or update records in HubSpot.

## Sync timing

HubSpot read syncs are scheduled approximately every 15 minutes. HubSpot
association syncs run on a separate daily schedule to refresh relationships
between records. When a large number of records change quickly in HubSpot, the
next scheduled sync may take longer to complete, which can temporarily delay
the appearance of new or updated records in Unify.

When a HubSpot field mapping changes, Unify starts a background job to reprocess
all records for the affected object. This does not interfere with the regular
sync schedule, but it does mean that field mapping updates can take some time to
be fully reflected in Unify.

## Overwriting data

Unify takes a very conservative approach to overwriting existing HubSpot data in
order to make data loss impossible. This approach is based around only a few
simple rules:

* **Creating new records:** When Unify is creating a new HubSpot record, it will
  fill in all properties that are enabled for writing in the field mapping or
  default values.

* **Updating existing records:** Unify will inspect whether the field is empty
  or not. If the field is empty, it will be updated with the new value. If the
  field already has a value, it will only be updated if it is a Unify-specific
  field. These fields are prefixed with "Unify" and can be found
  [here](/reference/integrations/hubspot/field-mappings#available-fields).

These rules apply regardless of how the record was originally created (e.g., by
Unify or externally). If you're looking for more fine-grained control, you can
also limit the permissions granted to the Unify integration user in HubSpot.

## Duplicate prevention

Duplicates are strictly prevented within Unify. When creating new HubSpot
records, Unify will only ever create one record. If there is already an existing
HubSpot record of the same type, Unify will always update it rather than
creating a new one.

However, duplicates are a common problem in HubSpot and may already exist in
your HubSpot instance. In addition, users or other integrations may accidentally
create new duplicates over time.

In order to accommodate this reality, Unify follows specific rules to ensure
predictable behavior when updating duplicated HubSpot records. While Unify
cannot de-duplicate your HubSpot, it will *never* make the problem worse, and
in some situations may be able to help clarify the “source of truth” record.

## Supported objects

<AccordionGroup>
  <Accordion title="Contacts">
    If there is an existing contact that matches the Unify person being written, it
    will be updated. Matches are determined based on email address. If there are no
    matches, a new contact will be created.

    If there are multiple contacts that match the Unify person, only one will be
    updated. Specifically, the contact that was most recently modified within
    HubSpot is the one that will be updated.
  </Accordion>

  <Accordion title="Companies">
    HubSpot companies are written by Unify whenever a contact is created or updated.
    They are also written if a HubSpot sync action runs within a Play that is
    running on companies.

    If there is an existing company that matches the Unify company being written, it
    will be updated. Matches are determined based on the domain of the company
    website. Domains are normalized, so URLs that redirect to different domains will
    not result in duplicates. If there are no matches, a new company will be
    created.

    If there are multiple companies that match the Unify company, only one will be
    updated. Specifically, the company that was most recently modified within
    HubSpot will be updated.
  </Accordion>

  <Accordion title="Email messages">
    Unify does not update existing email messages in HubSpot; only emails sent
    through Unify or received in response to those emails will be written to
    HubSpot.

    Email messages are written to HubSpot for emails sent as a part of Unify
    Sequences and for replies to those emails. The corresponding person must already
    exist in HubSpot as a contact, or a Play action must sync the person to HubSpot
    before the email activity is written.
  </Accordion>

  <Accordion title="Tasks">
    Unify writes eligible Unify tasks to HubSpot as HubSpot tasks. This includes
    ready or completed non-email tasks, such as phone-call and action-item tasks,
    and completed email or reply tasks. Unify does not write email tasks to
    HubSpot before they are complete because completing an email task in HubSpot
    can imply that the email has been sent, while email sending is controlled in
    Unify.

    HubSpot tasks are associated with the corresponding HubSpot contact. If the
    corresponding person does not already exist as a HubSpot contact, Unify must
    sync the person to HubSpot before the task can be written.

    Task sync uses HubSpot's standard task properties instead of custom field
    mappings. Unify writes values such as the task subject, body, task type,
    status, priority, timestamp, and owner. When a task is deleted in Unify,
    Unify archives the matching task in HubSpot.

    HubSpot-to-Unify task sync is limited to completion updates. When a
    non-email HubSpot task that was written by Unify is marked complete in
    HubSpot, Unify marks the corresponding task complete in Unify. Email tasks
    are excluded from this completion sync.
  </Accordion>

  <Accordion title="Deals">
    HubSpot deals are read into Unify as opportunity records. They can be associated
    with companies and people when the HubSpot deal has the corresponding company or
    contact association.

    Deal data is primarily CRM-owned. Unify uses it for record context, filters, and
    exclusions, such as excluding companies with open opportunities from outbound
    Plays. Unify does not create or update HubSpot deals itself.
  </Accordion>
</AccordionGroup>
