Block 1 - Lead Field Reference
- Type / Role
- n8n-nodes-base.stickyNote - stickyNote
- Config choices
- Version 1
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 i...
n8n-nodes-base.stickynote, n8n-nodes-base.salesforce, n8n-nodes-base.code, n8n-nodes-base.merge, n8n-nodes-base.set, n8n-nodes-base.splitinbatches, n8n-nodes-base.postgres, n8n-nodes-base.scheduletrigger
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Muh Resky Adiansyah.
Original n8n.io sourceThis 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 analytics.
It is designed for scalable data ingestion and supports both historical backfill and incremental sync in a single workflow.
This workflow is suitable when you need to:
Run once to populate historical data.
Runs automatically (e.g. daily).
Date ranges are processed in weekly batches.
This helps:
Records are split into two paths:
Records without phone:
Skip normalization
Still included in final dataset
Records with phone:
Processed for normalization
Used for merging
This ensures no data is lost even if phone is missing.
Phone numbers are standardized into:
+62XXXXXXXXXX
Steps:
This uses Indonesia's International Direct Dialing (IDD) code: +62
This ensures clean merging and avoids duplicate enrichment.
Merge is done using normalized phone fields:
Behavior:
Records without phone:
All records are transformed into a unified schema:
Behavior:
Ensures:
Salesforce (Lead + Opportunity) → Date Filtering → Batch Processing (weekly) → Phone Routing → Phone Normalization (+62) → Opportunity Deduplication → Lead–Opportunity Merge → Data Standardization → PostgreSQL (Upsert)
Before using this workflow, prepare the following:
CREATE TABLE n8n_salesforce_data ( sf_id TEXT PRIMARY KEY, Source_Object TEXT, CreatedDate TIMESTAMP, CreatedById TEXT, Name TEXT, Phone TEXT, Clean_Phone TEXT, Email TEXT, LeadSource TEXT, Status TEXT, StageName TEXT, OwnerId TEXT, AccountId TEXT, Amount NUMERIC, synced_at TIMESTAMP DEFAULT NOW() );
Phone-based matching may fail if:
Phone numbers are inconsistent
Phone is missing in both Lead and Opportunity
No deduplication for Leads (only Opportunities handled)
No retry logic for API failures (can be added)
This workflow provides a reliable and scalable way to:
It is best suited for teams building a lightweight data warehouse layer on top of Salesforce.
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
| Workflow | Sync Salesforce leads and opportunities to PostgreSQL with backfill and incremental ETL |
|---|---|
| Complexity | advanced |
| Nodes | 23 |
| Categories | CRM |
| Author | Muh Resky Adiansyah |
| Published | 12 Apr 2026 |
Use the JSON export at /data/workflows/14993/14993.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
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 i...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your CRM use case.