- 13 Nov 2024
- 5 Minutes to read
- Print
- DarkLight
Relay Onboard Customer Action
- Updated on 13 Nov 2024
- 5 Minutes to read
- Print
- DarkLight
The RelayOnboardingAction is used to onboard a user to the Relay platform and optionally send a Relay experience to that user.
If the user does not exist in Relay, they will be added. If the user already exists in Relay, then the existing user will be updated. This is considered an upsert type of transaction.
This action will return a RelayActionResponse object with the status of the action.
PREREQUISITE
This action requires a RelayOnboradingRequest resources to be created and populated.
Action Properties
Field | Description |
---|---|
Default Relay Trigger ID | Optional. If the RelayOnboardingRequest variable ( Single Request or Batch Request below) does not provide a Trigger ID then this default value will be used. |
Relay Client ID | Optional field that should be left off. This is only used when your Salesforce org is configured to use multiple Relay clients at the same time which is a rare requirement. |
Deactivate Previous Connections | Optional. Within Relay, a connection refers to a mobile number and its TCPA consent value. Relay allows multiple connections to be added to a single user. Because this action is an upsert transaction (we insert a new user or update an existing user), it is possible to add additional mobile numbers to the user. This setting allows you control if new mobile numbers should be added to an existing user or should they be replaced. Valid values are:
|
Single Request | Either this field or the Batch Request field or both must be provide. This value must be a resource variable of type RelayOnboardingRequest. |
Batch Request | Either this field or the Single Request field or both must be provided. This value must be a resource variable of type RelayOnboardingRequest. with the Allow multiple values |
Dynamic input_ Names | Optional value that contains a list of field names whose values will be extracted by this action and passed along with the triggered message. See: Relay Dynamic Inputs |
Dynamic input_ Names and Values | Optional value that allows passing of additional information to the triggered Relay message. The value must be a variable resource type of Apex-Defined and RelayDynamicInput collection. See: Relay Dynamic Inputs
|
Ext Data | Optional value that allows passing of additional information that will be stored with the customer record in Relay. The value must be a variable resource type of Apex-Defined and RelayDynamicInput collection. See: Relay Dynamic Inputs
|
Onboard Synchronously | Optional. Controls how Relay will process the onboarding request. Valid values are:
|
Send via Future | Optional. Specifies if this action should run in a future or not. If no value is provided, then this action will not run in a future. When running as a future, the response code will be a 202, which means the request was accepted and will be run the future. Valid values are:
|
Run Immediately vs Run Asynchronously Path
NOTE
While not required, Relay recommends executing the RelayOnboardAction in the Run Asynchronously path of the flow. Or, if running in the Run Immediately path setting the Send as Future value to {!$GlobalConstant.True}.
Run Asynchronously Path 👍
When creating a Record-Triggered Flow you have the option of using a Run Immediately path, Run Asynchronously path, or both. Relay recommends putting the RelayOnboardAction in the Run Asynchronously path. The reason is that the onboarding action makes a callout to the Relay platform and while the callout is very responsive, any callout to any system will be slower than flow actions that are simply running in Salesforce. Therefore, to not impact your primary flow logic and ensure your record is inserted/updated as quickly as possible we recommend the asynchronous path. The other advantage to this approach is that it allows you to branch on the result of the onboarding callout. So if there is any failure, you can take appropriate action in the flow.
Run Immediately Path with Send as Future
Another option, for maximum performance, is to put the RelayOnboardAction in the Run Immediately path and then set the action’s Send as Future value to {!GlobalConstant.True}. The flow, upon executing the action, will place the action in a queue to be scheduled and executed at a later time allowing the rest of the flow to continue running.
The downside to this approach is that when running in a future the RelayOnboardingAction will return immediately with a status of 202. This status means the onboarding request was accepted and will run in a future time. Therefore, your flow has no means of branching in the event the onboarding request to Relay fails.