How to
Salesforce scheduled trigger

Georgia White
Georgia White
  • Updated

Scheduled flows are set to trigger at a specific point in time.

This can be once-off, or set to repeat hourly, daily, on specific days, weekly, or monthly, with an optional end date.

Similar to an event-triggered flow, a scheduled flow has criteria that still must be met; however, you have control over when it will trigger and send.

Setting up the trigger and adding criteria

On the Settings tab, select the triggering object for your campaign. A full list of supported objects can be found here.

schedule-trigger-settings-valid-branded.png

The Add criteria section allows you to specify your flow criteria by referencing fields that coincide with any objects that share a one-to-one relationship with the object you have selected for your triggering object. To set a rule, search for (or browse) and select the relevant field name from the Field dropdown.

You can add additional data from SFDC using the Get Salesforce record action in a subsequent node in the flow.

Select the desired Operator and Value to complete your rule.

Click on the Add rule button to further segment recipients. Adding more than one rule also allows you to specify whether the flow should trigger based on all or any of the rules outlined.

You can also create a group of rules by clicking on the Add group button. Once more than one rule is added to a group, you can apply an all or any to your group of rules. This allows you to nest a series of any statements within your all statements, for example, all Contacts with a Status equal to Current, with Region equal to either NSW OR QLD

The ‘record count’ above the criteria builder shows you how many records match the criteria you have selected. If you do not add any rules to your contact filters, the flow will send to ALL records based on the selected object.

The event trigger currently does not support visualising system values associated with any fields from SFDC (for example, picklist values). You must enter the correct values when building the criteria that will trigger the flow.

The format of the fields used in configuring criteria will need to adhere to the SFDC API formats:

Field types in Salesforce →

Date-specific fields in Salesforce →

To configure a boolean field you must enter true or false into the value field. 

For picklist and boolean fields (apart from is null), the value is not case-sensitive.

How to add and find IDs for ID fields

For specific record IDs: Access the required record ID in your web browser. The URL displayed in the browser address bar contains both the Salesforce instance and the Record ID.

Salesforce Classic example

URL: http://na1.salesforce.com/5003000000D8cuI Record ID: 5003000000D8cuI

Lightning Experience example: 

URL: https://na1.lightning.force.com/lightning/r/Case/5003000000D8cuIQAA/view?0.source=alohaHeader

Record ID: 5003000000D8cuIQAA

Create a campaign schedule

On the Schedule tab, select the date and time you would first like the flow to run. You can enter manual dates and times following the format 27/02/2021 or 09:25 (24hr time only) or by clicking on the icons on each field.

By default, the Timezone field will be populated using the timezone of your browser. You can edit this by clicking on the field and then searching for your preferred option.

Add a recurring schedule by clicking the Repeats toggle.

You can set the flow to repeat:

  • Every hour
  • Every day
  • On specific days (e.g. Mondays and Wednesdays)
  • Every week
  • Every month

Note that you cannot set the schedule to repeat on the 29th, 30th, or 31st of the month, as not all months have those dates. The node will display an error.

By default, the flow will continue to trigger indefinitely based on the chosen frequency until it is deactivated. Alternatively, you can also add an optional end date by clicking ends on and adding your preferred date.

Scheduled flows are a great way to automate any repetitive or consistent communications that should be sent on a regular basis. Common examples include a happy birthday SMS, 24hr appointment reminders and monthly invoice or payment notifications.

Activating the Pendula flow

Unlike event-triggered flows, scheduled flows do not create a corresponding SFDC flow in your Salesforce org. Upon activation of the scheduled flow, Pendula creates a SOQL query that will call to SFDC every time the schedule runs.

Each time the scheduled trigger creates a flow, the number of experiences created will match the number of matching records for the query at that point in time:

  • On Tuesday at 9.00am, there are 200 records that match the SOQL query in the trigger. The flow will create and send 200 experiences.
  • On Wednesday at 9.00am the query matches 150 records, the flow will create and send 150 experiences, and so forth.

Using Salesforce formulas 

You can use SFDC Date Literals and Date Formulas in your query. Read more about using these formulas here.

Using the is null operator

The Salesforce scheduled trigger supports the use of the is null operator. The value must be set to true or false, and is case-sensitive. This operator will only work on nullable fields in Salesforce. 

Screenshot 2025-02-05 at 4.39.44 pm.png

Using the like operator

You can use the like operator with supported formulas in your query. The like operator matches single characters and patterns found anywhere in a string—beginning, ending, or somewhere in-between.

Screenshot 2025-02-05 at 4.29.44 pm-unbranded.png

Use case Formula

Match any single character in the string.

For example, to filter on a list of countries, a pattern of _a_a___ will return Bahamas and Jamaica.

Underscore (_)

Match any pattern in the string.

Starting a pattern with a percent sign returns all words that end with the specified characters. The percent sign indicates that any number of characters can precede the specified ones.

Ending a pattern with a percent sign returns all the words that begin with the specified characters. Any number of characters can follow the specified ones. To match a pattern anywhere in a string, the pattern must start and end with a percent sign.

For example, to filter on a list of countries, a pattern of %a%a%returns Bahamas, Jamaica, Slovakia, and Trinidad and Tobago.

Percent sign (%)

Include a literal percent sign or underscore in a pattern

Escape with a backwards slash (\)

Additional wildcard characters and regular expressions aren’t supported.

Editing the Pendula flow

You can edit flows using the Salesforce scheduled trigger as normal in Pendula. See this article for more details on editing active flows.

Troubleshooting

A schedule must be set in the future for a flow to be activated successfully. Before you activate a flow, double-check the trigger schedule on the ‘Schedule’ tab of the node configuration screen.

If a selected schedule cannot be achieved - e.g. if you select an Ends date that is before the first repeat - the flow will go into an ERROR state. To resolve this, edit the flow and select a date range that can be scheduled.

The query for the schedule must display the record count on the trigger node for the flow to trigger correctly. Check the syntax of the criteria value carefully and ensure that it uses the correct format. See below for the correct Salesforce formats.

Field types in Salesforce →

Date-specific fields in Salesforce →

Current known limitations & workarounds

Pendula is regularly releasing updates and fixes for limitations where possible and appropriate. We will continue to update the list below as more capability becomes available.

Limitation Workaround (if applicable)

Operators: the following operators are supported on the scheduled trigger: 

  1. equal to
  2. not equal to
  3. greater than
  4. greater than or equal to
  5. less than
  6. less than or equal to
  7. like
  8. is null

The type of field does not filter operators. The incorrect operator with field type (e.g. less than on a string) may error the flow or cause expected results.

Note that is null is a boolean operator and supports true and false values. These are case-sensitive.

Polymorphic fields: Polymorphic fields, e.g. Owner (User, Group), are not currently supported and won't be available as a field from Salesforce.