Skip to main content

Salesforce

This connector captures data from Salesforce objects into Flow collections. It uses Salesforce's Bulk API 2.0 and REST API.

This connector is available for use in the Flow web application. For local development or open-source workflows, ghcr.io/estuary/source-salesforce-native:dev provides the latest connector image. You can also follow the link in your browser to see past image versions.

Supported data resources

This connector captures Salesforce standard objects, custom objects, and field history for custom objects.

All available objects will appear after connecting to Salesforce.

info

To reduce how many API calls are needed to discover objects, the connector maintains an internal list of standard objects available for replication. If a standard object does not appear as an available binding after connecting to Salesforce, please contact us via Slack or email to request the standard object's addition to the connector's internal list.

Because most Salesforce accounts contain large volumes of data, you may only want to capture a subset of the available objects. There are several ways to control this:

Prerequisites

Authentication

Authentication to Salesforce is done via OAuth and requires the following:

  • A Salesforce organization on the Enterprise tier, or with an equivalent API request allocation.

  • Salesforce user credentials. We recommend creating a dedicated read-only Salesforce user.

Setup

Create a read-only Salesforce user

Creating a dedicated read-only Salesforce user is a simple way to specify which objects Flow will capture. This is useful if you have a large amount of data in your Salesforce organization.

  1. While signed in as an administrator, create a new profile by cloning the standard Minimum Access profile.

  2. Edit the new profile's permissions. Grant it read access to all the standard and custom objects you'd like to capture with Flow.

  3. Create a new user, applying the profile you just created. You'll use this user's email address and password to authenticate Salesforce in Flow.

Configuration

You configure connectors either in the Flow web app, or by directly editing the Flow specification file. See connectors to learn more about using connectors. The values and specification sample below provide configuration details specific to the Salesforce source connector.

Properties

Endpoint

PropertyTitleDescriptionTypeRequired/Default
/start_dateStart DateStart date in the format YYYY-MM-DD. Data added on and after this date will be captured. If left blank, the start date will be set to Salesforce's founding date.string1999-02-03T00:00:00Z
/is_sandboxSandboxWhether you're using a Salesforce Sandbox.booleanfalse
/credentials/credentials_titleAuthentication MethodSet to OAuth Credentials.stringRequired
/credentials/client_idOAuth Client IDThe OAuth app's client ID.stringRequired
/credentials/client_secretOAuth Client SecretThe OAuth app's client secret.stringRequired
/credentials/refresh_tokenRefresh TokenThe refresh token received from the OAuth app.stringRequired
/credentials/instance_urlInstance URLThe URL for the instance of your Salesforce organization.stringRequired
/advanced/window_sizeWindow sizeThe date window size in days to use when querying the Salesforce APIs.integer18250

Bindings

PropertyTitleDescriptionTypeRequired/Default
/nameNameName of the data resource.stringRequired
/intervalIntervalInterval between data syncsstringPT5M
/scheduleFormula Field Refresh ScheduleThe schedule for refreshing this binding's formula fields. Accepts a cron expression. For example, a schedule of 55 23 * * * means the binding will refresh formula fields at 23:55 UTC every day. If left empty, the binding will not refresh formula fields.string55 23 * * *

Sample

This sample specification reflects the manual authentication method.

captures:
${PREFIX}/${CAPTURE_NAME}:
endpoint:
connector:
image: ghcr.io/estuary/source-salesforce-native:dev
config:
credentials:
credentials_title: "OAuth Credentials"
client_id: <secret>
client_secret: <secret>
refresh_token: <secret>
is_sandbox: false
start_date: "2025-03-19T12:00:00Z"
advanced:
window_size: 18250
bindings:
- resource:
name: Account
interval: PT5M
schedule: "55 23 * * *"
target: ${PREFIX}/Account
{...}

Formula Fields

Salesforce objects can contain formula fields, fields whose values are calculated at query time. Since formula fields do not maintain state in Salesforce, formula fields updates do not update the associated record's last modified timestamp. The Salesforce connector uses the last modified timestamp to incrementally detect changes, and since formula field updates don't update the last modified timestamp, formula fields updates are not incrementally captured by the connector.

To address this challenge, the Salesforce connector is able to refresh the values of formula fields on a schedule after the initial backfill completes. This is controlled at a binding level by the cron expression in the schedule property. When a scheduled formula field refresh occurs, the connector fetches every record's current formula field values and merges them into the associated collection with a top-level merge reduction strategy.

Troubleshooting

Field Permissions

If a field is not present in documents captured by the connector but the field exists on the object in Salesforce, confirm that the field is visible for the configured user in Salesforce's field permissions. If the Salesforce account used when authenticating the connector does not have permission to view a field, Salesforce prevents the connector from replicating that field.

To check field permissions in Salesforce:

  1. Go to Setup > Object Manager
  2. Click the object for the specific field (Account, Contact, Opportunity, etc.)
  3. Click "Fields & Relationships" and select the field that is not being captured.
  4. Click "Set Field-Level Security" and make sure the profile of the account used for authentication has visibility for the field.
  5. If the associate profile does not have visibility, update it and click "Save".