Relay Onboard Customer Action
  • 05 Sep 2025
  • 6 Minutes to read
  • Dark
    Light

Relay Onboard Customer Action

  • Dark
    Light

Article summary

WARNING
This action makes an external callout to Relay Network. Please be aware of any impacts this has against your Salesforce API limits. Salesforce Callout Limits

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 RelayOnboardingRequest resources to be created and populated.

Action Properties

Field

Description

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.

See: Multiple Relay Clients in a Single Org

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.

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:

  • {!GlobalConstant.True} - Deactivate all previous connections.

  • {!GlobalConstant.False} - Do not deactivate previous connections.

Single Request

Either this field or the Batch Request field or both must be provide.

This value must be a resource variable of type:

Batch Request

Either this field or the Single Request field or both must be provided.

The variable Data Type must be Apex-Defined with the Apex Class set to:

and the Allow multiple values (collection) option checked.

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. This allows you to personalize the message with content specific to the user.

IMPORTANT

When using this property, make sure you have set the Id property of the RelayOnboardingRequest. This must be the id of the record to extract the specified dynamic input values from.

See: Relay Dynamic Inputs

Dynamic input_ Names and Values

Optional value that allows passing of additional information to the triggered Relay message.

This variable Data Type must be Apex-Defined with the Apex Class set to:

and the Allow multiple values (collection) option checked.

See: Relay Dynamic Inputs

CAUTION

This field should not be used in conjunction with a Batch Request. Use the Dynamic input_ Names value instead or use the dynamicinputs property of the RelayOnboardingRequest object.

Ext Data

Optional value that allows passing of additional information that will be stored with the customer record in Relay.

This variable Data Type must be Apex-Defined with the Apex Class set to:

and the Allow multiple values (collection) option checked.

See: Relay Dynamic Inputs

CAUTION

This field should not be used in conjunction with a Batch Request. Instead, use the dynamicinputs property of the RelayOnboardingRequest object.

Onboard Synchronously

Optional. Controls how Relay will process the onboarding request.

Valid values are:

  • {!GlobalConstant.True} - Run the action synchronously - wait for Relay to complete the entire onboarding process return a success or error result. This is best used when onboarding individual users at a time.

  • {!GlobalConstant.False} - Run the action asynchronously - Relay will receive the request and put it on a queue for future processing. You can think of this as being the same as a Salesforce future . This is most performant when onboarding large batches of users at the same time. If you configured the Relay Connected App you will review events in the RelayEvents__c object with additional information related to the onboarding request.

Run in Background job (unmanaged)

Send via Future (managed)

Optional. Specifies if this action should run in a background job or not. If no value is provided, the default value will be false, and the action will run in the current flow context.

  • When running in a background job, the action response code will be a 202, which means the request was accepted and will be run the future.

  • Setting this value to true, is useful to:

    • Get around pending transaction errors while making a callout to Relay Network

    • Avoid slowing down the main flow with callouts

Valid values are:

  • {!GlobalConstant.True} - Run the action in a background job

  • {!GlobalConstant.False} - Run the action in the current flow context.


Run Immediately vs Run Asynchronously Path

Unmanaged vs Managed Package

The Relay Onboard Customer action has a property that controls if the processing will be in the background. The property name is different depending on the package type:

  • Unmanaged package property name: Run in Background job

  • Managed package property name: Send via future

While the managed package has a different label, if the value is set to true, then processing will be done in a background job and not a future thread.

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 Run in Background job property 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 background job, 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.


Was this article helpful?