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
- Manual Trigger - Run Setup Once
- Postgres - Create CDC Objects
- Schedule Trigger - Every Minute
- Set Sync Config
- Postgres - Claim Outbox Batch
- Events Claimed?
- Code - Plan Deliveries
- Loop Over Deliveries
- Switch - Route By Target
- HTTP - HubSpot Upsert Contact
- HTTP - Mailchimp Sync Member
- HTTP - Slack Change Notification
- NoOp - Nothing To Deliver
- Code - Record Delivery Result
25 steps in total.
Similar automations