# Referral Syncing

Keep your referrals up to date across your CRM and cloud partners — automatically.

---

## Overview

After you share an opportunity or accept an inbound referral, Suger keeps that referral **continuously in sync** across three systems — your **CRM** (Salesforce or HubSpot), **Suger**, and the **cloud partner** (AWS, Azure, or GCP) — for the entire life of the deal.

A change made in one place is automatically reflected in the others, with no manual re-entry. Syncing runs in the background on a regular schedule, and you can also trigger it on demand.

:::info
Syncing is different from **sharing** and **accepting**, which create a referral in the first place. See [Outbound Referral](./3.cosell-outbound.md) and [Inbound Referral](./4.cosell-inbound.md) for those steps. This page covers what happens _afterward_ — keeping the referral up to date.
:::

## How Syncing Works

Suger syncs referrals in two directions:

**Outbound — from your CRM to the cloud partner.**
When you update an opportunity/deal in your CRM (for example, the close date, stage, or deal value), Suger pushes those changes out to the cloud partner's co-sell portal. You control exactly which fields are kept in sync from the [Sync Fields](./1.cosell-configuration.md#sync-fields) configuration.

**Inbound — from the cloud partner to your CRM.**
When the cloud partner updates a referral on their side (for example, the status changes, a stage advances, or new details are added), Suger pulls those changes back into the matching opportunity/deal in your CRM.

Only fields that actually changed are updated. Suger compares the latest values on each side and leaves everything else untouched, so syncing never overwrites unrelated data in your CRM.

## How Often It Syncs

Syncing happens automatically in the background:

- **Inbound** (partner → CRM) — about every **3 hours**. Partner-side changes are usually picked up much sooner: **AWS** and **GCP** deliver event notifications to Suger (AWS EventBridge, GCP Pub/Sub) that trigger an immediate sync of the affected referral, and Suger additionally polls for new **AWS** and **Azure** referrals about every **10 minutes**.
- **Outbound** (CRM → partner) — about every **6 hours**.

To keep scheduled syncs fast, most of them are **incremental** — each run only looks at what changed recently:

- The scheduled **outbound** sync only re-syncs opportunities/deals that your CRM reports as modified within the last **7 days** — based on the record's last-modified timestamp (Salesforce: `SystemModstamp`; HubSpot: `hs_lastmodifieddate`). Exception: if your [Sync Fields](./1.cosell-configuration.md#sync-fields) configuration was changed within the past **2 days**, the scheduled run performs a **full sync** instead, so the new mappings are applied to every referral.
- The scheduled **inbound** sync window depends on the cloud partner: **AWS** pulls referrals the partner modified within the last **30 days** (based on the ACE opportunity's `LastModifiedDate`), **Azure** pulls referrals modified within the last **24 hours**, and **GCP** re-checks all referrals on every run.

A [manual sync](#run-a-sync-manually) has no such window — it re-syncs everything.

The **Last Update Time** shown on each referral reflects its most recent successful sync.

## Run a Sync Manually

You don't have to wait for the next scheduled sync. From the co-sell referrals table, use:

- **Inbound Sync** — pull the latest referrals and updates from a cloud partner into Suger. Use this if a referral is missing or seems delayed.
- **Outbound Sync** — push your CRM opportunities to the cloud partner's co-sell portal right away.

Unlike the scheduled sync, a manual sync is a **full sync**: it re-reads the current CRM values of every active referral, with no recent-change window. This makes it the way to push changes the scheduled sync can't detect — such as formula field updates (see [Troubleshooting](#troubleshooting)).

Each option lets you choose the cloud partner (AWS, Azure, or GCP). Once a sync starts, Suger runs it in the background.

You can check the status of any sync — automatic or manual — in the **Logs** table under **Metrics → Logs**. Set the **Workflow Type** filter to **Sync** for per-referral sync runs, or **Batch Sync** for the scheduled and manually triggered batch runs that process many referrals at once. Each entry shows the run's status (such as _Completed_ or _Failed_), provider, and timestamp.

## What Gets Synced

- **Referral fields** — the fields you configured under [Sync Fields](./1.cosell-configuration.md#sync-fields) (outbound) and your inbound field mappings.
- **Status & stage** — the partner's status and stage are mapped to Suger's unified status. See [Status & Stage](./2.cosell-status.md).
- **Contacts** — customer contact details are synced into your CRM. For AWS, contact information is shared 10–30 minutes after a referral is accepted; see [Inbound Referral](./4.cosell-inbound.md).

Referrals in an inactive state — Draft, Rejected, Expired, or Deleted — are not synced in either direction. Closed referrals (Closed Won / Closed Lost / Closed Error) are no longer pushed **outbound**, but they still receive **inbound** updates from the cloud partner.

## Troubleshooting

**My change hasn't appeared yet.** Automatic sync runs every few hours. If you need it sooner, run a manual sync.

**A formula (calculated) field changed in my CRM but never synced.** Salesforce computes formula fields at read time — when a formula's inputs change (for example, a field on the related Account), the opportunity record itself is not modified, so Salesforce [does not update its last-modified timestamp](https://help.salesforce.com/s/articleView?id=005239151&language=en_US&type=1). The scheduled outbound sync relies on that timestamp to detect changes, so formula-only updates are invisible to it — the partner side keeps the old value. To fix: run a manual **Outbound Sync** (a full sync that reads the current formula values), or add a Salesforce Flow that touches the opportunity whenever the formula's inputs change so the scheduled sync picks it up.

**A field changed back to a different value.** When the same field is updated in both your CRM and the partner portal between syncs, the most recent change wins. If a field shouldn't be synced at all, adjust your [Sync Fields](./1.cosell-configuration.md#sync-fields) configuration.

**A referral shows "Update Failed".** Hover over the status to see the error message, fix the underlying data, and the next sync will retry. See [Status & Stage](./2.cosell-status.md) for error troubleshooting.
