Two-way field-service sync
Syncs jobs, contacts and stages between CenterPoint Connect and HubSpot both ways, reconciles the edits CenterPoint cannot announce, and brings in job costs from QuickBooks Online.
Data paths and guards
- HubSpot: Where staff work: deals, tickets, contacts, companies and buildings, with the sync cards.
- QuickBooks via Make: QuickBooks Online bills, brought into HubSpot by Make.com scenarios.
- Zapier triggers: 4 triggers that carry CenterPoint’s job events.
- Sync service: TypeScript Edge Functions: the inbound webhooks, the outbound handler and the reconcile modes.
- State store: Mappings, sync status, logs and reconcile cursors, with the pg_cron schedules.
- CenterPoint Connect: The field-service system: jobs, properties, profiles, invoices and timesheets.
- From CenterPoint Connect to Zapier triggers: Job events. Opportunity, production and service events from CenterPoint. A Zapier trigger picks up a new or changed job.
- From Zapier triggers to Sync service: Posted with a shared secret. Each event, posted to its own function with a shared secret. Each of the 4 triggers.
- From Sync service to HubSpot: Deals, tickets, contacts. Records created or updated after a full read from the CenterPoint API, through the field and value mappings. Each inbound event, and each reconcile repair.
- From QuickBooks via Make to HubSpot: Bills for job cost. Supplier and material bills, which the sync then links to each job by its QuickBooks job number. Scheduled Make runs that pick up new bills.
- From HubSpot to Sync service: Property-change webhooks. Changes to 47 watched properties on deals, tickets, contacts, companies and buildings. A HubSpot webhook subscription.
- From Sync service to CenterPoint Connect: Edits written back. Mapped field and stage changes, written through the CenterPoint API. An edit that passes the echo filter.
- From Sync service to State store: Mappings, status, cursors. Field and value mappings, each record’s sync window, logs and reconcile cursors. Every run.
- From CenterPoint Connect to Sync service: Scheduled reconcile reads. Pages of CenterPoint records compared with HubSpot, for the edits that raise no event. pg_cron schedules, about 22 by September 2026.
- On Posted with a shared secret: Zapier retries dropped. An event that a Zapier retry sends again is dropped, and records are upserted on one standard key.
- On Deals, tickets, contacts: One create claim per job. Simultaneous webhooks for the same new job compete for one create claim, so they merge into one deal.
- On Edits written back: Three-layer echo filter. Changes made by the integration are skipped, each record gets a 60-second sync window, and every successful sync primes that window.
- On Scheduled reconcile reads: Stops on a failed read. A read that fails is never taken as an empty list, so a failed page cannot set off removals.
- On State store: Chained runs, saved cursors. A 55-second watchdog hands each reconcile run off well before the 150-second limit, and the next run picks up at its saved cursor.
- Built by me
- Platforms I connect to
- Guards
- In production
| Job events Opportunity, production and service events from CenterPoint |
|---|
| Posted with a shared secret Each event, posted to its own function with a shared secret |
| Deals, tickets, contacts Records created or updated after a full read from the CenterPoint API, through the field and value mappings |
| Bills for job cost Supplier and material bills, which the sync then links to each job by its QuickBooks job number |
| Property-change webhooks Changes to 47 watched properties on deals, tickets, contacts, companies and buildings |
|---|
| Edits written back Mapped field and stage changes, written through the CenterPoint API |
| Mappings, status, cursors Field and value mappings, each record’s sync window, logs and reconcile cursors |
| Scheduled reconcile reads Pages of CenterPoint records compared with HubSpot, for the edits that raise no event |
-
Systems
Staff sell and report in HubSpot, where QuickBooks Online bills arrive through Make. CenterPoint Connect runs the jobs, properties, profiles, invoices and timesheets. Between them run TypeScript Edge Functions on Supabase, with mappings, sync status and cursors in Postgres, and Zapier carrying CenterPoint’s job events.
-
Data paths
CenterPoint exposes job events only through Zapier. Each of 4 triggers posts to a function that reads the full record from the CenterPoint API and writes HubSpot through the mappings; a new job arrives in 26 seconds at the median. Make brings QuickBooks Online bills into HubSpot for job cost.
- a Job events
- b Posted with a shared secret
- c Deals, tickets, contacts
- d Bills for job cost
-
Write-back and reconcile
47 property-change subscriptions send HubSpot edits to one handler, which writes them to CenterPoint. Property and profile edits in CenterPoint raise no event at all, so 21 reconcile modes on pg_cron page through both systems and repair what drifted.
- e Property-change webhooks
- f Edits written back
- g Mappings, status, cursors
- h Scheduled reconcile reads
-
Guards
Echoes are filtered in three layers before anything is written back. Zapier retries are dropped, and simultaneous webhooks share one create claim. Reconcile runs stop on a failed read and chain past the time limit from saved cursors.
- Zapier retries dropped on b
- One create claim per job on c
- Three-layer echo filter on f
- Stops on a failed read on h
- Chained runs, saved cursors on g
-
Result
The sync covers 11,683 deals and 8,182 tickets. Edits sync in 8.7 seconds at the median, and a full reconciliation checked 17,557 deals and tickets with 0 errors.
Data typed twice, and edits that raise no event
Jobs lived in CenterPoint Connect, prospects in spreadsheets of roughly 5,000 rows and conversations in email and messaging apps, so staff typed the same data twice and leadership had no revenue reporting by property manager or management firm. CenterPoint exposes events only through Zapier triggers, and has no webhook at all for property or profile edits.
What I built
- A Supabase backend: 36 Edge Functions and 7 shared modules in 24,135 lines of TypeScript, with mappings, sync state and cursors in Postgres.
- Inbound: 4 Zapier triggers post to functions that read the full record from the CenterPoint API and write HubSpot through about 108 mapped fields.
- Outbound: 47 HubSpot property-change subscriptions feed one handler that filters echoes in three layers, then writes the change to CenterPoint.
- A 21-mode reconciliation engine on pg_cron that chains itself under the 150-second function limit, saves its cursors and fails closed on read errors.
- A HubSpot app with a settings page, a lead-creation card, two sync cards and four workflow actions.
- Reporting and cost layers: property manager and firm stamped on each deal, 35 milestone dates, and job costs that combine CenterPoint labor with QuickBooks Online bills brought in through Make.com.
What the guards protect against
| The risk | The guard |
|---|---|
| A retried trigger creates a second record. | Zapier retries dropped An event that a Zapier retry sends again is dropped, and records are upserted on one standard key. |
| Two webhooks for one job create twin deals. | One create claim per job Simultaneous webhooks for the same new job compete for one create claim, so they merge into one deal. |
| A sync write bounces back and loops between the two systems. | Three-layer echo filter Changes made by the integration are skipped, each record gets a 60-second sync window, and every successful sync primes that window. |
| A failed read looks empty and the reconcile strips every link. | Stops on a failed read A read that fails is never taken as an empty list, so a failed page cannot set off removals. |
| A long reconcile is cut off at the time limit and never reaches the rest. | Chained runs, saved cursors A 55-second watchdog hands each reconcile run off well before the 150-second limit, and the next run picks up at its saved cursor. |
Decisions
-
Skip a batch of changes if any of it came from the sync
- Chose
- The echo filter skips a whole webhook batch when any change in it was written by the integration.
- Instead of
- Skipping a batch only when every change in it came from the sync. HubSpot can add its own calculated date stamps to the same batch, so a batch set off by a sync write is not always all sync, and its echo would pass.
- Trade-off
- A person’s edit that shares a batch with a sync write is skipped too; checked over 30 days, that cost 0 legitimate syncs.
-
A failed read skips the record; it never reads as empty
- Chose
- When a CenterPoint read fails, the reconcile skips that record instead of acting on an empty answer; the same rule went into 4 more places before any removal schedule ran.
- Instead of
- Treating a failed read as an empty list. A removal routine would take the empty list as an order to strip every link the record has.
- Trade-off
- A record whose read fails is skipped, not repaired, on that run.
-
Cost the missing crew hours from timesheets, not labor bills
- Chose
- Crew hours the invoices left uncosted are read from CenterPoint timesheets and costed at each job’s own rate, with revenue held fixed.
- Instead of
- Adding labor from the QuickBooks Online bills. Those 794 labor bills carry a zero amount by QuickBooks design, and adding labor on top would count the same hours twice.
- Trade-off
- Missing hours are priced at each job’s own rate, and a margin that fails a plausibility check is left blank instead of shown.
Results
- The sync covers 11,683 deals and 8,182 tickets, live in both directions since February 2026.
- Median sync times from the logs: 8.7 seconds for an edit, across 122 events, and 26 seconds for a new job.
- A full reconciliation checked 17,557 deals and tickets with 0 errors and cut ticket-to-property mismatches from 4,975 to 2.
- History brought across: 9,526 deals linked, 5,702 tickets migrated and 4,043 contact profiles matched or created.
Kept from this build: a drift monitor has to walk every record, not sample the newest ones, so this one rotates through the whole population on a saved cursor.
Facts
- 54 HubSpot stages across 3 pipelines, mapped to CenterPoint workflows
- 1,963 syncs in 24 hours with 0 errors, measured in late July 2026
- A two-way end-to-end test passed 43 of 43: 19 deal checks and 24 ticket checks
- Milestone dates backfilled onto 10,714 deals and 6,580 tickets with 0 errors
- The crew-hour costing scanned all 6,512 invoices; a 200-deal simulation changed revenue on 0 deals
Related builds
-
Two-way ERP sync
Date: Aug 2026
Fact: 11,598 deals linked to the ERP
Client: For a commercial roofing contractor
Systems: Dataforma
Status: In production
-
Multi-tenant event processor
Date: Jun 2026
Fact: 10,630 events in 7 days through the queue that replaced Make.com
Client: For a multi-brand roofing company
Systems: AccuLynx and Make.com
Status: In production
-
QuickBooks job costing
Date: Aug 2026
Fact: On day one of a 3-day hackathon, an invoice posted through the approval gate
Client: For contractors on HubSpot (a hackathon build)
Systems: QuickBooks Online, Stripe and Claude
Status: Active