Skip to content
NEWMarketplace and your team: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Data Sync & ETL

Data Sync & ETL

Sync warehouse customer data from Postgres to HubSpot and Segment

Hashes PostgreSQL rows and pushes only changed records to HubSpot contacts and Segment identify calls, tracking sync state and reporting results to Slack.

What it does

## Reverse ETL: Warehouse to SaaS Applications ### How it works Continuously pushes data from your warehouse (PostgreSQL) into SaaS tools so sales, marketing and support work with the same numbers as analytics. 1. Detect changes: every row is hashed. Only rows whose hash differs from the last successful sync are sent, so unchanged data never costs an API call. 2. Map & deliver: warehouse columns are mapped to each destination's fields (configurable JSON). HubSpot gets a batch upsert of contacts, Segment gets an identify batch (and forwards to your other tools). 3. Track state: each row is saved as synced, failed (exponential backoff) or dead (attempts exhausted, or invalid email until the data changes). 4. Stay safe: a run lock prevents overlapping runs, batches loop until the warehouse is drained, and Slack is told only when something needs attention. Upserts are idempotent, so retries never create duplicates. ### Setup steps - Add Postgres credentials to all Postgres nodes, then run the manual setup once. - Add credentials: HubSpot via Header Auth (Authorization: Bearer ), Segment via Basic Auth (write key as username, empty password). - Create the custom HubSpot properties used in the mapping (for example lifetime_value, churn_risk). - Edit Set Sync Config: warehouse table, key and email columns, enabled destinations, the two field mappings, batch size, retries, Slack webhook. Defaults sync the demo table. - Activate the workflow. Run it any time with POST /retl-sync-now. ### Layout 1 Setup 2-4 Config, lock, detect and deliver 5-6 State, loop, alert

The steps

  1. Manual Trigger - Run Setup Once
  2. Postgres - Create Reverse ETL Tables
  3. Schedule Trigger - Every 10 Minutes
  4. Webhook - Sync Now
  5. Set Sync Config
  6. Code - Validate Config & Build Queries
  7. Config Valid?
  8. HTTP - Slack Config Error Alert
  9. Postgres - Acquire Sync Lock
  10. Lock Acquired?
  11. Postgres - Detect Changed Records
  12. Changes To Push?
  13. Code - Plan Destination Requests
  14. Postgres - Release Lock (No Changes)

28 steps in total.

Similar automations