Skip to main content

langchain-salesforce

PyPI version License: MIT Python Versions CI

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.

Metadata

Release files for langchain-salesforce 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-salesforce 0.2.2
File Size Uploaded
langchain_salesforce-0.2.2.tar.gz 223.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-salesforce 0.2.2
File Interpreter ABI Platform
langchain_salesforce-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 230.0 kB

Release files / langchain_salesforce-0.2.2.tar.gz

Download URL langchain_salesforce-0.2.2.tar.gz
Size 223.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a89ff4797bbb1d56141b6e72b54c637dc4b551fc7a92bfa3e06639c4544c0c2c
BLAKE2b-256 checksum
How to use checksums
b4b81539b7caa507c86c0d680d09df87013cc473d4122c30ff0daa1ebc90f449
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 27, 2025.

Transparency log

Release files / langchain_salesforce-0.2.2-py3-none-any.whl

Download URL langchain_salesforce-0.2.2-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6995ba6cb5915fae12e33b9346cd7c302c8e91106aa000a7364ec8ece34de66a
BLAKE2b-256 checksum
How to use checksums
40d808d912fe7c331e5e489f5cfc436f3de14ff449cb6ea3d6b4ee6f6adff4a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 27, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page