Retry and error handling

Retry and error handling

Every unit of sync work in either direction is a BH Sync Event record. The event carries what happened, why it failed if it failed, and when it will be tried again. Nothing fails silently: an event always ends in a terminal status you can see and act on.

Event lifecycle

Status Meaning
Pending Queued, waiting for a processor. Events are picked up automatically within seconds of entering Pending
Processing Claimed by a running batch
Completed Done. Processed At and the Salesforce record id are stamped on the event
Skipped Deliberately not processed. Typical case: an inbound update that touched none of the mapping's careAboutFields (Error Stage shows RelevanceGate). Skipped is informational, not an error
Failed Something went wrong. Error Stage and Error Description say what; Next Retry At says when it is tried again
Retry_Scheduled Rescheduled without consuming a retry attempt, used when Bullhorn rate limits a batch
Dead The retry budget is exhausted. Only a manual retry revives it

Error stages

The Error Stage field pinpoints where in the pipeline the failure happened:

Stage Where it failed Typical causes and fixes
config Loading the entity mapping Mapping missing, inactive or invalid JSON. Validate the mapping record
fetch Reading the record Bullhorn record not found, Bullhorn API error, or (outbound) the Salesforce source record was deleted
dependency Resolving a parent A required parent could not be found or created, or (outbound) a required parent has no Bullhorn id yet. Sync the parent first, then retry
map Building the target record Bad value for the target field type, a transformer error, or a field mismatch. Check the mapping and the payload on the event
push Writing to Bullhorn Bullhorn rejected the create or update. The Bullhorn error message is in Error Description
dml Writing to Salesforce Validation rules, required fields, duplicate rules or field level security in your org
rate_limit Bullhorn throttling Handled automatically, see below
unhandled Anything unexpected Read Error Description; report to 3B support if unclear
RelevanceGate Not a failure Appears on Skipped events only: the update was not relevant to the mapping

Automatic retry

A 15 minute sweep re-drives failed events:

Rate limiting is treated differently: when Bullhorn throttles, the whole batch is rescheduled at least 5 minutes out with status Retry_Scheduled and no retry attempt is consumed. Rate limited events recover on their own.

Manual retry

Two places, same behavior: the retry resets the retry budget and works on Dead events too.

Retries are always safe to repeat. Inbound processing upserts by external id and re-fetches the current Bullhorn state, so replaying an event can never duplicate records or resurrect stale data.

Apex equivalent for admin tooling:

bh_3b.BH_SyncApi.retryEvents(new Set<Id>{ eventId });

Watchdog behavior

An hourly watchdog keeps the pipeline healthy without manual attention:

A Degraded status therefore means polling kept failing repeatedly; check the connection credentials and Remote Site Settings, then watch the dashboard. Details on the poller itself are in Event polling and scheduling.

Where to look first

  1. Dashboard error queue: filter by entity, read Error Stage and Error Description.
  2. The BH Sync Event record: the raw event payload and timestamps are stored on it.
  3. Mapping workspace: open the mapping and use Validate to see current configuration errors.
  4. Scheduler health card: heartbeat age and consecutive failures for connection level problems.