Salesforce
Integrate Stack AI with Salesforce for smarter sales workflows. Automate tasks, capture leads, and enhance CRM functionality with AI-powered insights.

The Salesforce Node allows you to connect directly to your Salesforce CRM account and query structured sales and customer data. It supports SQL queries to retrieve contact, lead, opportunity, and account information, making it easier to automate workflows, analyze performance, or power downstream nodes like LLMs or VectorDBs.
Once connected, Stack AI can use this data to enhance sales processes, generate insights, and improve decision-making.
Step-by-step guide for Salesforce connection credentials:
Obtain your login credentials:
Username: your Salesforce login name.
Password: your Salesforce account password.

After logging in, click on your profile picture on the upper right.

A dropdown menu will appear, click on Settings.

On the Settings page, on the left navigation, select Reset My Security Token.

Click on Reset Security Token.

On click, the new Security token will be sent to the email associated to your Salesforce account.

Finally, in the email, this will be the Security token that will be used for the connection.

How to connect it?
Steps to connect:
Add the Salesforce node from the Apps section into your Stack AI project.

Select "Query Salesforce" as the Action.

Click on "Select a connection" or create a new connection with your credentials.

Choose the appropriate domain for your Salesforce environment:
DomainUse When"login" or left blank
Connecting to production or developer orgs
"test"
Connecting to a sandbox instance
mycustomdomain
Using a custom domain (recommended for SSO or OAuth setups)

Enabling the "sandbox" toggle tells Stack AI to connect to your Salesforce sandbox environment instead of your main (production) Salesforce account.
Disabling the "sandbox" toggle means Stack AI will connect to your production Salesforce environment.
Add your Salesforce Schema in the configurations of the node to define which table you want to extract.
For example: TABLE Contact (Id TEXT, Name TEXT, Industry TEXT);
To list tables from your Salesforce account, you can run the included Python script below on your local machine.
Connect the input, it can be in natural language or SOQL query from an Input node or LLM.
Connect the output to a downstream node like an Output node or directly to an LLM.
Visual overview

Below are some examples of valid SQL queries for your Salesforce database, provided that it has been included in the Schema:
SELECT Name, Email FROM Contact
SELECT Id, Email FROM Contact WHERE Income > USD10000
SELECT Id, Email FROM Contact WHERE LastName = 'Aceituno'
SELECT Id, Email, Name, ParentAccount.Name FROM Contact
Available Actions
1. Salesforce Query
Purpose: Query Salesforce using plain English or SOQL.
Inputs:
sql_schema (required): The database schema (tables, columns, types, etc.).
query (required): Your question in plain English or a SOQL query.
2. Create Case
Purpose: Create a new case in Salesforce.
Inputs:
subject (required): The subject/title of the case.
status (optional): Status of the case (e.g., New, Working, Closed).
priority (optional): Priority level (e.g., High, Medium, Low).
origin (optional): Source of the case (e.g., Web, Phone, Email).
description (optional): Detailed description.
account_id (optional): Salesforce Account ID to associate.
contact_id (optional): Salesforce Contact ID to associate.
3. Update Case
Purpose: Update an existing case.
Inputs:
case_id (required): Salesforce Case ID to update.
subject (optional): New subject/title.
status (optional): New status.
priority (optional): New priority.
origin (optional): New origin/source.
description (optional): New description.
account_id (optional): New Account ID.
contact_id (optional): New Contact ID.
4. Delete Case
Purpose: Delete a case.
Inputs:
case_id (required): Salesforce Case ID to delete.
5. Create Opportunity
Purpose: Create a new opportunity.
Inputs:
name (required): Name of the opportunity.
stage_name (required): Sales stage (e.g., Prospecting, Closed Won).
close_date (required): Expected close date (YYYY-MM-DD).
amount (optional): Opportunity amount.
account_id (optional): Account ID to associate.
description (optional): Description.
6. Update Opportunity
Purpose: Update an existing opportunity.
Inputs:
opportunity_id (required): Salesforce Opportunity ID to update.
name (optional): New name.
stage_name (optional): New stage.
close_date (optional): New close date.
amount (optional): New amount.
description (optional): New description.
7. Delete Opportunity
Purpose: Delete an opportunity.
Inputs:
opportunity_id (required): Salesforce Opportunity ID to delete.
8. Create Contact
Purpose: Create a new contact.
Inputs:
last_name (required): Last name of the contact.
first_name (optional): First name.
email (optional): Email address.
phone (optional): Phone number.
account_id (optional): Account ID to associate.
title (optional): Job title.
9. Update Contact
Purpose: Update an existing contact.
Inputs:
contact_id (required): Salesforce Contact ID to update.
last_name (optional): New last name.
first_name (optional): New first name.
email (optional): New email.
phone (optional): New phone.
title (optional): New job title.
10. Delete Contact
Purpose: Delete a contact.
Inputs:
contact_id (required): Salesforce Contact ID to delete.
Here are the details for the Salesforce actions you requested, in your specified format:
11. Create Comment
Purpose: Add a new comment to a Salesforce record (such as a Case, Opportunity, etc.).
Inputs:
parent_id (required): The Salesforce ID of the parent record to associate the comment with (e.g., Case ID, Opportunity ID).
comment_body (required): The text content of the comment.
is_published (optional): Boolean indicating if the comment should be published and visible to customers (default: true).
12. Update Comment
Purpose: Update the content or visibility of an existing Salesforce comment.
Inputs:
comment_id (required): The Salesforce ID of the comment to update.
comment_body (optional): The updated text content of the comment.
is_published (optional): Boolean indicating if the comment should be published and visible to customers.
13. Delete Comment
Purpose: Remove a comment from Salesforce.
Inputs:
comment_id (required): The Salesforce ID of the comment to delete.
Last updated
Was this helpful?