Salesforce + Databricks: qualify leads with usage intel
Your inbound leads look “good” in Salesforce. Then the rep opens the record and realizes they still have no clue if the company actually used the product, what they tested, or what to say first. So they bounce between dashboards, logs, LinkedIn, and random notes. It’s slow, and frankly, it’s avoidable with Salesforce Databricks automation.
Sales Ops ends up cleaning up the process. Growth marketers get asked why “high intent” leads aren’t converting. And founders doing sales feel it immediately because every call starts with detective work. This workflow fixes that by giving every new lead a usage-backed score and ready-to-send talking points.
Below, you’ll see what the automation does, what you get out of it, and how it turns raw product usage into Salesforce tasks your team will actually use.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Salesforce + Databricks: qualify leads with usage intel
flowchart LR
subgraph sg0["When clicking ‘Execute workflow’ Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>GET SF Report"]
n1["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Extract Records"]
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Query Databricks1"]
n3@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Out", pos: "b", h: 48 }
n4@{ icon: "mdi:cog", form: "rounded", label: "Rename Keys", pos: "b", h: 48 }
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Extract Tenant Names"]
n6@{ icon: "mdi:play-circle", form: "rounded", label: "When clicking ‘Execute workf..", pos: "b", h: 48 }
n7["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/salesforce.svg' width='40' height='40' /></div><br/>Update Salesforce Records"]
n8["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/salesforce.svg' width='40' height='40' /></div><br/>Get many accounts1"]
n9["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Extract Business Names"]
n10@{ icon: "mdi:web", form: "rounded", label: "Explorium API: Match Busines..", pos: "b", h: 48 }
n11@{ icon: "mdi:web", form: "rounded", label: "Explorium API: Firmographics", pos: "b", h: 48 }
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Organize Data as Items"]
n13["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Clean Outputs"]
n14@{ icon: "mdi:brain", form: "rounded", label: "Anthropic Chat Model5", pos: "b", h: 48 }
n15@{ icon: "mdi:robot", form: "rounded", label: "AI Agent1", pos: "b", h: 48 }
n16@{ icon: "mdi:swap-vertical", form: "rounded", label: "Loop Over Items4", pos: "b", h: 48 }
n17@{ icon: "mdi:swap-vertical", form: "rounded", label: "Loop Over Items5", pos: "b", h: 48 }
n18@{ icon: "mdi:robot", form: "rounded", label: "Structured Output Parser3", pos: "b", h: 48 }
n19["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Merge1"]
n20@{ icon: "mdi:swap-horizontal", form: "rounded", label: "If2", pos: "b", h: 48 }
n21@{ icon: "mdi:wrench", form: "rounded", label: "Explorium MCP2", pos: "b", h: 48 }
n20 --> n11
n20 --> n16
n19 --> n12
n15 --> n13
n3 --> n4
n4 --> n19
n13 --> n7
n0 --> n1
n21 -.-> n15
n1 --> n5
n1 --> n9
n16 --> n19
n16 --> n10
n17 --> n8
n2 --> n3
n8 --> n15
n5 --> n2
n14 -.-> n15
n9 --> n16
n12 --> n17
n18 -.-> n15
n7 --> n17
n11 --> n16
n10 --> n20
n6 --> n0
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n6 trigger
class n15,n18 ai
class n14 aiModel
class n21 ai
class n20 decision
class n0,n2,n10,n11 api
class n1,n5,n9,n12,n13 code
classDef customIcon fill:none,stroke:none
class n0,n1,n2,n5,n7,n8,n9,n12,n13,n19 customIcon
The Problem: lead qualification happens without usage context
Most inbound processes score leads on surface-level fields: company size, title, email domain, maybe a form question. But the strongest signal is usually hiding in your product data. Which endpoints did they test? Did they hit auth once and disappear, or did they try three workflows and come back tomorrow? When that context lives in Databricks (or another analytics platform) and your lead lives in Salesforce, reps are stuck stitching it together by hand. A few leads? Fine. Twenty in a day? That’s a mess.
It adds up fast. Here’s where it breaks down in the real world.
- Reps spend about 10–15 minutes per lead checking usage, then still feel unsure.
- Hot leads cool off while someone tries to match a tenant name to a company record.
- Manual research introduces small errors, which means the outreach sounds generic or wrong.
- Salesforce tasks get created with “Follow up” and no substance, so they’re ignored or delayed.
The Solution: Salesforce + Databricks qualification with AI scoring
This workflow pulls a fresh batch of leads from a Salesforce report, then immediately looks up what those leads did inside your product by querying Databricks for API usage and endpoint activity. Next, it enriches each company with firmographic and company intelligence from Explorium, so you get context like industry, size band, and location without opening another tab. Then an AI agent reviews the whole profile (lead details, endpoints tested, fit signals, red flags) and generates a structured qualification report with a clear score. Finally, n8n creates a Salesforce task that includes the summary and personalized talking points, so a rep can act in minutes, not hours.
The workflow starts with Salesforce as the source of truth for inbound leads. Databricks supplies behavioral “proof” (actual usage). Explorium adds the who-and-why behind the company, and the AI agent turns everything into a task your team can use immediately.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say your team gets 20 inbound leads in a day. If a rep spends even 12 minutes jumping into Databricks, searching endpoints, and skimming company context, that’s about 4 hours burned before they send a single decent email. With this workflow, you run the report, let n8n pull usage and enrichment, and Salesforce tasks appear with the score and talking points. You’re down to a few minutes per lead to review and hit send, not half the morning.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Salesforce to pull leads and create tasks.
- Databricks to query API usage and endpoint signals.
- Explorium API key (get it from the Explorium Dashboard).
Skill level: Intermediate. You’ll connect credentials, confirm your Databricks query fields, and map the Salesforce task output.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A Salesforce report kicks it off. The workflow starts from a manual run (great for testing) but can also be scheduled so new or updated leads are qualified automatically.
Usage signals are pulled from Databricks. n8n formats tenant identifiers, runs a SQL statement via Databricks’ API, and splits the results so each lead gets its own usage profile (endpoints used and a simple count).
Company enrichment fills in the blanks. Explorium matches the business name, checks that a valid match exists, then returns firmographics so you can judge fit without doing manual research.
An AI agent turns it into a task. The lead, usage, and firmographics are merged into one profile, analyzed, and formatted into a structured summary that’s written back into Salesforce as a follow-up task your rep can act on.
You can easily modify the scoring rules and what gets written into the task description based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Manual Trigger
Start the workflow manually to validate each stage before enabling it for production.
- Add the Manual Run Trigger node as the entry point.
- Confirm it connects directly to Fetch SF Report.
- Leave default settings unchanged for manual testing.
Step 2: Connect Salesforce Report Ingestion
Pull the inbound lead report and parse rows into lead objects.
- Configure Fetch SF Report to call your Salesforce report endpoint. Credential Required: Connect your HTTP Request credentials.
- Verify Fetch SF Report connects to Parse Lead Rows.
- In Parse Lead Rows, keep the provided JavaScript that maps report cells into lead fields (firstName, lastName, email, company, leadSource, status, createdDate, recordId, TenantName).
- Confirm the execution flow continues from Fetch SF Report → Parse Lead Rows.
⚠️ Common Pitfall: If your Salesforce report structure differs, the Parse Lead Rows code will throw Unexpected data structure. Adjust the report.factMap['T!T'] path to match your report.
Step 3: Build the Parallel Enrichment Inputs
Split lead data into two parallel branches for API usage analysis and company matching.
- Ensure Parse Lead Rows outputs to both Format Tenant List and Pull Company Names in parallel.
- In Format Tenant List, keep the SQL list formatter that outputs
tenantNamesas a comma-separated string with quotes. - In Pull Company Names, keep the formatter that outputs each
businessNamewrapped in quotes. - Connect Format Tenant List → Databricks Query and set Method to
POST. - Connect Databricks Query → Expand Result Items with Field to Split Out set to
result.data_array. - In Relabel Fields, map keys to
TenantNames,endpoints, andendpointsNumusing the provided key map.
Credential Required: Connect your HTTP Request credentials for Databricks Query.
Step 4: Configure Company Matching and Firmographics
Match company records and enrich them with firmographics before merging data.
- Connect Pull Company Names → Batch Through Leads → Match Company Records.
- In Match Company Records, keep Operation set to
matchand the business name expression{{ $json.businessName }}. - Connect Match Company Records → Verify Match Exists and keep the condition
{{ $json.matched_businesses[0].business_id }}as the non-empty check. - On the true path, connect Verify Match Exists → Fetch Firmographics with Operation set to
enrichand business ID{{ $json.matched_businesses[0].business_id }}. - Route both Fetch Firmographics and the false path of Verify Match Exists into Batch Through Leads.
Credential Required: Connect your Explorium API credentials for Match Company Records and Fetch Firmographics.
Step 5: Merge Enrichment and Usage Streams
Combine API usage data and firmographics into unified lead profiles.
- Connect Relabel Fields → Combine Streams and Batch Through Leads → Combine Streams.
- Connect Combine Streams → Assemble Lead Profiles.
- In Assemble Lead Profiles, keep the merge logic that references Parse Lead Rows to align leads with
TenantNamesand enrichment data. - Connect Assemble Lead Profiles → Cycle Lead Items to iterate through each lead.
⚠️ Common Pitfall: If Relabel Fields key names don’t match the data array order, Assemble Lead Profiles will miss API usage fields. Validate key mappings for TenantNames, endpoints, and endpointsNum.
Step 6: Set Up AI Qualification and Structured Output
Use the AI agent to score and summarize each lead with a structured response.
- Open AI Lead Analyst and keep Prompt Type set to
definewith the provided multi-line analysis prompt. Ensure the embedded expressions reference{{ $('Cycle Lead Items').item.json... }}fields. - Connect Anthropic Chat Engine to AI Lead Analyst as the language model with Model set to
claude-sonnet-4-20250514. - Attach Structured Output Mapper to AI Lead Analyst and keep Schema Type set to
manualwith the provided JSON schema. - Connect Explorium MCP Tool to AI Lead Analyst as the tool, with Endpoint URL set to
https://mcp-n8n.explorium.ai/mcpand Authentication set toheaderAuth. - Route Retrieve Account Record → AI Lead Analyst and keep the account filter where Name equals
Test Lead Company.
Credential Required: Connect your Anthropic credentials in Anthropic Chat Engine. Structured Output Mapper and Explorium MCP Tool are AI sub-nodes—add credentials to AI Lead Analyst’s connected providers, not to the sub-nodes themselves.
Step 7: Configure Salesforce Task Updates
Format the AI output and create Salesforce tasks for your sales team.
- Connect AI Lead Analyst → Format Lead Summary and keep the formatting code that builds the task description and priority.
- Connect Format Lead Summary → Update Salesforce Tasks.
- In Update Salesforce Tasks, set Resource to
taskand Status toOpen. - Set What ID to
{{ $('Retrieve Account Record').item.json.Id }}, Subject toCall, and Description to{{ $json.Description }}. - Ensure Update Salesforce Tasks routes to Cycle Lead Items to continue processing remaining leads.
Credential Required: Connect your Salesforce credentials in both Retrieve Account Record and Update Salesforce Tasks.
Step 8: Test and Activate Your Workflow
Run a full test to confirm lead qualification and Salesforce task creation.
- Click Execute Workflow from Manual Run Trigger to start a test run.
- Verify that Parse Lead Rows outputs lead objects and that Parse Lead Rows outputs to both Format Tenant List and Pull Company Names in parallel.
- Confirm Relabel Fields outputs API usage fields and Fetch Firmographics returns enrichment data before Combine Streams and Assemble Lead Profiles.
- Check that Format Lead Summary produces a Salesforce-ready
DescriptionandPriority. - Validate that Update Salesforce Tasks creates a task linked by
{{ $('Retrieve Account Record').item.json.Id }}. - When testing succeeds, toggle the workflow to Active for production use.
Common Gotchas
- Salesforce credentials can expire or need specific permissions. If things break, check your connected app access and OAuth scopes in Salesforce Setup first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Explorium matching can return multiple “close” businesses. If the workflow is assigning enrichment to the wrong company, tighten the match rules (or add a confidence threshold) before you trust the score.
Frequently Asked Questions
About 60–90 minutes if your Salesforce report and Databricks query are ready.
No. You’ll mostly connect credentials and adjust a few mappings. The only “technical” part is confirming the Databricks SQL query matches your schema.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Explorium API usage and your AI model costs.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you should. The easiest place is the AI Agent prompt that produces the “High Priority / Medium Priority / Low Priority / Nurture” score, plus the formatting step that maps fields into the Salesforce task. Common tweaks include weighting specific endpoints more heavily, flagging freemail domains, and changing what counts as “active usage” in the Databricks query.
Usually it’s an expired OAuth token or the connected app lost permissions. Reconnect Salesforce in n8n, then confirm the user can access the Analytics Reports API and create Tasks. If the report request works but task creation fails, check task field requirements and validation rules in your Salesforce org.
Dozens to hundreds per run for most small teams.
Often, yes, because this workflow needs branching, batching, and multi-step enrichment that gets expensive and awkward in simpler tools. n8n also lets you self-host, which matters once you’re qualifying leads daily and don’t want to count every execution. Another big factor is AI orchestration: the agent step, the structured output parsing, and the enrichment merge logic all live comfortably in one place. Zapier or Make can still work if you only want a lightweight “enrich then create task” flow, with no usage query and no deeper reasoning. If you’re torn, Talk to an automation expert and we’ll pressure-test the simplest option that still gets you the outcome.
This is what “qualified” should mean: real usage signals, real company context, and a Salesforce task that tells your rep exactly what to do next. Set it up once, and the busywork stops showing up every morning.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.