
Salesforce Trigger
CertifiedEnterprise EditionTrigger 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"
Properties
connection *RequiredNon-dynamic
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/.
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 *Requiredstring
SOQL Query
SOQL query rendered with trigger variables before execution. Use filters such as CreatedDate to limit poll size.
allowConcurrent Non-dynamicboolean
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 Non-dynamicstring
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 Non-dynamicarray
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.