--- title: "Relay Onboard Customer Action" slug: "onboarding-action" updated: 2025-09-05T15:06:18Z published: 2025-09-05T15:06:18Z canonical: "docs.relaynetwork.com/onboarding-action" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.relaynetwork.com/llms.txt > Use this file to discover all available pages before exploring further. # Relay Onboard Customer Action WARNINGThis action makes an external callout to Relay Network. Please be aware of any impacts this has against your Sales*f*orce API limits. [Salesforce Callout Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_timeouts.htm) 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](/v1/docs/relayactionresponse) object with the status of the action. > [!NOTE] > PREREQUISITE > > This action requires a [RelayOnboardingRequest](/docs/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](/v1/docs/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: - [RelayOnboardingRequest](/v1/docs/relayonboardingrequest). for unmanaged package - [RelaySF_RelayOnboardingRequest](/docs/relayonboardingrequest) for managed package | | 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: - [RelayOnboardingRequest](/v1/docs/relayonboardingrequest) for unmanaged package - [RelaySF__RelayOnboardingRequest](/docs/relayonboardingrequest) for managed package 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. > [!WARNING] > 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](/v1/docs/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: - [RelayDynamicInput](/docs/relaydynamicinput) for unmanaged package - [RelaySF__DynamicInput](/docs/relaydynamicinput) for managed package and the **Allow multiple values (collection)** option checked. See: [Relay Dynamic Inputs](/v1/docs/relay-dynamic-inputs) > [!CAUTION] > 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](/v1/docs/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: - [RelayDynamicInput](/docs/relaydynamicinput) for unmanaged package - [RelaySF__DynamicInput](/docs/relaydynamicinput) for managed package and the **Allow multiple values (collection)** option checked. See: [Relay Dynamic Inputs](/v1/docs/relay-dynamic-inputs) > [!CAUTION] > CAUTION > > This field should **not** be used in conjunction with a **Batch Request**. Instead, use the **dynamicinputs** property of the [RelayOnboardingRequest](/v1/docs/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 > [!WARNING] > 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. Every message experience created in the Relay CXB is automatically assigned a unique Trigger ID. Once assigned, the Trigger ID never changes. This ID is used when you send a message to a customer/user. However, you do have the ability to associate a unique, friendly client trigger ID to the message that is easier to remember. Triggering refers to sending the user an SMS text message that contains a personalized URL. The URL will take the user to their personalize Feed. Telephone Consumer Protection Act (TCPA) requires that the recipient of the SMS (your customers) must grant permission for you to send them text messages Triggering refers to sending the user an SMS text message that contains a personalized URL. The URL will take the user to their personalize Feed. A future method runs in the background, asynchronously. You can call a future method for executing long-running operations, such as callouts to external Web services or any operation you’d like to run in its own thread, on its own time. An Apex callout enables you to tightly integrate your Apex with an external service by making a call to an external Web service or sending a HTTP request from Apex code and then receiving the response. Apex provides integration with Web services that utilize SOAP and WSDL, or HTTP services (RESTful services).