Databricks + Salesforce
Connect Databricks and Salesforce to Turn Data Intelligence Into Revenue Action
Push predictive insights, customer analytics, and ML model outputs from Databricks directly into Salesforce so your sales and service teams can act on them.

Why integrate Databricks and Salesforce?
Databricks and Salesforce sit at opposite ends of the modern data-driven business. Databricks houses the raw computational power, machine learning models, and unified analytics that make sense of massive datasets. Salesforce is where sales, marketing, and service teams actually act on customer information every day. Integrating the two means your revenue teams no longer have to wait for weekly reports or manual CSV exports — they get enriched customer scores, churn predictions, and opportunity signals surfaced directly inside the CRM they already live in. The two platforms form a closed-loop system where customer actions inform your data models and your data models sharpen every customer interaction.
Automate & integrate Databricks & Salesforce
Use case
AI-Powered Lead Scoring Synced to Salesforce
Data science teams build and retrain lead scoring models in Databricks using behavioral, firmographic, and historical conversion data. With a tray.ai integration, the resulting scores are automatically written back to custom Salesforce Lead and Contact fields on a scheduled or event-driven basis. Sales reps get a prioritized pipeline without ever leaving Salesforce.
Use case
Churn Prediction Alerts for Customer Success Teams
Machine learning models running in Databricks analyze product usage, support history, and engagement signals to generate churn risk scores for existing customers. tray.ai pushes these risk scores into Salesforce Account and Opportunity records and can automatically create Tasks or Cases for customer success managers to follow up on high-risk accounts. Teams act before problems escalate rather than after.
Use case
Opportunity Enrichment with Product Usage Analytics
For product-led growth companies, product usage data stored in Databricks is a goldmine for identifying expansion opportunities. tray.ai can join usage metrics with Salesforce Opportunity and Account data, then write enriched fields — such as feature adoption scores, usage frequency, and expansion readiness indicators — back into Salesforce to guide upsell conversations.
Use case
Real-Time Revenue Forecasting Pushed to Salesforce
Databricks can aggregate pipeline data, historical win rates, and macroeconomic signals to produce more accurate revenue forecasts than native Salesforce tools alone. tray.ai orchestrates a workflow that pulls pipeline snapshots from Salesforce, sends them to Databricks for model inference, and writes forecast outputs back to custom Salesforce objects or dashboards for sales leadership.
Use case
Customer Segmentation Updates for Marketing Campaigns
Marketing and data teams collaborate in Databricks to build sophisticated customer segments based on behavioral cohorts, RFM analysis, or clustering models. tray.ai syncs the resulting segment membership back to Salesforce Campaign Members or Contact fields, so Salesforce Marketing Cloud or Pardot campaigns can target the right audiences without requiring marketers to manage raw data exports.
Use case
Salesforce Event Triggers for Databricks Pipeline Runs
Not all data flows go from Databricks to Salesforce. Sometimes a CRM event should kick off a data pipeline. When a deal closes in Salesforce, tray.ai can trigger a Databricks job to run customer onboarding propensity models, refresh account health scores, or kick off a data preparation workflow for downstream analytics. This bidirectional pattern keeps Databricks pipelines in sync with real business events.
Use case
Unified Customer 360 Sync Across Both Platforms
Enterprise teams often maintain a canonical customer record in Databricks Delta Lake that aggregates data from dozens of sources. tray.ai can orchestrate a continuous sync that writes Customer 360 attributes — lifetime value, relationship tenure, support health scores, and more — into Salesforce Account records, giving every customer-facing team a complete picture without duplicating data infrastructure.
Get started with Databricks & Salesforce integration today
Databricks & Salesforce Challenges
What challenges are there when working with Databricks & Salesforce and how will using Tray.ai help?
Challenge
Schema Drift Between Databricks Outputs and Salesforce Fields
Data science teams frequently evolve their model outputs and Delta table schemas — renaming columns, adding new score types, or changing data types — while Salesforce administrators manage a separate set of custom fields. When these evolve independently, integration pipelines break silently or write incorrect values to CRM records, corrupting data that sales reps depend on.
How Tray.ai Can Help:
tray.ai's visual data mapper gives you a centralized, version-aware field mapping layer between Databricks and Salesforce schemas. When schemas change, operators get clear error signals through workflow monitoring and can update mappings without touching underlying code. Dynamic field resolution also lets workflows adapt to new Databricks columns without a full pipeline rewrite.
Challenge
Salesforce API Rate Limits Under High-Volume Data Syncs
Databricks can produce millions of scored records per model run, but Salesforce enforces strict daily API call limits and concurrent request throttling. Pushing every record as an individual API call will exhaust those limits fast, causing sync failures and leaving Salesforce data stale exactly when sales teams need updated scores most.
How Tray.ai Can Help:
tray.ai handles Salesforce API rate limits automatically through built-in bulk API support, intelligent request batching, and configurable retry logic with exponential backoff. Workflows use Salesforce Bulk API 2.0 for high-volume upsert operations, which cuts API call consumption significantly while keeping throughput up. Rate limit errors surface in tray.ai's monitoring dashboard with actionable alerts.
Challenge
Securely Passing Credentials Between Cloud Data and CRM Environments
Databricks environments often live inside private VPCs with strict network policies, while Salesforce is a SaaS platform with its own OAuth and connected app security model. Managing secrets, rotating tokens, and keeping integration credentials out of workflow configurations is a persistent security and compliance concern for enterprise teams.
How Tray.ai Can Help:
tray.ai stores all credentials — including Databricks personal access tokens, OAuth tokens, and Salesforce connected app secrets — in an encrypted secrets vault that's never exposed in workflow logic or logs. Authentication is handled at the connector level, so workflow builders reference named credentials without ever seeing raw values. Token refresh and rotation are managed automatically for supported OAuth flows.
Challenge
Handling Bidirectional Sync Conflicts and Data Ownership
Some integration patterns require data to flow both from Databricks to Salesforce and from Salesforce to Databricks, which creates the risk of circular updates and conflicting writes. If a Salesforce admin manually overrides an ML-generated score and the sync job overwrites it again on the next run, trust in the integration erodes fast.
How Tray.ai Can Help:
tray.ai lets teams build conditional logic directly into sync workflows — skipping a Salesforce record update if a 'manual override' flag is set, or comparing timestamps to determine which system holds the most recent value. Workflow branching and decision steps give teams precise control over conflict resolution rules without custom code, so data ownership policies get enforced consistently every run.
Challenge
Monitoring and Alerting on Pipeline Failures Across Systems
When a Databricks job fails, a Salesforce API timeout occurs, or a data transformation produces unexpected nulls, errors can propagate silently — leaving stale scores, missing account updates, or incomplete campaign memberships that nobody notices until a sales rep raises a complaint days later. Debugging across two complex enterprise systems without a unified view is time-consuming and genuinely frustrating.
How Tray.ai Can Help:
tray.ai provides end-to-end workflow observability with step-level execution logs, error tracing, and configurable alerting for every run between Databricks and Salesforce. Failed workflow runs surface immediately in the monitoring dashboard with the exact step, error message, and input payload that caused the failure. Teams can set up alerts to Slack, email, or PagerDuty and use tray.ai's built-in retry mechanisms to automatically re-process failed records without manual intervention.
Start using our pre-built Databricks & Salesforce templates today
Start from scratch or use one of our pre-built Databricks & Salesforce templates to quickly solve your most common use cases.
Databricks & Salesforce Templates
Find pre-built Databricks & Salesforce solutions for common use cases
Template
Scheduled Lead Score Sync: Databricks to Salesforce
On a configurable schedule, this template queries a Databricks Delta table containing the latest ML-generated lead scores, maps each score to the corresponding Salesforce Lead or Contact by email or external ID, and performs a bulk upsert to update custom score fields in Salesforce. Failed records are logged and optionally routed to a Slack alert or retry queue.
Steps:
- Trigger fires on a defined schedule (e.g., daily at 6 AM)
- Query Databricks SQL endpoint or Delta table for updated lead scores since last run
- Transform and map Databricks output fields to Salesforce Lead/Contact schema
- Bulk upsert records in Salesforce using external ID matching
- Log success and failure counts; send error alerts if record failures exceed threshold
Connectors Used: Databricks, Salesforce
Template
Churn Risk Score Push with Automated Salesforce Task Creation
This template reads churn risk scores computed in Databricks, filters for accounts exceeding a configurable risk threshold, updates the corresponding Salesforce Account records with the latest score, and automatically creates a follow-up Task assigned to the Account Owner with a due date and priority level based on risk severity.
Steps:
- Trigger fires on schedule or when a Databricks job completes via webhook
- Fetch high-risk account records from Databricks output table
- Update churn risk score field on matching Salesforce Account records
- For scores above defined threshold, create a high-priority Task in Salesforce assigned to Account Owner
- Send summary digest to CSM team Slack channel with at-risk account count
Connectors Used: Databricks, Salesforce
Template
Closed-Won Opportunity Trigger for Databricks Job Run
When an Opportunity moves to Closed-Won in Salesforce, tray.ai captures the event via a real-time webhook or polling trigger, extracts relevant account and deal metadata, and initiates a specified Databricks job run — such as an onboarding propensity model or customer health initialization pipeline — passing Salesforce record IDs as job parameters.
Steps:
- Salesforce trigger detects Opportunity Stage change to Closed-Won
- Extract Account ID, Opportunity value, product lines, and owner details from Salesforce
- Call Databricks Jobs API to trigger the designated job run with Salesforce parameters
- Poll Databricks for job completion status and write run ID back to Salesforce Opportunity
- Notify the account owner via email or Slack when the Databricks job completes
Connectors Used: Salesforce, Databricks
Template
Customer Segment Membership Sync to Salesforce Campaigns
This template pulls segment membership outputs from a Databricks table, maps each customer to their corresponding Salesforce Contact, and adds or removes them from targeted Salesforce Campaigns based on current segment membership. Designed to run nightly or after each model refresh, it keeps marketing campaign audiences in sync with the latest analytics.
Steps:
- Trigger fires after Databricks segmentation job completion or on nightly schedule
- Fetch current segment membership list from Databricks output table
- Compare with existing Salesforce Campaign Member records to identify adds and removals
- Add new segment members as Campaign Members in the appropriate Salesforce Campaign
- Remove contacts no longer in segment and log all changes for audit purposes
Connectors Used: Databricks, Salesforce
Template
Salesforce Account Data Export to Databricks for Model Training
This reverse-direction template extracts Account, Opportunity, and Activity history from Salesforce on a recurring basis and writes the normalized dataset into a Databricks Delta table for data science teams building or retraining predictive models. It handles incremental exports using Salesforce's LastModifiedDate to minimize API consumption.
Steps:
- Trigger fires on a weekly or configurable schedule
- Query Salesforce for Accounts, Opportunities, and Activities modified since last export timestamp
- Normalize and flatten nested Salesforce objects into a tabular schema
- Write records to Databricks Delta table using the Databricks REST API or JDBC connector
- Update watermark timestamp in tray.ai state store to support incremental future exports
Connectors Used: Salesforce, Databricks
Template
Real-Time Opportunity Enrichment via Databricks Inference Endpoint
When a new Opportunity is created in Salesforce, this template immediately calls a Databricks Model Serving endpoint with the account and opportunity attributes, receives a win-probability score and next-best-action recommendation in real time, and writes those values back to custom fields on the Salesforce Opportunity record within seconds of creation.
Steps:
- Salesforce trigger detects new Opportunity creation via webhook
- Extract Opportunity and parent Account attributes from Salesforce
- POST attributes to Databricks Model Serving REST endpoint for real-time inference
- Parse model response for win-probability score and next-best-action recommendation
- Update Salesforce Opportunity custom fields with model outputs in real time
Connectors Used: Salesforce, Databricks