Registry /
workflow / apache-airflow-providers-salesforce
Install & Compatibility
Where this runs
tested against v5.14.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 5.702s · 416MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 31.2s · import 5.350s · 406MB
417MB installed
● package 417MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SalesforceHook
✓ from airflow.providers.salesforce.hooks.salesforce import SalesforceHook
SalesforceToTableOperator
✓ from airflow.providers.salesforce.operators.salesforce import SalesforceToTableOperator
SalesforceBulkOperator
✓ from airflow.providers.salesforce.operators.bulk import SalesforceBulkOperator
This quickstart demonstrates a basic Airflow DAG using the `SalesforceToTableOperator` to extract data from Salesforce and shows how `SalesforceHook` can be used directly for more custom interactions. Before running, configure a Salesforce connection in the Airflow UI with `Conn Id: salesforce_default` and provide necessary credentials (username, password, security token, login URL).
import os
from datetime import datetime
from airflow.models.dag import DAG
from airflow.providers.salesforce.hooks.salesforce import SalesforceHook
from airflow.providers.salesforce.operators.salesforce import SalesforceToTableOperator
with DAG(
dag_id='salesforce_example_dag',
start_date=datetime(2023, 1, 1),
schedule_interval=None,
catchup=False,
tags=['salesforce', 'example'],
) as dag:
# Example of using SalesforceToTableOperator to extract data
extract_contacts = SalesforceToTableOperator(
task_id='extract_salesforce_contacts',
salesforce_conn_id='salesforce_default', # Ensure this connection is configured in Airflow UI
sobjects=['Contact'],
table_name='airflow_contacts',
selected_fields=['Id', 'FirstName', 'LastName', 'Email'],
where_clause="MailingState = 'CA'",
# Optional: You might push to a database table or another destination
# E.g., postgres_conn_id='postgres_default'
# For this example, we'll just demonstrate extraction.
)
# Example of using SalesforceHook directly (e.g., in a PythonOperator)
def get_salesforce_data(**kwargs):
hook = SalesforceHook(salesforce_conn_id='salesforce_default')
sf_client = hook.get_conn()
# Query the Salesforce API directly
records = sf_client.query("SELECT Id, Name FROM Account LIMIT 5")
print(f"Fetched {len(records['records'])} Account records.")
return records['records']
# You'd typically use a PythonOperator to wrap the hook usage
# from airflow.operators.python import PythonOperator
# fetch_data_task = PythonOperator(
# task_id='fetch_data_with_hook',
# python_callable=get_salesforce_data,
# )
# extract_contacts >> fetch_data_task
airflow --version
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'airflow.providers.salesforce'
The 'apache-airflow-providers-salesforce' package is not installed or not accessible in the Python environment.
fixInstall the package using pip: 'pip install apache-airflow-providers-salesforce'.
ImportError: cannot import name 'SalesforceHook' from 'airflow.providers.salesforce.hooks.salesforce'
The 'SalesforceHook' class has been moved or renamed in the 'apache-airflow-providers-salesforce' package.
fixUpdate the import statement to: 'from airflow.providers.salesforce.hooks.salesforce import SalesforceHook'.
AttributeError: module 'airflow.providers.salesforce.hooks.salesforce' has no attribute 'SalesforceHook'
The 'SalesforceHook' class is not present in the specified module, possibly due to version changes or incorrect import paths.
fixEnsure you are using the correct import path: 'from airflow.providers.salesforce.hooks.salesforce import SalesforceHook'.
Broken DAG: No module named 'airflow.providers.salesforce'
The 'apache-airflow-providers-salesforce' package is missing, leading to DAG import failures.
fixInstall the package using pip: 'pip install apache-airflow-providers-salesforce'.
ImportError: cannot import name 'SalesforceToS3Operator' from 'airflow.providers.salesforce.transfers.salesforce_to_s3'
The 'SalesforceToS3Operator' class has been moved or renamed in the 'apache-airflow-providers-salesforce' package.
fixUpdate the import statement to: 'from airflow.providers.salesforce.transfers.salesforce_to_s3 import SalesforceToS3Operator'.
Upgrade
Version history
5.14.2latest on PyPI · released Aug 8, 2026
Audit
Dependencies
apache-airflowrequiredCore Apache Airflow library; required for running Airflow DAGs and using providers. Minimum version >=2.11.0 is required for provider version 5.13.0+.
simple-salesforcerequiredPython client for the Salesforce API.
pandasrequiredUsed for data manipulation and handling dataframes, particularly in operators that involve data transfer (e.g., to/from tables). Version requirements vary by Python version.
apache-airflow-providers-common-compatrequiredProvides compatibility layers for common Airflow features across different provider versions.
apache-airflow-providers-tableauoptionalRequired for Tableau integration, which was previously an 'extra' of this provider but is now a separate provider package.