Skip to content

Wait for Event (Salesforce) v3.0.12 Help

Listens for event notifications from Salesforce when an object has been created, modified, deleted, or undeleted and then starts the Flow.

How can I use the Step?

The Step lets you trigger a Flow when a specific event occurs in Salesforce. Automating this process helps reduce manual errors, improve efficiency, and ensure that essential data is always current.

How does the Step work?

The Step listens to event notifications from Salesforce via the Salesforce API. To subscribe to Salesforce events, the Step uses OneReach.ai Event Connector. You can configure the Step to listen for events for a specific object and event type.

Once the Flow is activated, the Step starts listening to events from Salesforce. So when an event notification is received, the Step triggers the Flow and responses with the event data (see Output example).

Prerequisites

Before you get started, you must do the following:

  • Obtain the Consumer Key and Consumer Secret of the Salesforce Connected App you want to authorize the Step with. For more information about creating and configuring a Connected App, see Create a Connected App documentation.
  • Install the OneReach.ai Event Connector in your Salesforce account and subscribe to the relevant events. To learn more, follow Event subscriptions.

Authorization

To authorize the Step, you can inherit authorization from a previous Step, select existing authorization or create a new one.

Here are the steps to create a new Salesforce authorization:

  1. For Select authorization in the current Step, choose the Create a new authorization option from the dropdown.

  2. In the Add an authorization popup, do the following:

    • For Your Connected Apps, select an existing Connected App or click Add a new Connected App and provide the required details in a popup:

      • Name this Connected App: Connected App name.
      • Environment: Environment choice for the Connected App in Salesforce. Either production or sandbox.
      • Consumer Key: Consumer Key for Connected App in Salesforce (see Prerequisites).
      • Consumer Secret: Consumer Secret for Connected App in Salesforce (see Prerequisites).
      • Callback URL: OAuth 2.0 redirect URL. You must use it as Callback URL when creating Connected App on Salesforce.
    • Name your new authorization.

    • Choose where to save the authorization.

    • Authorize the Step by clicking Authorize now or pasting the authorization URL into a web browser.

Once the Step is authorized, all related settings are automatically updated, and you can continue with the Step settings.

Event Subscriptions

To configure event subscriptions with Salesforce, you must install the OneReach.ai Event Connector in your Salesforce account. Then, you can create subscriptions for the object and event types you want to listen to.

To create an event subscription:

  1. In Salesforce, click the App Launcher in the top-left corner, search for "Event," and click "OneReach.ai Event Connector" in the Apps list.
  2. In the Settings tab, click Add Event Connection.
  3. Fill in the following details:
    • Object Name: Object that you selected in the Event types dropdown in the Step UI.
    • Events: Events that you want to follow.
    • Endpoint URL: Flow endpoint URL of the Step.
    • Purpose: (Optional) Description for this event subscription.
  4. Click Save.
  5. Repeat steps 2-4 for each event you want to listen to with the Step.

Note: It is impossible to identify the author of the event.

Once subscribed to the events on Salesforce, configure the Step events settings:

  • Flow endpoint URL: Endpoint URL for creating an event subscription on Salesforce (see procedure below).
  • Events: The events you previously subscribed to on Salesforce using the OneReach.ai Event Connector. When adding a new event, you can select an object type and review the output structure.
  • Separate event data by event type: Switch to choose whether to receive event data grouped by event type or as a single stream.

Important: You can use the Step to listen only to those events you've subscribed to with OneReach.ai Event Connector.

Security

To ensure security, the Step only accepts requests from IP addresses on the whitelist. You can specify a list of IP addresses and ranges in the Whitelisted IP addresses field. The default value for this field is the Salesforce recommended IP ranges documentation.

Advanced settings

You can use this section to configure the following parameter:

  • API version: The Salesforce API version for requests. The value must be in the format 50 or 50.0 and contain at least two characters. The default API version is 50, and the minimum supported version is 37.

Merge field settings

The Step returns the result as a JSON object and stores it in the Merge field variable. So you can use the retrieved data in subsequent Steps or other Flows.

Output example

The output includes the standard Salesforce attributes for the object, such as Id, CreatedDate, and LastModifiedDate. Still, it may vary depending on the Salesforce event being listened to and the fields available in the Salesforce record associated with that event. Here's an example:

json
{
    "action": "",
    "attributes": {
        "type": "",
        "url": ""
    },
    "OwnerId": "",
    "CreatedById": "",
    "CreatedDate": "",
    "Id": "",
    "LastModifiedById": "",
    "SystemModstamp": "",
    "LastModifiedDate": "",
    "IsDeleted": ""
}
{
    "action": "",
    "attributes": {
        "type": "",
        "url": ""
    },
    "OwnerId": "",
    "CreatedById": "",
    "CreatedDate": "",
    "Id": "",
    "LastModifiedById": "",
    "SystemModstamp": "",
    "LastModifiedDate": "",
    "IsDeleted": ""
}

Error Handling

By default, the Handle error toggle is on, and the Step handles errors with a separate exit. If any error occurs during the Step execution, the Flow proceeds down the error exit.

If the Handle error toggle is disabled, the Step does not handle errors. In this case, if any error occurs during the Step execution, the Flow fails immediately after exceeding the Flow timeout. To prevent the Flow from being suspended and continue handling errors, you can place the Flow Error Handling Step before the main logic or your Flow.

Reporting

After the Step completes, it generates a report that includes its execution status and other details. You can customize the report by adjusting the Step's log level and adding tags.

Log level

By default, the Step's log level matches that of the Flow. You can change the Step's log level by selecting an appropriate option from the Log level dropdown.

Tags

Tags provide a way to classify and search for sessions based on their attributes. To create a new tag, specify its category, label, and value. You can then use tags to filter and group the sessions in the report.

Service dependencies

  • flow builder v2.28.3
  • event-manager v2.3.0
  • deployer v2.6.0
  • library v2.11.3
  • studio v2.64.1
  • authorizer 2 service v2.1.6
  • salesforce data provider

Release notes

v3.0.12

  • Add API version selection to the Step UI

v3.0.10

  • Update Authorization Manager v 1.2.10

v3.0.9

  • Update tooltips on UI
  • Update error handling logic
  • Remove extra data
  • Add filter to Events.

v3.0.8

  • Implement Authorization Manager v 1.1.0
  • Add Step migration

v3.0.7

  • Fix the URL issue

v3.0.4

  • Replace or-select with or-select-expression in a search filter
  • Fix style

v3.0.3

  • Update Authorization Manager v1.0.5
  • Add dynamic instance_url

v3.0.2

  • Update Authorization Manager v1.0.4