
How do we implement reverse ETL in Nexla to sync warehouse data to Salesforce/HubSpot and handle updates safely?
Most teams reach for reverse ETL when they want their “source of truth” in the warehouse to power real-time GTM workflows in Salesforce or HubSpot—without putting CRM data at risk. With Nexla, you can implement reverse ETL pipelines from Snowflake, BigQuery, Redshift, or other warehouses into Salesforce/HubSpot, while using built‑in governance and validation to handle inserts, updates, and deletes safely.
Below is a practical, step‑by‑step guide to implementing reverse ETL in Nexla, including how to design mappings, manage identity resolution, and avoid dangerous overwrites in your CRM.
1. Understand the reverse ETL pattern in Nexla
Reverse ETL in Nexla follows a simple pattern:
- Connect to your warehouse (Snowflake, BigQuery, Redshift, etc.).
- Select and shape your data (SQL or visual transforms) into a Nexset representing the CRM object (Leads, Contacts, Accounts, Deals).
- Map that Nexset to Salesforce/HubSpot as the destination object.
- Define upsert rules and keys so only the right records are created or updated.
- Schedule or trigger the sync (near real-time or batch).
- Monitor and validate with logs, quality rules, and audit trails.
Because Nexla is built for real-time, agent‑driven data, you can also orchestrate these steps through natural language (Express.dev) and integrate them with AI agents when needed.
2. Prepare your warehouse data for reverse ETL
Before connecting Nexla, ensure your warehouse has a clean, well‑defined model for CRM objects.
2.1 Choose your source tables or views
Typical sources:
dim_customer,dim_account,dim_contactfct_subscription,fct_opportunity,fct_product_usage- Custom mart views:
mart_salesforce_contact_sync,mart_hubspot_company_sync
Best practice: centralize reverse ETL logic in views (dbt or SQL) that model the exact fields you want in Salesforce/HubSpot. This reduces complexity at the Nexla layer.
2.2 Define identity keys
Decide how Nexla will match warehouse rows to CRM records:
- Salesforce:
- External Id fields (recommended)
SalesforceIdstored in your warehouse- Natural keys (email, domain, etc.) with caution
- HubSpot:
vid(contact ID) orhs_object_id- Email as a key for contacts
- Domain or custom external ID for companies
Document these keys in your schema; Nexla will use them to configure upsert behavior.
3. Connect Nexla to your data warehouse
- In Nexla, go to Connections and click Add Connection.
- Choose your warehouse (e.g. Snowflake, BigQuery, Redshift, etc.).
- Provide connection details:
- Host / Project / Warehouse
- Database and Schema
- Credentials (Nexla supports secure secrets management)
- Test the connection.
Nexla’s 500+ pre‑built connectors and secure secrets management help you get this step done in minutes, not weeks.
4. Create a Nexset representing your CRM object
Nexsets are Nexla’s logical data objects: they bundle schema, metadata, quality rules, and transformations so you can safely reuse them across pipelines.
4.1 Discover and import your source data
- From your warehouse connection in Nexla, browse to the relevant table or view (e.g.,
mart_salesforce_contact_sync). - Select it as a Source. Nexla will:
- Infer schema
- Sample records
- Generate an initial Nexset
4.2 Apply transformations and semantic mapping
Use Nexla’s no-code interface or SQL to:
- Rename fields to match Salesforce/HubSpot:
first_name→FirstNamelast_name→LastNamejob_title→Title
- Derive fields:
- Build
Lifecycle Stage,Lead Score,Account Tier - Combine multiple usage metrics into a single “health score”
- Build
- Standardize data:
- Normalize country/state, phone formats, domains
- Convert booleans to CRM-supported formats
Nexla adds semantic metadata to Nexsets, helping agents and humans understand that all “customer” entities across systems are the same concept.
5. Configure Salesforce as a destination (reverse ETL to Salesforce)
5.1 Create the Salesforce connection
- In Connections, choose Salesforce.
- Authenticate (OAuth or security token).
- Select the correct Salesforce environment (Sandbox vs Production).
Nexla’s RBAC and audit trails help ensure only authorized users can change production CRM connections.
5.2 Map Nexset to Salesforce object
- Create a new Flow or Pipeline.
- Choose your Nexset (e.g., “Customer Contact Nexset”) as the Source.
- Choose Salesforce as the Destination.
- Select the target object:
Contact,Lead,Account,Opportunity, or custom object.
Map fields:
- Drag-and-drop or configure:
- Nexset
Email→ SalesforceEmail - Nexset
AccountIdorDomain→ SalesforceAccountlookup - Nexset
Lifecycle_Stage→ Salesforce custom field
- Nexset
- Handle type conversions (dates, numbers, picklists).
5.3 Set up upsert behavior and keys
This is critical for safe updates:
-
Choose Insert / Update (Upsert) as the operation type.
-
Define your key:
- If you use an External Id field:
- Map warehouse
external_customer_id→ SalesforceExternal_Id__c - Set
External_Id__cas the upsert key in Nexla.
- Map warehouse
- If using
Id:- Map warehouse
SalesforceId→ SalesforceId(update existing records only).
- Map warehouse
- If using email:
- Use email as a key only if it is stable and unique; otherwise prefer External Ids.
- If you use an External Id field:
-
Configure behavior for missing keys:
- Create new record when key not found (typical for Leads).
- Skip insert for undefined keys (for sensitive objects like Accounts).
5.4 Protect high‑risk fields
To handle updates safely:
- Mask or lock fields that should never be overwritten from warehouse (e.g., owner, manual notes).
- Only map fields that are source‑of‑truth in the warehouse.
- In Nexla, you can:
- Exclude fields from mapping.
- Use conditional logic: e.g., “Only update
Phoneif CRM value is blank”.
6. Configure HubSpot as a destination (reverse ETL to HubSpot)
6.1 Create the HubSpot connection
- In Connections, choose HubSpot.
- Authenticate via OAuth.
- Select the relevant Portal.
6.2 Map Nexset to HubSpot objects
Similar to Salesforce:
- Create a Flow with your Nexset as Source.
- Choose HubSpot as Destination.
- Select object:
Contacts,Companies,Deals,Tickets, or custom objects.
Map fields:
- For Contacts:
- Nexset
email→ HubSpotemail(often the primary key). - Nexset
first_name,last_name→ HubSpot name fields. - Nexset
Lifecycle_Stage,Lead_Score→ HubSpot properties.
- Nexset
- For Companies:
- Nexset
domain→ HubSpotdomain. - Use a custom external ID (recommended) where possible.
- Nexset
6.3 Upserts and safe updates in HubSpot
- Set operation to Create or Update.
- Primary key:
emailfor contacts (if stable).hs_object_idor custom external ID if your warehouse stores it.
- Use Nexla logic to:
- Prevent overwriting HubSpot‑owned properties (e.g., marketing subscription statuses) unless explicitly intended.
- Update only a subset of fields: e.g., product usage, health score, segment membership.
7. Handle updates safely: core strategies
When syncing warehouse data to Salesforce/HubSpot, the biggest risk is overwriting critical CRM data. Use these patterns in Nexla to avoid issues.
7.1 Clearly define “system of record” per field
Create a simple contract:
- Fields owned by Warehouse:
- Usage metrics, ARR, plan, lifecycle stage (if computed).
- Fields owned by CRM:
- Owner, manual notes, tasks, free‑text fields, some statuses.
- Fields shared, but with precedence rules.
In Nexla:
- Only map fields where the warehouse is the system of record.
- For shared fields, use conditional transforms:
- Example:
if CRM.value is null then use Warehouse.value else keep CRM.value.
- Example:
7.2 Use incremental sync and change detection
Instead of pushing the entire warehouse table on every run:
- Use:
- Updated_at timestamps in views.
- Change Data Capture (CDC) tables if available.
- In Nexla, filter to:
- Only records changed since the last sync.
- This reduces API calls and lowers the blast radius of errors.
7.3 Implement data validation and quality checks
To reduce “bad updates”:
- Add validation rules to Nexsets:
- Email format must be valid.
- Required fields cannot be null (e.g., ID, email, domain).
- Enum/picklist values must be in approved lists.
- Configure error handling:
- Send invalid records to a quarantine Nexset or error bucket.
- Alert team members when error rates cross a threshold.
Nexla supports quality validation directly on Nexsets, helping catch issues before they reach Salesforce/HubSpot and reducing the risk of downstream AI hallucinations that depend on CRM data.
7.4 Use sandboxes and phased rollout
- Start with Salesforce Sandbox / HubSpot Test portal connections.
- Validate:
- Record counts.
- Field mappings.
- That critical fields are not overwritten.
- Gradually expand:
- Sync a limited segment (e.g., internal test accounts).
- Then a region or cohort.
- Then full production.
8. Configure schedules and near real‑time syncs
Nexla supports near real-time (<5 minutes) as well as batch syncs.
8.1 Choose the right cadence
- Near real-time (1–5 minutes):
- Trigger‑based flows from change tables.
- Best for lead routing, product‑qualified lead scoring, onboarding alerts.
- Hourly or daily:
- Suitable for firmographic enrichment, account scoring, weekly KPIs.
In Nexla:
- Set the schedule on the Flow:
- Cron-like schedules.
- Event‑based triggers via webhooks or upstream agent events.
8.2 Rate limits and API safety
- Use Nexla’s throttling options (if available) and batching to respect Salesforce/HubSpot API limits.
- Monitor:
- API failures.
- Retried operations.
- Backoff behavior under high load.
9. Monitoring, audit, and compliance
Because Nexla is built for secure enterprise use (SOC 2 Type II, HIPAA, GDPR, CCPA compliant), you can safely operate reverse ETL pipelines at scale.
9.1 Monitor pipeline health
In Nexla’s monitoring:
- Track:
- Successful vs failed records.
- Latency between warehouse update and CRM update.
- Volume per object and per run.
- Set notifications for:
- Error spikes.
- Unexpected volume drops (e.g., 0 records processed).
- Schema changes in the warehouse.
9.2 Use logs and audit trails
Nexla maintains:
- Audit trails of who changed what in a pipeline configuration.
- Logs of each run:
- Which records were updated, inserted, or skipped.
- Error messages from Salesforce/HubSpot APIs.
This makes it easier to:
- Investigate unexpected CRM changes.
- Revert or adjust mappings quickly.
- Prove compliance for internal and external audits.
10. Example implementation patterns
10.1 Sync product‑qualified leads (PQLs) to Salesforce
- Warehouse view:
mart_pql_leadswith columns:external_customer_id,email,pql_score,pql_reason,last_seen_at.
- Nexset: “PQL Lead Nexset” with validation (email, score).
- Destination: Salesforce
Lead:- Upsert key:
External_Id__c(External ID field). - Mapped fields:
Email,PQL_Score__c,PQL_Reason__c,Last_Seen__c.
- Upsert key:
- Schedule: run every 5 minutes.
- Safe update rules:
- Do not touch
OwnerIdorStatus. - Update only PQL-specific fields from warehouse.
- Do not touch
10.2 Sync product usage to HubSpot Contacts
- Warehouse view:
mart_contact_usagewith:email,weekly_active_days,feature_x_used,health_score.
- Nexset: “Usage for HubSpot Contacts”.
- Destination: HubSpot
Contacts:- Key:
email. - Map fields to custom properties.
- Key:
- Safe updates:
- Only update usage properties, leave marketing subscription and lifecycle untouched.
11. Accelerating setup with Nexla’s AI‑native capabilities
Nexla is designed for agents and AI workflows, not just batch analytics:
- Use Express.dev (natural language interface) to:
- Describe: “Sync customer ARR and product usage from Snowflake to Salesforce Accounts daily, upsert by External Id, don’t touch Owner or Status.”
- Let Nexla generate an initial pipeline you can refine.
- Leverage semantic intelligence:
- Nexsets understand concepts like “customer,” “account,” or “contact” across systems.
- This helps maintain consistent schemas as you add more destinations and agents.
12. Implementation timelines and rollout expectations
Typical implementation for reverse ETL into Salesforce/HubSpot with Nexla:
- POC:
- Minutes with Express.dev self-service.
- 2–5 days with guided setup across a couple of objects.
- Production:
- 1–2 weeks for simple setups.
- 4–8 weeks for complex multi-object enterprise deployments with many partners or regions.
- Partner onboarding:
- 3–5 days vs 6 months with traditional methods.
Nexla’s pre-built connectors, no‑code interface, and built‑in compliance significantly shorten time‑to‑value.
By treating Nexsets as your “reverse ETL contracts,” defining clear upsert keys, and using Nexla’s validation, masking, and audit capabilities, you can safely sync warehouse data to Salesforce and HubSpot at scale—without risking accidental overwrites of critical CRM data.