Overview
Thelangchain-salesforce package integrates LangChain with Salesforce CRM,
allowing you to query data, manage records, and explore object schemas
from LangChain applications.
Key Features
- SOQL Queries: Execute Salesforce Object Query Language (SOQL) queries
- Object Management: Create, read, update, and delete (CRUD) operations on Salesforce objects
- Schema Exploration: Describe object schemas and list available objects
- Async Support: Asynchronous operation support
- Error Handling: Detailed error messages
- Environment Variable Support: Load credentials from environment variables
Setup
Install the required dependencies:Authentication Setup
These environment variables will be automatically picked up by the integration.Getting Your Security Token
If you need a security token:- Log into Salesforce
- Go to Settings
- Click on “Reset My Security Token” under “My Personal Information”
- Check your email for the new token
Environment Variables (Recommended)
Set up your Salesforce credentials as environment variables:Instantiation
Invocation
Query
This example queries Salesforce for 5 contacts.Describe an Object
Fetches metadata for a specific Salesforce object.List Available Objects
Retrieves all objects available in the Salesforce instance.Create a New Contact
Creates a new contact record in Salesforce.Update a Contact
Updates an existing contact record.Delete a Contact
Deletes a contact record from Salesforce.Chaining
API reference
For comprehensive documentation and API reference, see:Additional Resources
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.