Sync Salesforce leads and opportunities to PostgreSQL with backfill and incremental ETL
Ready for 3.0What this workflow does
This workflow has 17 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). Along the way it connects Salesforce and Postgres.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).
- Set Historical Date Range (Edit Fields (Set)): sets or maps fields
- Set Incremental Dates (Code): runs custom JavaScript code
- Generate Weekly Periods (Code): runs custom JavaScript code
- Loop Over Date Periods (Loop Over Items (Split in Batches)): loops over the items in batches
- Fetch Lead Records (Salesforce): get many
- Fetch Opportunity Records (Salesforce): get many (opportunity)
- Phone empty? (Lead) (If): checks a condition and branches into true / false
- Phone empty? (Opportunity) (If): checks a condition and branches into true / false
- Merge: merges the data from its input branches
- Normalize Lead Phone (+62) (Edit Fields (Set)): sets 1 field: body.nomorlead
…plus 5 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 (10)
- Salesforce
n8n-nodes-base.salesforce - Code
n8n-nodes-base.code - Merge
n8n-nodes-base.merge - Edit Fields (Set)
n8n-nodes-base.set - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Postgres
n8n-nodes-base.postgres - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Manual Trigger
n8n-nodes-base.manualTrigger - Remove Duplicates
n8n-nodes-base.removeDuplicates - If
n8n-nodes-base.if
From the author
Salesforce Leads & Opportunities to PostgreSQL (Backfill & Incremental Sync ETL) This workflow extracts Lead and Opportunity data from Salesforce, transforms and normalizes the data, and loads it into PostgreSQL as a structured data bank for reporting and…