Salesforce
Query and manage your Salesforce instance with CRUD operations.
MCP connection
Connectors
Choose the connector that matches your authentication method. The options below use the names shown in StackAI.
Salesforce (OAuth)
OAuth sign-in
Salesforce
Credentials
Salesforce (MCP)
MCP with OAuth
Salesforce (OAuth)
Connect to Salesforce using OAuth with automatic credential management by StackAI.
Set up in Salesforce
Use a Salesforce account with access to the records and operations that your workflow needs.
If your organization restricts application access or user consent, have its administrator approve the connection before you sign in.
Set up in StackAI
Open Settings → Connections, add a connection, and select Salesforce (OAuth).
Select Connect, sign in to the provider account, and review the requested access. Complete authorization to return to StackAI.
Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.
StackAI obtains the OAuth credentials during sign-in. You do not need to paste an access token or refresh token.
Provider documentation: Setup reference.
Salesforce
Connect to Salesforce CRM to access business objects. Supports reading and writing to Salesforce records.
Set up in Salesforce
Sign in to Salesforce as an admin and open Setup.
Obtain that user's security token (Setup - reset My Security Token, sent to the user's email) if your org requires it in addition to the password.
Set up in StackAI
Open Settings → Connections, add a connection, and select Salesforce.
Enter the credentials and connection details in the fields below.
Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.
Connection fields
Username
Yes
Your Salesforce username (email address).
Password
Yes
Your Salesforce password.
Security Token
Yes
Your Salesforce security token. Reset it in your Salesforce settings if needed. Provider instructions.
Domain (Optional)
Optional / as applicable
Custom domain for your Salesforce instance (e.g., 'na1' for North America).
Sandbox
Optional / as applicable
Whether this is a Salesforce sandbox instance.
Provider documentation: Setup reference.
Salesforce (MCP)
Connect to a Salesforce Hosted MCP server using an External Client App. The selected server and Salesforce permissions govern available tools.
Set up in Salesforce
Select a Salesforce Hosted MCP server or an administrator-configured custom MCP server. Use the endpoint for the correct Salesforce environment.
Create a Salesforce External Client App with the StackAI callback URL, PKCE, and the mcp_api scope.
Record the consumer key and, if required by the client configuration, its consumer secret. Give the authorizing user the Salesforce permissions needed by the tools.
Set up in StackAI
Open Settings → Connections, add a connection, and select Salesforce (MCP).
Complete the connector configuration below. If you do not have access to these settings, ask your StackAI administrator to configure the connector.
Select Connect, sign in to the provider account, and review the requested access. Complete authorization to return to StackAI.
Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.
Connector configuration
Server URL
Yes
Salesforce Hosted MCP server URL. Use the sandbox URL for a sandbox org, or paste the URL of an admin-configured custom server.
Scopes
Read-only
OAuth scopes required by Salesforce Hosted MCP servers. This value is shown for reference; it is not an editable credential.
Consumer Key
Optional / as applicable
Consumer key from a Salesforce External Client App configured with StackAI's callback URL, PKCE, and the mcp_api scope.
Consumer Secret
Optional / as applicable
Optional consumer secret from the External Client App. Public PKCE clients can leave this blank.
Authorization Endpoint
Optional / as applicable
The OAuth endpoint URL (e.g., https://mcp.example.com/oauth2/authorize). You probably don't have to set this, the OAuth flow will try to discover it on its own.
Custom Headers
Optional / as applicable
Optional custom headers to send to the MCP server for authentication or other purposes.
Provider documentation: Setup reference.
Verify the connection
Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.
If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.
Detailed setup guides
Use an action
Add the required Salesforce action to the workflow.
Select a connection when the action requests one.
Complete the required fields. Use the reference picker when a value comes from another workflow step.
Run the workflow and inspect the action’s output. Check the result before using it in a later step.
Actions
Query Salesforce
Query Salesforce using SOQL queries
Inputs
Query
string
Yes
SOQL query to execute against Salesforce. Default: .
Outputs
Query
string
The SOQL query that was executed.
Results
string
The results of the query.
Create Case
Create a new case in Salesforce
Inputs
Subject
string
Yes
The subject/title of the case.
Status
string
No
The status of the case. Default: New.
Priority
string
No
The priority level of the case. Default: Medium.
Origin
string
No
The origin/source of the case.
Description
textarea
No
The detailed description of the case.
Account ID
string
No
The Salesforce ID of the account to associate with this case.
Contact ID
string
No
The Salesforce ID of the contact to associate with this case.
Outputs
Case ID
string
The ID of the created case.
Success
boolean
Whether the case was created successfully.
Update Case
Update an existing case in Salesforce
Inputs
Case ID
string
Yes
The Salesforce ID of the case to update.
Subject
string
No
The subject/title of the case.
Status
string
No
The status of the case.
Priority
string
No
The priority level of the case.
Origin
string
No
The origin/source of the case.
Description
textarea
No
The detailed description of the case.
Account ID
string
No
The Salesforce ID of the account to associate with this case.
Contact ID
string
No
The Salesforce ID of the contact to associate with this case.
Custom Fields
object
No
Additional Case fields to update, keyed by Salesforce API name (e.g. PO_Number__c).
Outputs
Case ID
string
The ID of the updated case.
Success
boolean
Whether the case was updated successfully.
Delete Case
Delete a case from Salesforce
Inputs
Case ID
string
Yes
The Salesforce ID of the case to delete.
Outputs
Case ID
string
The ID of the deleted case.
Success
boolean
Whether the case was deleted successfully.
Get Case
Retrieve a case from Salesforce by ID
Inputs
Case ID
string
Yes
The Salesforce ID of the case to retrieve.
Fields
string_array
No
Fields to return. Leave empty to return every field on the record.
Outputs
Case
object
The case returned by Salesforce.
Create Opportunity
Create a new opportunity in Salesforce
Inputs
Opportunity Name
string
Yes
The name of the opportunity.
Stage Name
string
Yes
The sales stage of the opportunity.
Close Date
string
Yes
The expected close date of the opportunity.
Amount
number
No
The opportunity amount.
Account
select (string)
No
The Account associated with this opportunity. Pick by name from the dropdown OR paste a Salesforce Account ID directly. The value stored is the Salesforce Account ID either way. Options load from the selected connection.
Description
textarea
No
A description of the opportunity.
Record Type ID
string
No
The Salesforce Record Type ID for this opportunity (e.g. Strategic Opportunity, Pre-Sales Request). Leave blank to land in the org's default record type.
Custom Fields
object
No
Additional Opportunity fields as a JSON object (API name → value).
Outputs
Opportunity ID
string
The ID of the created opportunity.
Success
boolean
Whether the opportunity was created successfully.
Update Opportunity
Update an existing opportunity in Salesforce
Inputs
Opportunity ID
string
Yes
The Salesforce ID of the opportunity to update.
Opportunity Name
string
No
The new name of the opportunity.
Stage Name
string
No
The new sales stage of the opportunity.
Close Date
string
No
The new expected close date.
Amount
number
No
The new opportunity amount.
Account
select (string)
No
Reassign this opportunity to a different Account. Pick by name from the dropdown OR paste a Salesforce Account ID directly. Options load from the selected connection.
Description
textarea
No
The new description of the opportunity.
Custom Fields
object
No
Additional Opportunity fields as a JSON object (API name → value).
Outputs
Opportunity ID
string
The ID of the updated opportunity.
Success
boolean
Whether the opportunity was updated successfully.
Delete Opportunity
Delete an opportunity from Salesforce
Inputs
Opportunity ID
string
Yes
The Salesforce ID of the opportunity to delete.
Outputs
Opportunity ID
string
The ID of the deleted opportunity.
Success
boolean
Whether the opportunity was deleted successfully.
Create Record
Create a new record in any Salesforce object dynamically
Inputs
Object Name
string
Yes
The API name of the Salesforce object to create a record in.
Record Fields
object
Yes
A dictionary of field-value pairs representing the data to populate in the record.
Outputs
Record ID
string
The ID of the created record.
Success
boolean
Whether the record was created successfully.
Object Name
string
The object name that was used for creation.
Update Record
Update an existing record in any Salesforce object dynamically
Inputs
Object Name
string
Yes
The API name of the Salesforce object to update a record in.
Record ID
string
Yes
The Salesforce ID of the record to update.
Record Fields
object
Yes
A dictionary of field-value pairs representing the data to update in the record.
Outputs
Record ID
string
The ID of the updated record.
Success
boolean
Whether the record was updated successfully.
Object Name
string
The object name that was used for the update.
Get Record
Retrieve a record from any Salesforce object by ID
Inputs
Object Name
string
Yes
The API name of the Salesforce object to read a record from.
Record ID
string
Yes
The Salesforce ID of the record to retrieve.
Fields
string_array
No
Fields to return. Leave empty to return every field on the record.
Outputs
Record
object
The record returned by Salesforce.
Create Contact
Create a new contact in Salesforce
Inputs
Last Name
string
Yes
The last name of the contact.
First Name
string
No
The first name of the contact.
string
No
The email address of the contact.
Phone
string
No
The phone number of the contact.
Account ID
string
No
The Account ID associated with this contact.
Title
string
No
The job title of the contact.
Outputs
Contact ID
string
The ID of the created contact.
Success
boolean
Whether the contact was created successfully.
Update Contact
Update an existing contact in Salesforce
Inputs
Contact ID
string
Yes
The Salesforce ID of the contact to update.
Last Name
string
No
The last name of the contact.
First Name
string
No
The first name of the contact.
string
No
The email address of the contact.
Phone
string
No
The phone number of the contact.
Title
string
No
The job title of the contact.
Outputs
Contact ID
string
The ID of the updated contact.
Success
boolean
Whether the contact was updated successfully.
Delete Contact
Delete a contact from Salesforce
Inputs
Contact ID
string
Yes
The Salesforce ID of the contact to delete.
Outputs
Contact ID
string
The ID of the deleted contact.
Success
boolean
Whether the contact was deleted successfully.
Create Lead
Create a new lead in Salesforce
Inputs
Last Name
string
Yes
The last name of the lead.
Company
string
Yes
The company name of the lead.
First Name
string
No
The first name of the lead.
string
No
The email address of the lead.
Phone
string
No
The phone number of the lead.
Title
string
No
The job title of the lead.
Status
select (string)
No
The status of the lead (values may vary by Salesforce org). Available values: New, Contacted, Nurturing, Qualified, Unqualified.
Description
textarea
No
Additional description or notes about the lead.
Website
string
No
The company website URL (must be http or https).
Has Opted Out of Email
boolean
No
Whether the lead has opted out of receiving emails. Default: false.
Outputs
Lead ID
string
The ID of the created lead.
Success
boolean
Whether the lead was created successfully.
Update Lead
Update an existing lead in Salesforce
Inputs
Lead ID
string
Yes
The Salesforce Lead ID (15 or 18 alphanumeric characters).
Last Name
string
No
The last name of the lead.
Company
string
No
The company name of the lead.
First Name
string
No
The first name of the lead.
string
No
The email address of the lead.
Phone
string
No
The phone number of the lead.
Title
string
No
The job title of the lead.
Status
select (string)
No
The status of the lead (values may vary by Salesforce org). Available values: New, Contacted, Nurturing, Qualified, Unqualified.
Description
textarea
No
Additional description or notes about the lead.
Website
string
No
The company website URL (must be http or https).
Has Opted Out of Email
boolean
No
Whether the lead has opted out of receiving emails.
Outputs
Lead ID
string
The ID of the updated lead.
Success
boolean
Whether the lead was updated successfully.
Delete Lead
Delete a lead from Salesforce
Inputs
Lead ID
string
Yes
The Salesforce Lead ID.
Outputs
Lead ID
string
The ID of the deleted lead.
Success
boolean
Whether the lead was deleted successfully.
Get Lead
Retrieve a lead from Salesforce by ID
Inputs
Lead ID
string
Yes
The Salesforce Lead ID.
Fields
string_array
No
Fields to return. Leave empty to return every field on the record.
Outputs
Lead
object
The lead returned by Salesforce.
Search Leads
Search and filter Salesforce leads
Inputs
Search Text
string
No
Text to search across lead name, email, and company fields.
Limit
number
No
Maximum number of leads to return (1-50). Default: 20.
Offset
number
No
Number of records to skip (for pagination). Default: 0.
Outputs
Leads
object_array
List of leads matching the search criteria.
Total Returned
number
Number of leads in this result set.
Total Available
number
Total leads available for the query (from Salesforce).
Limit
number
Requested page size.
Offset
number
Requested offset.
Next Offset
number
Next offset if more pages exist; null otherwise.
Search Accounts
Search Salesforce Accounts by name
Inputs
Search Text
string
No
Partial Account name to search for. Leave blank to list the most recently-created accounts.
Limit
integer
No
Maximum number of accounts to return (max 200).
Outputs
Accounts
object_array
Matching accounts.
Total Size
integer
Total accounts matched by the query (may exceed the returned count).
Search Contacts
Search Salesforce Contacts by name or email
Inputs
Search Text
string
No
Partial Contact name or email to search for. Matches against Name and Email. Leave blank to list the most recently-created contacts.
Limit
integer
No
Maximum number of contacts to return (max 200).
Outputs
Contacts
object_array
Matching contacts.
Total Size
integer
Total contacts matched by the query (may exceed the returned count).
Create Comment
Create a new comment in Salesforce (typically a Case Comment)
Inputs
Parent ID
string
Yes
The ID of the parent record (e.g., Case, Opportunity, etc.).
Comment Body
textarea
Yes
The text content of the comment.
Is Published
boolean
No
Whether the comment is published/visible to customers. Default: true.
Outputs
Comment ID
string
The ID of the created comment.
Success
boolean
Whether the comment was created successfully.
Update Comment
Update an existing comment in Salesforce
Inputs
Comment ID
string
Yes
The Salesforce ID of the comment to update.
Comment Body
textarea
No
The text content of the comment.
Is Published
boolean
No
Whether the comment is published/visible to customers.
Outputs
Comment ID
string
The ID of the updated comment.
Success
boolean
Whether the comment was updated successfully.
Delete Comment
Delete a comment from Salesforce
Inputs
Comment ID
string
Yes
The Salesforce ID of the comment to delete.
Outputs
Comment ID
string
The ID of the deleted comment.
Success
boolean
Whether the comment was deleted successfully.
Create Task
Create a new task in Salesforce
Inputs
Subject
string
Yes
The subject/title of the task.
Status
select (string)
No
The status of the task. Available values: Not Started, In Progress, Completed, Waiting on someone else, Deferred.
Priority
select (string)
No
The priority level of the task. Available values: High, Normal, Low.
Description
textarea
No
Additional description or notes about the task.
Due Date
string
No
The due date for the task (YYYY-MM-DD format).
Related To (Contact/Lead ID)
string
No
The Salesforce ID of the related Contact or Lead.
Related To (Account/Opportunity ID)
string
No
The Salesforce ID of the related Account or Opportunity.
Owner ID
string
No
The Salesforce User ID of the task owner.
Outputs
Task ID
string
The ID of the created task.
Success
boolean
Whether the task was created successfully.
Update Task
Update an existing task in Salesforce
Inputs
Task ID
string
Yes
The Salesforce Task ID (15 or 18 alphanumeric characters).
Subject
string
No
The subject/title of the task.
Status
select (string)
No
The status of the task. Available values: Not Started, In Progress, Completed, Waiting on someone else, Deferred.
Priority
select (string)
No
The priority level of the task. Available values: High, Normal, Low.
Description
textarea
No
Additional description or notes about the task.
Due Date
string
No
The due date for the task (YYYY-MM-DD format).
Related To (Contact/Lead ID)
string
No
The Salesforce ID of the related Contact or Lead.
Related To (Account/Opportunity ID)
string
No
The Salesforce ID of the related Account or Opportunity.
Owner ID
string
No
The Salesforce User ID of the task owner.
Outputs
Task ID
string
The ID of the updated task.
Success
boolean
Whether the task was updated successfully.
Delete Task
Delete a task from Salesforce
Inputs
Task ID
string
Yes
The Salesforce Task ID (15 or 18 alphanumeric characters).
Outputs
Task ID
string
The ID of the deleted task.
Success
boolean
Whether the task was deleted successfully.
Get Task
Retrieve a task from Salesforce by ID
Inputs
Task ID
string
Yes
The Salesforce Task ID (15 or 18 alphanumeric characters).
Fields
string_array
No
Fields to return. Leave empty to return every field on the record.
Outputs
Task
object
The task returned by Salesforce.
Search Tasks
Search and filter Salesforce tasks
Inputs
Search Text
string
Yes
Text to search for across all task fields including subject and description.
Limit
number
No
Maximum number of tasks to return. Default: 20.
Outputs
Tasks
object_array
List of tasks matching the search criteria.
Total Returned
number
Number of tasks returned in this response.
Limit
number
The limit used for this request.
List Objects
List all available Salesforce objects for schema discovery
Inputs
Search
string
No
Filter objects by name or label.
Limit
integer
No
Maximum number of objects to return.
Outputs
Objects
string
List of Salesforce objects in JSON format.
Total Count
number
Total number of objects returned.
Download Case Files
Download every file attached to a Salesforce Case (including files on the case's email messages) and return signed URLs.
Inputs
Case Number or Case ID
string
Yes
A Case Number (e.g. 00001026) or the 15/18-character Case ID. Both are accepted — Case Number is resolved to the Case ID automatically.
Max files
integer
No
Maximum number of files to download (default 10, hard cap 50). Default: 10.
Outputs
Case ID
string
The resolved 18-character Salesforce Case Id.
File count
number
Number of files successfully downloaded and re-hosted.
Truncated
boolean
True when the case has more files than max_files allowed; raise max_files or narrow the case scope to retrieve them all.
Total available
number
Total number of files (ContentVersion + Attachment) visible to this user for the case, before max_files truncation.
Files
object_array
List of files with signed file_url, file_name, file_size, content_type, source ('content_version' or 'attachment'), salesforce_id, parent_id, and parent_type ('case' or 'email_message').
Upload File
Upload a file from a URL and attach it to a Salesforce record (Case, Opportunity, Account, or any object with Files enabled).
Inputs
File URL
string
Yes
Public or signed URL of the file to upload. The file is downloaded from this URL and stored in Salesforce.
Parent Record ID
string
Yes
The 15/18-character Id of the record to attach the file to — a Case, Opportunity, Account, or any object with Files enabled.
File name
string
Yes
File name shown in Salesforce, including the extension (e.g. report.pdf). Salesforce uses the extension to classify the file type.
Title
string
No
Display title of the file in Salesforce. Defaults to the file name.
Description
textarea
No
Optional description stored on the file in Salesforce.
Content type
string
No
Optional MIME type of the file, used to derive a file extension when file_name has none. Inferred from the download response when omitted.
Outputs
Parent Record ID
string
Id of the record the file was attached to.
Content Document ID
string
Id of the ContentDocument created for the file.
Content Version ID
string
Id of the ContentVersion created for the file.
File name
string
Final file name stored in Salesforce (extension included).
Success
boolean
True when the file was uploaded and linked to the record.
Triggers
A trigger starts a workflow when its configured event occurs. Configure the event and filters before enabling the trigger.
On Field Change
Trigger when a specific field value changes in a Salesforce object
Configuration
Salesforce Object
select (string)
Yes
The Salesforce object to monitor (e.g., Account, Contact, Lead, Opportunity). Options load from the selected connection.
Field to Monitor
select (string)
Yes
The specific field to monitor for changes (e.g., Status, Stage, Amount). Options load from the selected connection.
Additional Fields to Return
string
No
Additional fields to include in the output (comma-separated, optional).
Filter Condition (SOQL WHERE clause)
string
No
Optional SOQL WHERE clause to filter records (e.g., Priority = 'High').
Event inputs
Record ID
string
Yes
The ID of the record that changed. Default: .
Object Name
string
Yes
The Salesforce object type. Default: .
Field Name
string
Yes
The field that changed. Default: .
Old Value
string
No
The previous value of the field.
New Value
string
No
The new value of the field.
Last Modified Date
string
Yes
When the record was last modified. Default: .
Record Data
string
Yes
Complete record data in JSON format. Default: .
Outputs
Record ID
string
The ID of the record that changed.
Object Name
string
The Salesforce object type.
Field Name
string
The field that changed.
Old Value
string
The previous value of the field.
New Value
string
The new value of the field.
Last Modified Date
string
When the record was last modified.
Record Data
string
Complete record data in JSON format.
On Record Created
Trigger when a new record is created in a Salesforce object
Configuration
Object
select (string)
Yes
The Salesforce object to monitor (e.g., Case, Lead, Opportunity). Options load from the selected connection.
Fields
string_array
No
Fields to return. Leave empty to return every field on the record.
Filter Condition (SOQL WHERE clause)
string
No
Optional SOQL WHERE clause to filter records (e.g., Priority = 'High').
Event inputs
Record ID
string
Yes
The ID of the new record. Default: .
Record
dict
Yes
The record returned by Salesforce. Default: {}.
Outputs
Record ID
string
The ID of the new record.
Record
dict
The record returned by Salesforce.
Important behavior
If an operation is denied, check the connection’s granted permissions and the account’s access in the provider. Reauthorize the connection when it needs additional permissions.
Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.
The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.
Last updated
Was this helpful?

