An integration package connecting Salesforce and LangChain
Project description
langchain-salesforce
LangChain integration for Salesforce CRM. Query data with SOQL, inspect schemas, and manage records (CRUD) directly from your LangChain applications.
Installation
pip install -U langchain-salesforce
Configuration
Set these environment variables:
| Variable | Description |
|---|---|
SALESFORCE_USERNAME |
Your Salesforce username |
SALESFORCE_PASSWORD |
Your Salesforce password |
SALESFORCE_SECURITY_TOKEN |
Your Salesforce security token |
SALESFORCE_DOMAIN |
login (production) or test (sandbox). Default: login |
Quick Start
from langchain_salesforce import SalesforceTool
tool = SalesforceTool()
# Query contacts
result = tool.run({
"operation": "query",
"query": "SELECT Id, Name, Email FROM Contact LIMIT 5"
})
Operations
| Operation | Description | Required Parameters |
|---|---|---|
query |
Execute SOQL queries | query |
describe |
Get object schema | object_name |
list_objects |
List all SObjects | — |
create |
Create a record | object_name, record_data |
update |
Update a record | object_name, record_id, record_data |
delete |
Delete a record | object_name, record_id |
get_field_metadata |
Get field details | object_name, field_name |
Examples
# Describe an object
tool.run({"operation": "describe", "object_name": "Account"})
# Create a record
tool.run({
"operation": "create",
"object_name": "Contact",
"record_data": {"LastName": "Doe", "Email": "doe@example.com"}
})
# Update a record
tool.run({
"operation": "update",
"object_name": "Contact",
"record_id": "003XXXXXXXXXXXXXXX",
"record_data": {"Email": "updated@example.com"}
})
# Delete a record
tool.run({"operation": "delete", "object_name": "Contact", "record_id": "003XXXXXXXXXXXXXXX"})
Development
git clone https://github.com/colesmcintosh/langchain-salesforce.git
cd langchain-salesforce
uv sync --all-groups
make format # Format code
make lint # Run linters
make test # Run tests
See CONTRIBUTING.md for guidelines.
License
MIT License. See LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_salesforce-0.2.2.tar.gz.
File metadata
- Download URL: langchain_salesforce-0.2.2.tar.gz
- Upload date:
- Size: 223.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a89ff4797bbb1d56141b6e72b54c637dc4b551fc7a92bfa3e06639c4544c0c2c
|
|
| MD5 |
1b2e97a66a22d066c51e4f92a56a8e89
|
|
| BLAKE2b-256 |
b4b81539b7caa507c86c0d680d09df87013cc473d4122c30ff0daa1ebc90f449
|
Provenance
The following attestation bundles were made for langchain_salesforce-0.2.2.tar.gz:
Publisher:
release.yml on colesmcintosh/langchain-salesforce
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_salesforce-0.2.2.tar.gz -
Subject digest:
a89ff4797bbb1d56141b6e72b54c637dc4b551fc7a92bfa3e06639c4544c0c2c - Sigstore transparency entry: 780546724
- Sigstore integration time:
-
Permalink:
colesmcintosh/langchain-salesforce@ff4b0e2b1dae263ee89cad90bc0a4de3d53f6049 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/colesmcintosh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ff4b0e2b1dae263ee89cad90bc0a4de3d53f6049 -
Trigger Event:
push
-
Statement type:
File details
Details for the file langchain_salesforce-0.2.2-py3-none-any.whl.
File metadata
- Download URL: langchain_salesforce-0.2.2-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6995ba6cb5915fae12e33b9346cd7c302c8e91106aa000a7364ec8ece34de66a
|
|
| MD5 |
e0c469240fd5fe51aaa4363f7158288c
|
|
| BLAKE2b-256 |
40d808d912fe7c331e5e489f5cfc436f3de14ff449cb6ea3d6b4ee6f6adff4a8
|
Provenance
The following attestation bundles were made for langchain_salesforce-0.2.2-py3-none-any.whl:
Publisher:
release.yml on colesmcintosh/langchain-salesforce
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_salesforce-0.2.2-py3-none-any.whl -
Subject digest:
6995ba6cb5915fae12e33b9346cd7c302c8e91106aa000a7364ec8ece34de66a - Sigstore transparency entry: 780546730
- Sigstore integration time:
-
Permalink:
colesmcintosh/langchain-salesforce@ff4b0e2b1dae263ee89cad90bc0a4de3d53f6049 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/colesmcintosh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ff4b0e2b1dae263ee89cad90bc0a4de3d53f6049 -
Trigger Event:
push
-
Statement type: