Resolving data sync conflicts

Updated: 2026-09-08Reading time: 5 min

Fix conflicts that arise when Cotonity agents sync data between two systems that have both been updated, covering conflict detection, resolution strategies, and last-write-wins versus field-level merging.

What causes sync conflicts

A data sync conflict occurs when the same record has been modified in both the source and destination systems since the last successful sync. For example, a contact's phone number is updated in HubSpot at 2:00 PM, and the same contact's phone number is independently updated in Salesforce at 2:15 PM, but the Cotonity sync agent only runs every hour. When the agent runs at 3:00 PM, it encounters two different values for the same field and must decide which one to use. Without an explicit conflict resolution strategy, the agent may overwrite the more recent change with the older one, resulting in data loss.

Configuring a conflict resolution strategy

Cotonity's data sync workflow template supports three built-in conflict resolution strategies: Last Write Wins uses the modification timestamp from each system to determine which change is more recent and applies that value; Source Wins always applies the value from the designated source system regardless of timestamps; and Manual Review queues conflicting records into a review list that a human can inspect and resolve. To set the strategy, open the sync workflow editor, navigate to the Conflict Resolution step, and select the desired mode from the dropdown. For most business use cases, Last Write Wins is the most appropriate default, as it reflects the most recent human action.

Field-level merge for partial updates

Last Write Wins applies at the record level by default, meaning the entire record from the winning system overwrites the entire record in the other system. This can cause data loss if the two systems each have authoritative ownership of different fields — for example, HubSpot owns marketing fields and Salesforce owns sales stage fields. To prevent this, switch the sync workflow to 'Field-level merge' mode and configure which system is authoritative for each field. In this mode, each field is independently resolved: the phone number comes from whichever system has the newer timestamp for that specific field, while the sales stage comes from Salesforce unconditionally because it is configured as authoritative for that field.

Auditing and replaying conflict resolutions

Every conflict resolved by a Cotonity sync workflow is recorded in the Conflict History log, accessible from the workflow's Activity tab by filtering by run type 'Conflict'. Each record shows the conflicting values from both systems, the resolution strategy applied, the winning value, and the timestamp. If you discover a batch of records were resolved incorrectly — for example, because the wrong system was designated as authoritative — you can select the affected records in the log and click 'Replay with updated strategy'. Cotonity will re-resolve the conflicts using the current strategy configuration, allowing you to correct bulk errors without manually editing each record.