{"id":4876,"library":"apache-airflow-providers-salesforce","title":"Apache Airflow Salesforce Provider","description":"The `apache-airflow-providers-salesforce` package is an Apache Airflow provider that enables seamless interaction with the Salesforce platform. It offers operators, hooks, and sensors to perform various operations such as data extraction, data loading, and executing Salesforce API calls directly from Airflow Directed Acyclic Graphs (DAGs). The current version is 5.14.0, and the package maintains an active development cycle with frequent monthly or bi-monthly releases to introduce new features, improvements, and bug fixes.","status":"active","version":"5.14.0","language":"en","source_language":"en","source_url":"https://github.com/apache/airflow/tree/main/airflow/providers/salesforce","tags":["apache-airflow","salesforce","provider","etl","crm","data-integration"],"install":[{"cmd":"pip install apache-airflow-providers-salesforce","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core Apache Airflow library; required for running Airflow DAGs and using providers. Minimum version >=2.11.0 is required for provider version 5.13.0+.","package":"apache-airflow","optional":false},{"reason":"Python client for the Salesforce API.","package":"simple-salesforce","optional":false},{"reason":"Used for data manipulation and handling dataframes, particularly in operators that involve data transfer (e.g., to/from tables). Version requirements vary by Python version.","package":"pandas","optional":false},{"reason":"Provides compatibility layers for common Airflow features across different provider versions.","package":"apache-airflow-providers-common-compat","optional":false},{"reason":"Required for Tableau integration, which was previously an 'extra' of this provider but is now a separate provider package.","package":"apache-airflow-providers-tableau","optional":true}],"imports":[{"symbol":"SalesforceHook","correct":"from airflow.providers.salesforce.hooks.salesforce import SalesforceHook"},{"symbol":"SalesforceToTableOperator","correct":"from airflow.providers.salesforce.operators.salesforce import SalesforceToTableOperator"},{"symbol":"SalesforceBulkOperator","correct":"from airflow.providers.salesforce.operators.bulk import SalesforceBulkOperator"}],"quickstart":{"code":"import os\nfrom datetime import datetime\nfrom airflow.models.dag import DAG\nfrom airflow.providers.salesforce.hooks.salesforce import SalesforceHook\nfrom airflow.providers.salesforce.operators.salesforce import SalesforceToTableOperator\n\nwith DAG(\n    dag_id='salesforce_example_dag',\n    start_date=datetime(2023, 1, 1),\n    schedule_interval=None,\n    catchup=False,\n    tags=['salesforce', 'example'],\n) as dag:\n    # Example of using SalesforceToTableOperator to extract data\n    extract_contacts = SalesforceToTableOperator(\n        task_id='extract_salesforce_contacts',\n        salesforce_conn_id='salesforce_default', # Ensure this connection is configured in Airflow UI\n        sobjects=['Contact'],\n        table_name='airflow_contacts',\n        selected_fields=['Id', 'FirstName', 'LastName', 'Email'],\n        where_clause=\"MailingState = 'CA'\",\n        # Optional: You might push to a database table or another destination\n        # E.g., postgres_conn_id='postgres_default'\n        # For this example, we'll just demonstrate extraction.\n    )\n\n    # Example of using SalesforceHook directly (e.g., in a PythonOperator)\n    def get_salesforce_data(**kwargs):\n        hook = SalesforceHook(salesforce_conn_id='salesforce_default')\n        sf_client = hook.get_conn()\n        # Query the Salesforce API directly\n        records = sf_client.query(\"SELECT Id, Name FROM Account LIMIT 5\")\n        print(f\"Fetched {len(records['records'])} Account records.\")\n        return records['records']\n\n    # You'd typically use a PythonOperator to wrap the hook usage\n    # from airflow.operators.python import PythonOperator\n    # fetch_data_task = PythonOperator(\n    #     task_id='fetch_data_with_hook',\n    #     python_callable=get_salesforce_data,\n    # )\n    # extract_contacts >> fetch_data_task\n","lang":"python","description":"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)."},"warnings":[{"fix":"To use Tableau integration, install `apache-airflow-providers-tableau` as a separate provider package: `pip install apache-airflow-providers-tableau`.","message":"The `[tableau]` extra has been removed since provider version 5.0.0. Installing `apache-airflow-providers-salesforce[tableau]` will no longer work for Tableau integration.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Ensure your Airflow environment meets the minimum version requirement (`apache-airflow >=2.11.0`) before installing this provider. If you're on an older Airflow, upgrade Airflow first and then run `airflow upgrade db` if prompted after automatic upgrade.","message":"Minimum Apache Airflow version requirements have increased over time. For provider version 5.13.0 and newer, `apache-airflow >=2.11.0` is required. Older provider versions required `2.1.0+` or `2.2+`. Installing this provider with an older Airflow version might trigger an automatic Airflow upgrade.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Design your DAGs to respect Salesforce API limits. Utilize batch operations where possible (e.g., `SalesforceBulkOperator`), implement retries with exponential backoff, and consider staggering heavy operations.","message":"Salesforce API calls are subject to rate limits. Frequent or large data operations without proper throttling or batching can lead to API limits being hit, causing task failures.","severity":"gotcha","affected_versions":"All"},{"fix":"Before using any Salesforce operator or hook, configure a Salesforce connection in the Airflow UI (Admin -> Connections). Ensure all required fields (Host, Login, Password, Security Token) are correctly populated. The security token is especially critical if your IP address is not whitelisted by Salesforce.","message":"All Salesforce operations require a configured Airflow connection. Incorrect connection details (e.g., wrong username, password, security token, or login URL) will lead to authentication failures.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}