Event polling and scheduling

Event polling and scheduling

The integration pulls changes out of Bullhorn through an event subscription. A scheduled poller reads the subscription on a fixed interval, turns the raw events into sync work items, and a set of standing maintenance jobs keeps the whole pipeline healthy without manual attention.

The poll cycle

Every cycle the poller:

  1. Checks whether the previous cycle committed its checkpoint. If not, it re-fetches the last batch from Bullhorn first so no event is ever lost, even if the org restarted mid-cycle.
  2. Reads up to Poll Max Events (default 500) from the subscription. If the subscription has expired on the Bullhorn side, it is recreated automatically in the same cycle with all active inbound entities.
  3. Consolidates the batch in memory: multiple events for the same record are folded into one, a record created and deleted inside one batch is dropped entirely, and events caused solely by the integration user are filtered out so our own writes do not echo back (disable with the Disable Echo Filter setting).
  4. Applies the relevance gate: updates that touch none of a mapping's careAboutFields are stored as Skipped; entities with no active inbound mapping are ignored.
  5. Stores the surviving events as BH Sync Event records with Status Pending and advances the checkpoint in the same transaction. A full batch immediately triggers a follow-up poll.

Failed cycles never advance the checkpoint. Each failure increments a consecutive-failure counter that the watchdog monitors.

Scheduler control

Polling runs from cron entries named BHSyncPoll_mm, one per minute offset in the hour. The interval comes from the Poll Interval Minutes setting and is normalized to a value that divides the hour evenly (1, 2, 3, 5, 6, 10, 12, 15, 20 or 30 minutes).

Standing maintenance jobs

These are created automatically when the package is installed and re-created if missing:

Job Schedule What it does
BHSyncWatchdog Hourly at minute 17 Self-healing: recreates missing poll cron entries while the scheduler is Running, kicks off a poll when the heartbeat is older than three intervals, resets events stuck in Processing for over 30 minutes back to Pending, marks the scheduler Degraded after more than five consecutive poll failures, and returns a Degraded scheduler to Running once polling succeeds again.
BHSyncRetry_00/15/30/45 Every 15 minutes Flips Failed events whose retry backoff has elapsed (and that still have retries left) back to Pending so they are processed again.
BHSyncPurge Daily at 03:00 Deletes Completed and Skipped events older than Event Retention Days (default 30) and API usage ledger rows older than 90 days.

Scheduler status values

Status Meaning
Running Cron entries active, polling normally.
Stopped Polling switched off by an administrator. Nothing is read from Bullhorn.
Degraded More than five consecutive poll failures. The watchdog keeps attempting recovery and restores Running after the next successful poll. Check the connection settings and Bullhorn credentials if the status stays Degraded.

Installation behavior

Installing or upgrading the package seeds the sync state checkpoint and default settings, and schedules the maintenance jobs. It never starts polling on its own: an administrator starts the scheduler deliberately after credentials are configured and the connection test passes.