Sync warehouse customer data from Postgres to HubSpot and Segment
Ready for 3.0What this workflow does
This workflow has 28 nodes and runs manually, when you click “Execute workflow” (plus 2 other triggers). Along the way it connects Postgres.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 2 other triggers).
- Postgres: run a query
- Set Sync Config (Edit Fields (Set)): sets 14 fields: syncName, warehouseRelation, pkColumn…
- Code: runs custom JavaScript code
- Config Valid? (If): checks a condition and branches into true / false
- Postgres: run a query
- HTTP - Slack Config Error Alert (HTTP Request): calls an HTTP API (POST)
- Lock Acquired? (If): checks a condition and branches into true / false
- Postgres: run a query
- Changes To Push? (If): checks a condition and branches into true / false
- Code: runs custom JavaScript code
…plus 14 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (12)
- Manual Trigger
n8n-nodes-base.manualTrigger - Postgres
n8n-nodes-base.postgres - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Switch
n8n-nodes-base.switch - No Operation, do nothing
n8n-nodes-base.noOp - Wait
n8n-nodes-base.wait
From the author
Quick overview This workflow syncs changed customer records from a PostgreSQL “warehouse” table to HubSpot (contact batch upsert) and Segment (identify batch) on a schedule or via webhook, while tracking per-record sync state in Postgres and alerting failures…