Salesforce Trigger

Salesforce Trigger

Certified
Enterprise Edition

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.

yaml
type: io.kestra.plugin.ee.salesforce.Trigger

Trigger workflow when new contacts are created

yaml
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

Salesforce connection

Partner API credentials using username/password with auth endpoint or access token with instance URL.

Definitions
accessTokenstring

Salesforce access token

Session or OAuth access token. When set, username and password are ignored; requires instanceUrl.

authEndpointstring
Defaulthttps://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/.

instanceUrlstring

Salesforce instance URL

Instance base URL required with accessToken (for example https://mydomain.my.salesforce.com).

passwordstring

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.

usernamestring

Salesforce username

Username for SOAP authentication. Ignored when accessToken is provided.

SOQL Query

SOQL query rendered with trigger variables before execution. Use filters such as CreatedDate to limit poll size.

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

DefaultNONE
Possible Values
STOREFETCHFETCH_ONENONE

Fetch 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.

DefaultPT1M
Formatduration

Interval 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.

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Defaulttrue

A 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.

SubTypeobject

Records that triggered the flow

List of rows returned when fetchType includes data (e.g., FETCH). Empty when fetchType=NONE.

Record count

Total rows returned by the SOQL query, regardless of fetch strategy.