Answers you can trust, from Codeables
Every page on Codeables is structured and verified — built so people and the AI agents they rely on can trust it. Explore more from the source behind this answer.
Explore CodeablesHow do I use Keboola to push curated data back into Salesforce/HubSpot (reverse ETL) for operations teams?
Most operations teams already have the data they need for sharper targeting and faster execution—but it’s locked in the warehouse, not in Salesforce or HubSpot where reps actually work. Reverse ETL with Keboola closes that loop: you model and govern data once, then push curated, trusted records back into your CRM on a schedule (or near real time) without brittle scripts or Shadow AI.
In this guide, I’ll walk through how to use Keboola to push curated data back into Salesforce or HubSpot for ops use cases like lead scoring, account health, and next-best-action workflows—end‑to‑end, from modeling to monitoring.
Why use Keboola for reverse ETL into Salesforce/HubSpot?
Most “reverse ETL tools” stop at syncing columns. Keboola goes further:
-
One source of truth, one glossary
You define metrics and entities once in Keboola (SQL, Python, dbt). The same revenue logic drives board reporting and CRM fields—no more “pipeline” definitions diverging between BI and Salesforce reports. -
Governed execution, not Shadow AI
Every sync is deterministic, logged, and auditable—who changed what, when, and based on which query. AI can help you build flows via the Keboola MCP Server, but it never bypasses policy or lineage. -
End‑to‑end lifecycle in one platform
From ingestion (700+ native connectors, CDC, Generic REST API) through transformation to CRM delivery, everything runs in a single governed environment with Dev/Prod, branching, and version control. -
Operational visibility and cost control
Activity Center and active metadata give you 360° monitoring—job runs, error rates, impacted tables, and credit spend—so reverse ETL doesn’t become a hidden cost center.
Typical reverse ETL use cases for Salesforce & HubSpot
Before we dive into how, get clear on the “why” you’re pushing data back:
-
Lead & account scoring
Combine product usage, marketing engagement, and billing signals into a single, governed score and push it to Salesforce/HubSpot fields for routing, SLAs, and sequences. -
Customer health & churn risk
Model health scores from NPS, support tickets, login frequency, and payment behavior. Expose them as fields + reports so CSMs and RevOps can prioritize proactive outreach. -
Next-best-action and lifecycle stages
Use warehouse attributes (e.g., feature adoption, contract dates, expansion potential) to drive playbooks, Smart Lists, or workflows directly in your CRM. -
Finance ↔ GTM alignment
Push “finance-grade” ARR, MRR, and contract status into Salesforce/HubSpot so sales and finance work off the same numbers—and audit trails prove it.
Each of these follows the same operational pattern: curate in Keboola, then sync into CRM in a controlled, repeatable way.
High-level architecture: Salesforce/HubSpot reverse ETL with Keboola
At a high level, a reverse ETL flow in Keboola looks like this:
-
Ingest source data
Use Keboola’s connectors to bring in data from product, billing, marketing, finance, and operational systems into your storage (e.g., Snowflake, BigQuery, Redshift) controlled by Keboola. -
Model curated entities
In SQL & Python Workspaces or dbt, create clean, governed models likedim_account,fct_usage,account_health,lead_score. -
Map models to CRM objects
Decide which tables/columns should land on which Salesforce/HubSpot objects (Lead, Contact, Account, Company, Deal etc.) and which field will serve as the key. -
Configure destination components
Use Keboola’s Salesforce and HubSpot writers (or Generic REST API connectors when needed) to push the modeled data into CRM with proper upsert logic. -
Orchestrate & monitor
Wire the flow in Flow builder, set schedules, handle dependencies, and monitor with Activity Center and logs. Promote to production via Dev/Prod and branching.
Let’s walk this step-by-step.
Step 1: Ingest the right data into Keboola
Reverse ETL is only as good as the data underneath. Pull in all inputs you need for the operations use case, for example:
-
Product analytics / app data
Mixpanel, Amplitude, Segment, or direct database via CDC (e.g., log-based CDC from PostgreSQL/MySQL) to capture events and usage. -
Billing & subscription systems
Stripe, Chargebee, Zuora, ERP, or accounting systems that hold ARR/MRR, invoice, and payment history. -
Marketing platforms
Google Ads, Facebook Ads, LinkedIn, email automation, plus web analytics (GA4) to capture engagement. -
Support & success systems
Zendesk, Intercom, Freshdesk, or custom tools that track tickets and CS interactions.
In Keboola:
- Open Flow builder and add extractor components for your systems (e.g., “Stripe”, “PostgreSQL”, “Zendesk”).
- Configure credentials and select relevant tables/objects.
- Set initial full loads, then incremental or CDC where available to keep it efficient and near real time.
Because Keboola supports 700+ native connectors plus Generic REST API connectors, long‑tail systems can be integrated as well—without new custom services that would break your governance model.
Step 2: Build curated models for operations teams
Once data lands in storage, you need curated models that operations, sales, and CS can trust.
Design the core entities
Start with entities that map directly to CRM concepts:
dim_account/hubspot_company/sf_accountdim_contact/sf_contact/hubspot_contactfct_usage(aggregated by account/contact)account_health(per account)lead_score(per lead/contact)
Use SQL & Python Workspaces or dbt in Keboola to define these models. For example:
-- Example: account_health model
CREATE OR REPLACE TABLE analytics.account_health AS
SELECT
a.account_id,
a.account_name,
COALESCE(u.last_30d_events, 0) AS usage_30d,
COALESCE(s.open_tickets_30d, 0) AS tickets_30d,
COALESCE(b.mrr, 0) AS mrr,
CASE
WHEN b.mrr = 0 THEN 'Churned'
WHEN u.last_30d_events = 0 THEN 'At Risk'
WHEN s.open_tickets_30d > 10 THEN 'At Risk'
ELSE 'Healthy'
END AS health_status,
CURRENT_TIMESTAMP() AS last_calculated_at
FROM dim_account a
LEFT JOIN fct_usage_agg u ON a.account_id = u.account_id
LEFT JOIN fct_support_agg s ON a.account_id = s.account_id
LEFT JOIN fct_billing_agg b ON a.account_id = b.account_id;
Apply governance while modeling
This is where Keboola’s governance-first approach matters:
-
Single glossary, one truth
Define metrics like MRR, churn, “active account” once. Use the same models to feed BI tools and CRM writers so definitions never drift. -
Dev/Prod mode and branching
Experiment with new logic in a development branch, validate results, then merge into production. No “hot fixes” in production pipelines. -
Active metadata for lineage
Every table, transformation, and run is tracked. You can answer “Which pipeline created this CRM field?” or “Which change introduced this new scoring logic?”—critical in regulated or multi-entity environments.
Step 3: Map Keboola models to Salesforce or HubSpot
Next, decide how these curated models map to your CRM.
3.1 Choose the key for matching
You need a stable key to match your warehouse entities to CRM records:
-
For Salesforce:
- Ideal: store the
SalesforceId(e.g.,account.sfid,contact.sfid) in your warehouse. - Alternative: use controlled business keys like domain or external IDs that are enforced in Salesforce.
- Ideal: store the
-
For HubSpot:
- Ideal: store
hubspot_company_id,hubspot_contact_idetc. - Alternative: use email (for contacts) or domain/company name with deduplication rules.
- Ideal: store
If you don’t yet have these IDs in your warehouse, build one initial sync that reads from Salesforce/HubSpot and writes back IDs into your core models so future flows can be deterministic.
3.2 Decide which fields to push
For each object, list the fields you’ll push from Keboola:
-
Account/Company
health_statusarr/mrr(finance-grade)last_30d_product_eventsplan_tierchurn_risk_reason
-
Contact/Lead
lead_scoreproduct_qualifiedflaglast_active_at(product)eligible_for_upsellflag
Make sure corresponding fields exist in Salesforce/HubSpot as custom fields where needed. That’s where ops/admins come in: define field names, types, and help text so reps trust and use them.
Step 4: Configure Salesforce reverse ETL with Keboola
Keboola treats Salesforce as a destination via its Salesforce writer (or Generic REST API when you need exotic objects or behaviors). The core principle: upsert, not blind overwrite.
4.1 Create and configure the Salesforce writer
- In Keboola, add a new Salesforce writer to your Flow.
- Authenticate using OAuth or another secure method with a scoped Salesforce integration user.
- Choose the Salesforce environment (Sandbox for dev, Production for prod) to keep the SDLC clean.
4.2 Map tables to Salesforce objects
For each curated table:
-
Add a table mapping—e.g.,
analytics.account_health→Account. -
Choose an operation: typically Upsert.
-
Select the key field:
- If you have
sfidin your model, upsert onId. - Better: use a dedicated External ID field (e.g.,
Keboola_External_Id__c) in Salesforce. This decouples integration logic from internal Salesforce IDs.
- If you have
-
Map columns to Salesforce fields, e.g.:
health_status→Health_Status__cmrr→MRR__cusage_30d→Usage_30_Days__clast_calculated_at→Health_Last_Updated__c
Use Keboola’s type conversions and mapping controls to ensure formats match Salesforce expectations (dates, decimals, picklists).
4.3 Control sync scope and load patterns
-
Incremental syncs
Add a filter to push only rows updated since the last run (e.g.,last_calculated_at > last_run_timestamp). Use a dedicated column or derived logic in your model. -
Batch sizing & rate limits
Configure batch sizes aligned with Salesforce API limits to avoid hitting governor limits. Keboola handles batching for you, but you can fine-tune if needed. -
Error handling and retries
If Salesforce rejects records (validation rules, missing required fields), errors are logged per row. Use Keboola’s logs to identify patterns, then either fix the data model or adjust Salesforce validations.
Because every run is logged, you get end‑to‑end traceability: for a given Salesforce Account field, you can trace back to the underlying query and source systems.
Step 5: Configure HubSpot reverse ETL with Keboola
HubSpot behaves similarly, but with object types and IDs specific to its model.
5.1 Create the HubSpot writer
- In Keboola, add a HubSpot writer.
- Authenticate via OAuth with a scoped HubSpot app or integration user.
- Select the HubSpot account (Portal) and environment (Sandbox vs production) if you separate them.
5.2 Map tables to HubSpot objects
For each curated table:
-
Map
analytics.account_health→ Companies. -
Map
analytics.lead_scores→ Contacts or Leads (depending on your process). -
Choose the key:
- For Companies:
hubspot_company_idor domain-based External ID. - For Contacts:
hubspot_contact_idor email (if emails are unique and governed).
- For Companies:
-
Map columns:
health_status→health_status(custom property)mrr→mrr(custom property)usage_30d→usage_30dlead_score→lead_scoreproduct_qualified→product_qualified(boolean)
Ensure these properties exist in HubSpot and are labeled with clear descriptions so RevOps and sales know how to use them in Lists, Workflows, and Reports.
5.3 Respect HubSpot behavior and limits
- Partial updates
Configure Keboola to update only the mapped fields, leaving other HubSpot properties intact. - Rate limits
Keboola batches calls to respect HubSpot’s API limits; adjust frequency or batch sizes if you run very high volumes. - Workflow triggering
When these fields change, you can trigger HubSpot workflows (e.g., assign to CSM, start a sequence). Use that power carefully; test in a sandbox first and version your Keboola flows.
Step 6: Orchestrate, monitor, and promote to production
Reverse ETL should be just another governed flow in your data lifecycle—not a bespoke script on a forgotten VM.
6.1 Build the end‑to‑end Flow
In Flow builder:
- Add all relevant extractors (product, billing, marketing, support, Salesforce/HubSpot if reading back IDs).
- Add transformations (SQL, Python, dbt) that produce the curated models.
- Add Salesforce/HubSpot writers as the terminal components.
- Set dependencies so CRM writers run only after upstream transforms succeed.
- Set schedules (e.g., every 30 minutes, hourly, daily) depending on operational needs and API limits.
6.2 Use Dev/Prod and branching
- Develop new scoring logic in a Dev project/branch, targeting Salesforce Sandbox or HubSpot Sandbox.
- Validate values with RevOps and a small group of users.
- Once approved, merge to Prod, switch the destination to production CRM, and schedule.
This keeps experimental logic out of production and gives auditors a clear change history.
6.3 Monitor and optimize with Activity Center
Keboola’s Activity Center and active metadata give you:
- Job histories for every reverse ETL run (success, failures, durations).
- Lineage from CRM fields back to source systems.
- Spend and performance metrics—“Optimize Every Credit” isn’t just a tagline; you see which flows drive compute usage and can tune them.
In regulated or audit-heavy environments, you can stream security and execution events into SIEM tools such as Splunk, Datadog, or ELK to centralize monitoring.
Design patterns & best practices for robust reverse ETL
1. Keep CRM payloads minimal and purpose-driven
Don’t mirror your whole warehouse into Salesforce/HubSpot. Only push:
- Fields that directly support routing, prioritization, or customer conversations.
- Aggregates and scores, not raw event data.
This keeps CRM lean and makes troubleshooting easier.
2. Separate “source-of-truth” models from “CRM-facing” models
Use a two-layer modeling pattern:
- Source-of-truth models (e.g.,
fct_billing_mrr,fct_product_usage) used by BI, finance, and analytics. - CRM-facing models (e.g.,
account_health_for_crm,lead_scores_for_crm) that are thin views over the source-of-truth tables, tuned for CRM structure.
This way, you can adjust how CRM sees the data without changing core definitions.
3. Make governance explicit for every field
For each field you push into Salesforce/HubSpot, define:
- Definition – what it means and how it’s calculated.
- Owner – who is accountable for the logic.
- Update cadence – how often it’s refreshed.
You can capture this context in Keboola’s Data Catalog and mirror it in CRM field descriptions so business users see the same meaning everywhere.
4. Avoid direct AI writes to Salesforce/HubSpot
If you use AI tools like Cursor, Windsurf, Claude, or ChatGPT to design flows:
- Use them via the Keboola MCP Server so AI helps generate transformations and mappings, but execution stays deterministic and governed in Keboola.
- Never let agents write directly to Salesforce/HubSpot outside Keboola; that’s exactly how Shadow AI creates invisible, unaudited automations.
Example: Account health scores from Keboola to Salesforce
To make this concrete, here’s a simple end‑to‑end blueprint:
-
Ingest
- Stripe → MRR & invoices.
- Product DB via CDC → usage events.
- Zendesk → ticket counts.
- Salesforce (read) → Accounts & IDs.
-
Model
- Build
dim_accountwith SalesforceIdas key. - Aggregate usage and tickets into
fct_usage_aggandfct_support_agg. - Create
account_healthmodel withhealth_status,mrr,usage_30d,tickets_30d.
- Build
-
Map
account_health→ SalesforceAccount.- Key:
Id. - Fields: map to custom fields
Health_Status__c,MRR__c,Usage_30_Days__c.
-
Write
- Configure Salesforce writer to upsert
Accountrecords every 30 minutes. - Filter to rows where
last_calculated_at > last_run_timestamp.
- Configure Salesforce writer to upsert
-
Orchestrate & monitor
- Flow builder sets dependency chain from ingest → transform → write.
- Activity Center monitors runs, with alerts for failures or high error rates.
Result: CSMs see up-to-date, finance-aligned health scores directly in Salesforce, and you can show auditors end‑to‑end lineage from Stripe events to the CRM field.
Final verdict
Using Keboola for reverse ETL into Salesforce and HubSpot lets you treat CRM fields as governed data products—not ad‑hoc exports or risky scripts. You:
- Build curated, auditable models once in a unified AI & Data Platform.
- Push only what operations teams need into CRM, on a controlled schedule.
- Keep full lineage, monitoring, and cost visibility—even as AI helps you build faster.
If a workflow can’t be traced source → transformation → CRM field and explained to an auditor, it shouldn’t ship. With Keboola, you can ship reverse ETL pipelines that are fast enough for RevOps and safe enough for your CFO and CISO.