Salesforce Trigger
Certified
Enterprise Edition
Trigger flow from Salesforce query results
Salesforce Trigger
Trigger flow from Salesforce query results
Poll Salesforce with a SOQL query and start a flow when results are found. Uses the Partner API; default interval is 60 seconds and pagination is enabled.
type: io.kestra.plugin.ee.salesforce.TriggerExamples
Trigger workflow when new contacts are created
id: salesforce_contact_trigger
namespace: company.sales
tasks:
- id: notify_sales_manager
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
url: "{{ secret('SLACK_WEBHOOK_URL') }}"
payload: |
{
"text": "New contact created"
}
triggers:
- id: new_contact_trigger
type: io.kestra.plugin.ee.salesforce.Trigger
interval: "PT5M"
connection:
username: "{{ secret('SALESFORCE_USERNAME') }}"
password: "{{ secret('SALESFORCE_PASSWORD') }}"
authEndpoint: "{{ secret('SALESFORCE_AUTH_ENDPOINT') }}"
query: "SELECT Id, FirstName, LastName, Email, Phone, Company, CreatedDate FROM Contact WHERE CreatedDate >= LAST_N_MINUTES:5"
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 query rendered with trigger variables before execution. Use filters such as CreatedDate to limit poll size.
allowConcurrent boolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
fetchType string
NONESTOREFETCHFETCH_ONENONEFetch strategy
How results are returned: NONE (default) returns only counts, FETCH returns all rows, FETCH_ONE returns the first row, STORE writes rows to internal storage.
interval string
PT1MdurationInterval between polling.
The interval between 2 different polls of schedule, this can avoid to overload the remote system with too many calls. For most of the triggers that depend on external systems, a minimal interval must be at least PT30S. See ISO_8601 Durations for more information of available interval values.
stopAfter array
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
when string
trueA condition that determines whether the trigger should run.
A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.
Outputs
records array
Records that triggered the flow
List of rows returned when fetchType includes data (e.g., FETCH). Empty when fetchType=NONE.
size integer
Record count
Total rows returned by the SOQL query, regardless of fetch strategy.