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 PostgreSQL customer changes with HubSpot, Mailchimp, and Slack

When you run it, it moves and syncs data using Postgres, HubSpot, Slack.

What it does

## CDC Pipeline: PostgreSQL to Multiple SaaS Platforms ### How it works Change data capture with the transactional outbox pattern. A trigger on your source table writes every INSERT, UPDATE and DELETE into a cdc_outbox table in the same transaction, so no change is ever lost. 1. Capture: Postgres trigger records each change. 2. Claim: every minute a worker claims a batch with a lease (safe with several workers, keeps per-row order). 3. Fan out: each change is delivered to HubSpot, Mailchimp and Slack, one task at a time. 4. Finalize: events become delivered, retry (exponential backoff, only the failed targets are re-sent) or dead-lettered with a Slack alert. 5. Requeue: POST /cdc-requeue resets dead events after you fix the cause. Delivery is at-least-once, and every target call is an idempotent upsert, so retries are safe. ### Setup steps - Add Postgres credentials to all Postgres nodes, then run the manual setup once (edit the table name first). - Add credentials: HubSpot via Header Auth (Authorization: Bearer ), Mailchimp via Basic Auth (any username, API key as password). - Edit Set Sync Config: Mailchimp data center and list id, Slack webhook URLs, enabled targets, batch size, retries. - Adjust field mapping in Code - Plan Deliveries to your columns (email, first_name, last_name, phone, company). - Activate the workflow. ### Layout 1 Setup 2-4 Poll, plan, deliver 5-6 Finalize and alert 7-8 Requeue API

The steps

  1. Manual Trigger - Run Setup Once
  2. Postgres - Create CDC Objects
  3. Schedule Trigger - Every Minute
  4. Set Sync Config
  5. Postgres - Claim Outbox Batch
  6. Events Claimed?
  7. Code - Plan Deliveries
  8. Loop Over Deliveries
  9. Switch - Route By Target
  10. HTTP - HubSpot Upsert Contact
  11. HTTP - Mailchimp Sync Member
  12. HTTP - Slack Change Notification
  13. NoOp - Nothing To Deliver
  14. Code - Record Delivery Result

25 steps in total.

Similar automations