Lightyear LogoLightyear Docs

Sync integrations

Keep data between two services in sync automatically

Sync integrations

Sync integrations go beyond one-off automations. Instead of writing scripts that push data from A to B, you declare a relationship between two services and Unscrambled keeps them in sync continuously.

Sync integrations build on top of the automations layer. Make sure you're familiar with automations first.

How it works

A sync integration defines:

  1. Two services — the source and destination (or bidirectional)
  2. Object mapping — which objects map to each other (e.g., HubSpot contacts to Mailchimp subscribers)
  3. Field mapping — which fields correspond (e.g., email to email_address)
  4. Sync direction — one-way or bidirectional
  5. Conflict resolution — what happens when both sides change the same record

Unscrambled handles the rest: initial baseline sync, incremental updates, deduplication, and retry logic.

Create a sync

unscrambled sync create hubspot-mailchimp

This scaffolds a sync configuration:

import { defineSync } from "@unscrambled/sdk";
 
export default defineSync({
  name: "hubspot-mailchimp",
  title: "HubSpot → Mailchimp contacts",
 
  source: {
    service: "hubspot",
    object: "contacts",
    fields: ["email", "firstname", "lastname", "company"],
  },
 
  destination: {
    service: "mailchimp",
    object: "members",
    list: "main-audience",
    fields: [
      "email_address",
      "merge_fields.FNAME",
      "merge_fields.LNAME",
      "merge_fields.COMPANY",
    ],
  },
 
  fieldMap: {
    email: "email_address",
    firstname: "merge_fields.FNAME",
    lastname: "merge_fields.LNAME",
    company: "merge_fields.COMPANY",
  },
 
  direction: "one-way",
  schedule: "*/30 * * * *",
});

Deploy and monitor

# Deploy the sync
unscrambled sync deploy hubspot-mailchimp
 
# Check status
unscrambled sync status
SYNC                   DIRECTION    STATUS      LAST SYNC        RECORDS
hubspot-mailchimp      →            ✓ In sync   5 minutes ago    1,247 contacts

Bidirectional sync

For two-way sync, set direction: "bidirectional" and define a conflict resolution strategy:

export default defineSync({
  name: "hubspot-salesforce-contacts",
  title: "HubSpot ↔ Salesforce contacts",
 
  source: { service: "hubspot", object: "contacts" },
  destination: { service: "salesforce", object: "Contact" },
 
  direction: "bidirectional",
 
  conflictResolution: "most-recent-wins",
  // Other options: "source-wins", "destination-wins", "manual"
 
  schedule: "*/15 * * * *",
});

Sync lifecycle

  1. Baseline sync — On first deploy, Unscrambled fetches all records from both sides, matches them by a key field (usually email or external ID), and creates the initial mapping
  2. Incremental sync — On each scheduled run, only changed records are fetched and synced
  3. Full sync — Periodically (configurable), a full sync runs to catch any records that may have been missed by incremental polling
# Trigger a full sync manually
unscrambled sync run hubspot-mailchimp --full
 
# View sync history
unscrambled sync runs hubspot-mailchimp

Use cases

  • CRM to email marketing — Keep HubSpot contacts synced with Mailchimp audiences
  • Project management — Mirror Jira issues in Linear (or vice versa)
  • CRM consolidation — Keep contacts in sync across HubSpot and Salesforce
  • Support to CRM — Sync Intercom conversations as HubSpot deals
  • HR to payroll — Keep employee records consistent across BambooHR and Gusto

On this page