Salesforce SoqlQuery
Certified
Enterprise Edition
Run SOQL query and fetch rows
Salesforce SoqlQuery
Run SOQL query and fetch rows
Execute a SOQL query via the Partner API with paging enabled by default. Supports returning rows inline, a single row, or storing results to internal storage.
type: io.kestra.plugin.ee.salesforce.SoqlQueryExamples
Query Salesforce Contacts and store as ION file.
id: query_salesforce_contacts
namespace: company.sales
tasks:
- id: query_contacts
type: io.kestra.plugin.ee.salesforce.SoqlQuery
connection:
username: "{{ secret('SALESFORCE_USERNAME') }}"
password: "{{ secret('SALESFORCE_PASSWORD') }}"
authEndpoint: "{{ secret('SALESFORCE_AUTH_ENDPOINT') }}"
query: "SELECT Id, FirstName, LastName, Email FROM Contact WHERE CreatedDate = LAST_WEEK"
fetchType: STORE
Query Salesforce through an API gateway that requires an API key header.
id: query_salesforce_via_gateway
namespace: company.sales
tasks:
- id: query_contacts
type: io.kestra.plugin.ee.salesforce.SoqlQuery
connection:
accessToken: "{{ secret('SALESFORCE_ACCESS_TOKEN') }}"
instanceUrl: "https://salesforce-gateway.example.com"
headers:
x-api-key: "{{ secret('GATEWAY_API_KEY') }}"
query: "SELECT Id, FirstName, LastName, Email FROM Contact"
fetchType: STORE
Installation
This Enterprise plugin requires an Enterprise image and access to the plugin registry. Install it with the following command:
kestractl plugins get io.kestra.plugin.ee:plugin-ee-salesforce --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
Properties
connection *
Salesforce connection
Partner API credentials using username/password with auth endpoint or access token with instance URL.
io.kestra.plugin.ee.salesforce.SalesforceConnection
Salesforce access token
Session or OAuth access token. When set, username and password are ignored; requires instanceUrl.
https://login.salesforce.com/services/Soap/u/63.0/Salesforce authentication endpoint
SOAP login endpoint used with username/password. Defaults to https://login.salesforce.com/services/Soap/u/63.0/.
Additional HTTP headers
Headers sent with every Salesforce request, for example an API key required by an API gateway in front of Salesforce.
With username/password, calls after login go to the serverUrl returned by Salesforce, so use accessToken with an instanceUrl pointing to the gateway when every call must go through it.
Salesforce instance URL
Instance base URL required with accessToken (for example https://mydomain.my.salesforce.com).
Salesforce password
Password for SOAP authentication (append the security token when required, for example <password><token>). Only used when accessToken is empty. For more details, refer to the Salesforce Documentation.
Salesforce username
Username for SOAP authentication. Ignored when accessToken is provided.
query *string
SOQL query
SOQL statement rendered with task variables before execution. Use selective filters to control result size.
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150batchSize integerstring
2000Batch size
Records per page when querying; minimum 200, maximum 2,000. Default is 2,000.
fetchType string
NONESTOREFETCHFETCH_ONENONEFetch strategy
FETCH returns all rows, FETCH_ONE returns the first row, STORE writes all rows to internal storage and returns a URI, NONE returns counts only. Default is NONE.
queryMore booleanstring
truePaginate through results
When true (default), continues with queryMore until all pages are fetched.
Outputs
row object
First fetched row
Populated when fetchType=FETCH_ONE.
rows array
Fetched rows
Populated when fetchType=FETCH.
size integer
Fetched row count
total integer
Total available rows
uri string
uriStored results URI
Populated when fetchType=STORE; points to the internal storage object.