Sync Peerbound advocacy signals to HubSpot every night

By General Input

Each night, refresh your HubSpot companies with their latest customer story, review count, and advocate status from Peerbound so reps always know who to ask for a reference.

Integrations

  • Peerbound
  • HubSpot

Type

Deterministic Code

Categories

  • Sales
  • Operations

Every night at 2am, sync Peerbound customer-proof signals into HubSpot so our company records reflect who is an advocate, what their latest story is, and how recent their third-party reviews are. This should be a code workflow on a cron trigger. It is a deterministic field-level sync with no language-model calls and no fuzzy matching.

On each run:

1. Call Peerbound List Stories with updated_since set to the watermark stored from the last successful run. Paginate through all results using the returned cursor until has_more is false.

2. Call Peerbound List Reviews with the same updated_since watermark. Paginate the same way.

3. Group every returned story and review by its embedded account.hubspot_id. Skip any record whose account does not carry a HubSpot company id.

4. For each grouped HubSpot company id, build an update payload from the most recent non-deleted story and review on file: peerbound_is_advocate (true if any non-deleted story exists for the account), peerbound_latest_story_url and peerbound_latest_story_date (from the newest live story), peerbound_review_count (count of non-deleted reviews), and peerbound_latest_review_rating (from the newest live review).

5. If every story and review tied to an account has is_deleted set to true on the Peerbound side, instead set peerbound_is_advocate to false and clear the latest_story_url and latest_story_date fields. This keeps deletions in sync.

6. Call HubSpot Update Company once per affected company id with the resulting payload. Treat 404s as warnings and continue (the company may have been deleted in HubSpot). Treat 429s as retry-after-backoff using the Retry-After header.

7. After all updates succeed, persist the new watermark (the max updated_at observed across both story and review responses this run) so the next nightly run only pulls new changes.

On the very first run there is no watermark, so omit updated_since and treat the full result set as the seed. The Peerbound HubSpot company properties (peerbound_is_advocate, peerbound_latest_story_url, peerbound_latest_story_date, peerbound_review_count, peerbound_latest_review_rating) must already exist as custom properties on the HubSpot Company object before this workflow runs.

Related prompts

Explore more prompts
Turn Mailjet email clicks into ranked HubSpot follow-upsiMessage campaign console with pre-flight checks and delivery boardA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationLusha prospecting workbench with credit-safe revealsWhich companies your LinkedIn ads reach, matched to your CRMLead response desk with a running clock on every new leadApprove Lusha enrichment field by field before HubSpot saves it