Build your first Remote Process Sync integration
Step through an example of how to build a Remote Process Sync integration in order to link the automated processes of two ServiceNow® instances together.
Before you begin
- Activate Remote Process Sync on each instance in your integration by purchasing the Integration Hub Enterprise package. For more information, see Request Integration Hub.
- Activate the explicit roles security feature on each instance in your integration. For more information, see Explicit Role plugin.
- Learn about how to build and manage an Integration Hub Remote Process Sync integration by checking out Getting started with Remote Process Sync.
- Confirm the instances that you will link together in the following example are not production instances. It is recommended to test this example on sub-production instances only in order to avoid overwriting any important data on either instance. You might also want to use a Personal Developer Instance for testing this example integration.
- Confirm that you do not have any existing business rules, workflows, or Workflow Studio flows whose logic will conflict with the flows we will create in the following example.
- Role required: admin
About this task
In the following example, you will step through how to link two ServiceNow instances' automated processes together. The use case for this example is that a customer creates requests for hardware that are fulfilled by a vendor. We will refer to the customer's instance as Instance A, and the vendor's instance as Instance B. We will start by setting up credentials in each instance that can access the remote instance. We will also create a user in each instance that can run the outbound and inbound flows.
Procedure
In Instance A, ensure that your domain is set to
global, and then navigate to System Security > Users and Groups > Users.Select New to open a new User form view, and then fill in the following fields:
Field Description User ID Enter rps.api.instance.aFirst name Enter RPS API User for Instance ASelect Save.
While still on the User form, select Set Password to set a password.
For details, see steps four and five in Configure password for a user.
Reset the password for RPS API User for Instance A.
Navigate back to System Security > Users and Groups > Users and select the User record that you just created.
Navigate to and select the Roles related list.
Select Edit... to configure the user's roles.
In the search window above Collection, enter
ih_process_sync_api.Select ih_process_sync_api and snc_external from the Collection list, and then select the add button (
Add button\) to add these roles to the Roles List.
**Note:** The snc\_external role restricts the access of external users to only the resources they have been explicitly granted access to.
5. Select **Save**.
Select New to open a new User form view, and then fill in the following fields:
Field Description User ID Enter rps.run.asFirst name Enter RPS Run as User ASelect Save.
While still on the User form, select Set Password to set a password.
For details, see steps four and five in Configure password for a user.
Reset the password for RPS Run as User A.
Navigate back to System Security > Users and Groups > Users and select the User record that you just created.
Navigate to and select the Roles related list.
Select Edit... to configure the user's roles.
In the search window above Collection, enter
ih_process_sync_run_as.Select ih_process_sync_run_as from the Collection list, and then select the add button (
Add button\) to add that role to the Roles List.
5. In the search window above Collection, enter `incident_manager`.
6. Select **incident\_manager** from the Collection list, and then select the add button \(
Add button\) to add that role to the Roles List.
7. Select **Save**.
In Instance B, ensure that your domain is set to
global, and then navigate to System Security > Users and Groups > Users.Select New to open a new User form view, and then fill in the following fields:
Field Description User ID Enter rps.api.instance.bFirst name Enter RPS API User for Instance BSelect Save.
While still on the User form, select Set Password to set a password.
For details, see steps four and five in Configure password for a user.
Reset the password for RPS API User for Instance B.
Navigate back to System Security > Users and Groups > Users and select the User record that you just created.
Navigate to and select the Roles related list.
Select Edit... to configure the user's roles.
In the search window above Collection, enter
ih_process_sync_api.Select ih_process_sync_api and snc_external from the Collection list, and then select the add button (
Add button\) to add these roles to the Roles List.
**Note:** The snc\_external role restricts the access of external users to only the resources they have been explicitly granted access to.
5. Select **Save**.
Select New to open a new User form view, and then fill in the following fields:
Field Description User ID Enter rps.run.asFirst name Enter RPS Run as User BSelect Save.
While still on the User form, select Set Password to set a password.
For details, see steps four and five in Configure password for a user.
Reset the password for RPS Run as User B from Instance B.
Navigate back to System Security > Users and Groups > Users and select the User record that you just created.
Navigate to and select the Roles related list.
Select Edit... to configure the user's roles.
In the search window above Collection, enter
ih_process_sync_run_as.Select ih_process_sync_run_as from the Collection list, and then select the add button (
Add button\) to add that role to the Roles List.
5. In the search window above Collection, enter `incident_manager`.
6. Select **incident\_manager** from the Collection list, and then select the add button \(
Add button\) to add that role to the Roles List.
7. Select **Save**.
In Instance A, navigate to IntegrationHub > Connections & Credentials > Credentials, and then select New.
From the list of connection options, select Basic Auth Credentials.
In the form, fill in the following fields:
Field Description Name Enter RPS Vendor CredentialsUser name Enter rps.api.instance.bPassword Enter the password for RPS API User for Instance B. Note: The credentials you enter must match the credentials for the RPS API User that you created in Instance B.
Select Submit.
While still in Instance A, navigate to IntegrationHub > Connections & Credentials > Connection & Credential Aliases, and then select New.
In the Name field, enter
RPS Vendor Demo.Leave all other fields as they are, and then select Submit.
From the list, select the
RPS Vendor Demorecord that you just created.In the Connections related list, select New.
In the form, fill in the following fields:
Field Description Name Enter RPS Vendor.Credential Select the lookup using list icon (
Lookup using list icon\), and then select the `RPS Vendor Credentials` record from the list.|
|Connection URL|Enter the base URL of Instance B. The URL should begin with `https://` and end with `.service-now.com/`|
5. Leave all other fields as they are, and then select **Submit**.
In Instance B, navigate to IntegrationHub > Connections & Credentials > Credentials, and then select New.
From the list of connection options, select Basic Auth Credentials.
In the form, fill in the following fields:
Field Description Name Enter RPS Customer CredentialsUser name Enter rps.api.instance.aPassword Enter the password for RPS API User for Instance A. Note: The credentials you enter must match the credentials for the RPS API User that you created in Instance A.
Select Submit.
While still in Instance B, navigate to IntegrationHub > Connections & Credentials > Connection & Credential Aliases, and then select New.
In the Name field, enter
RPS Customer Demo.Leave all other fields as they are, and then select Submit.
From the list, select the
RPS Customer Demorecord that you just created.In the Connections related list, select New.
In the form, fill in the following fields:
Field Description Name Enter RPS Customer.Credential Select the lookup using list icon (
Lookup using list icon\), and then select the `RPS Customer Credentials` record from the list.|
|Connection URL|Enter the base URL of Instance A. The URL should begin with `https://` and end with `.service-now.com/`|
5. Leave all other fields as they are, and then select **Submit**.
We've successfully created credentials that can be used to access each remote instance. Now, let's ensure that we can send and receive data between instances by configuring the Remote System record for a Process Sync Definition in each instance.
In Instance A, navigate to IntegrationHub > Remote Process Sync > Process Sync Definitions, and then select New.
In the form, fill in the following fields:
Field Description Name Enter Hardware Request ProcessDescription Enter Process for requesting hardware and handling fulfilled hardware requestsLeave all other fields as they are, and then select Submit.
From the list, select the
Hardware Request Processrecord that you just created.
In the Remote Systems related list, select New.
In the form, fill in the following fields:
Field Description Name Enter Vendor Instance - Instance BDescription Enter Vendor instance that fulfills hardware requestsConnection Alias Select the lookup using list icon (
Lookup using list icon\), and then select the `RPS_Vendor_Demo` record from the list.|
|Inbound API User|Select the lookup using list icon \(
Lookup using list icon\), and then select the `RPS API User for Instance A` record from the list.|
|Run as|Select the lookup using list icon \(
Lookup using list icon\), and then select the `RPS Run as User` record from the list.|
2. In the context header, select the additional actions icon \(
Additional actions icon\) and then select **Copy sys\_id**.
You will need this Sys ID as the value for the External ID field of the Remote System record in Instance B.
3. Leave all other fields as they are, and then select **Submit**.
In Instance B, navigate to IntegrationHub > Remote Process Sync > Process Sync Definitions, and then select New.
In the form, fill in the following fields:
Field Description Name Enter Hardware Fulfillment ProcessDescription Enter Process for fulfilling hardware requestsLeave all other fields as they are, and then select Submit.
From the list, select the
Hardware Fulfillment Processrecord that you just created.
In the Remote Systems related list, select New.
In the form, fill in the following fields:
Field Description Name Enter Customer Instance - Instance ADescription Enter Customer instance that requests hardwareExternal ID Paste the value of the Sys ID that you copied from the Remote System record in Instance A. Connection Alias Select the lookup using list icon (
Lookup using list icon\), and then select the `RPS_Customer_Demo` record from the list.|
|Inbound API User|Select the lookup using list icon \(
Lookup using list icon\), and then select the `RPS API User for Instance B` record from the list.|
|Run as|Select the lookup using list icon \(
Lookup using list icon\), and then select the `RPS Run as User` record from the list.|
2. Leave all other fields as they are, and then select **Submit**.
3. From the Remote Systems related list, select the `Customer Instance - Instance A` record.
4. In the context header, select the additional actions icon \(
Additional actions icon\) and then select **Copy sys\_id**.
You will need this Sys ID as the value for the External ID field of the Remote System record in Instance A.
In Instance B, navigate to IntegrationHub > Remote Process Sync > Remote Systems - All, and then select the
Customer Instance - Instance Arecord from the list.In the External ID field, paste the value of the Sys ID that you copied from the Remote System record in Instance A.
Select Update to save your changes to the record.
From the list, select the
Customer Instance - Instance Arecord.In the Related links section, select Validate and Activate Remote System.
You should see a message that displays
Remote system validated and activated successfully. If you see an error message instead, go back and check the configuration for the Remote System record.
We have successfully connected Instance A and Instance B together so that they can share data across their process workflows. Now, we will define how our integration will trigger and run automatically, as well as which fields we want to capture and sync between instances.
In Instance A, navigate to IntegrationHub > Remote Process Sync > Process Sync Definitions, and then select the
Hardware Request Processrecord from the list.In the Process Events related list, select New.
In the Name field, enter
Request Hardware.Note: This field is case-sensitive. It functions similarly to an API endpoint method name.
Leave all other fields as they are, and then select Submit.
In the Process Events related list, select New.
In the Name field, enter
Hardware Request Fulfilled.Leave all other fields as they are, and then select Submit.
In the Capture Definitions related list, select New.
- In the form, fill in the following fields:
| Field | Description | |
|---|---|---|
| Process Event | select the lookup using list icon \( Image omitted: lookup-using-list-icon.png Lookup using list icon\), and then select the `Request Hardware` record from the list. | |
| State | Select Active | |
| Source Table Name | Select Incident [incident] | |
| Filter | In the condition builder, select Assignment Group > is and then select the lookup using list icon ( Image omitted: lookup-using-list-icon.png Include fieldsLookup using list icon). Choose the <code>Hardware</code> record from the list.</td></tr><tr><td> | Select the following fields and then select the add item button ( Image omitted: slushbucket-add-item-icon.png - Short description - Assignment group - Severity - State Note: Sys ID is already included in the Selected list. Leave this field in the Selected list as well.Add item button) to add them to the Selected list:- Number |
2. Leave all other fields as they are, and then select **Submit**.
In the Outbound Flows related list, select New.
- In the form, fill in the following fields:
| Field | Description |
|---|---|
| Process Event | From the list, select Request Hardware. |
| Outbound Subflow | Select To make a copy, follow these steps.
|
| Remote System | Select the lookup using list icon \( Image omitted: lookup-using-list-icon.png Lookup using list icon\), and then select the `Vendor Instance - Instance B` record from the list. |
2. Leave all other fields as they are, and then select **Submit**.
In Instance B, navigate to IntegrationHub > Remote Process Sync > Process Sync Definitions, and then select the
Hardware Fulfillment Processrecord from the list.In the Process Events related list, select New.
In the Name field, enter
Request Hardware.Leave all other fields as they are, and then select Submit.
In the Process Events related list, select New.
In the Name field, enter
Hardware Request Fulfilled.Leave all other fields as they are, and then select Submit.
Note: Create Process Event records in both instances with names that match. This will help you keep track of the linked process workflows between instances.
In the Capture Definitions related list, select New.
- In the form, fill in the following fields:
| Field | Description | |
|---|---|---|
| Process Event | select the lookup using list icon \( Image omitted: lookup-using-list-icon.png Lookup using list icon\), and then select the `Hardware Request Fulfilled` record from the list. | |
| State | Select Active | |
| Source Table Name | Select Incident [incident] | |
| Filter | In the condition builder, select Assignment Group > is and then select the lookup using list icon ( Image omitted: lookup-using-list-icon.png Include fieldsLookup using list icon). Choose the <code>Hardware</code> record from the list. Then, select <strong>AND</strong> to add another condition and select <strong>Incident state</strong> > <strong>is</strong> > <strong>Resolved</strong>.</td></tr><tr><td> | Select the following fields and then select the add item button ( Image omitted: slushbucket-add-item-icon.png - State - Resolved by - Resolution notes - Resolution code Note: Sys ID is already included in the Selected list. Leave this field in the Selected list as well.Add item button) to add them to the Selected list:- Number |
2. Leave all other fields as they are, and then select **Submit**.
In the Outbound Flows related list, select New.
- In the form, fill in the following fields:
| Field | Description |
|---|---|
| Process Event | From the list, select Hardware Request Fulfilled. |
| Outbound Subflow | Select To make a copy, follow these steps.
|
| Remote System | Select the lookup using list icon \( Image omitted: lookup-using-list-icon.png Lookup using list icon\), and then select the `Customer Instance - Instance A` record from the list. |
2. Leave all other fields as they are, and then select **Submit**.
We have successfully set up how our Remote Process Sync integration will trigger, and which fields will be captured and sent to either remote instance. In this final section, we will customize the inbound flows in Workflow Studio so that they properly transform inbound data.
In Instance B, navigate to IntegrationHub > Remote Process Sync > Process Sync Definitions, and then select the
Hardware Fulfillment Processrecord from the list.Make a copy of the
Remote Process Sync Inbound Flow Template - Basicrecord.Navigate to Workflow Studio and select the Subflows tab.
Filter the Name column to locate the
Remote Process Sync Inbound Flow Template - Basicrecord and select it.In the subflow, select the More Actions menu, then select Copy subflow.
In the subflow, update the Payload.
Expand the
Transform Payload from Inbound Sampleaction.In the Sample Payload field, enter the following sample payload:
{"capture_metadata":{"changed_by":"admin","timestamp":"2020-09-24 19:26:59"}, "changed_fields":[ {"display_value":"","value":"incident","key":"sys_class_name"}, {"display_value":"","value":"552c48888c033300964f4932b03eb092","key":"sys_id"}, {"display_value":"","value":"INC0040015","key":"number"}, {"display_value":"","value":"","key":"short_description"}, {"display_value":"Hardware","value":"9f5b572d9cd82010f877a5cfd1fdce30","key":"assignment_group"}, {"display_value":"","value":"1","key":"severity"}, {"display_value":"","value":"2","key":"state"}]}Note: This payload is a complex object that represents the captured metadata and fields that are sent from Instance A to Instance B.
Select Done.
In the subflow, under the
Elseflow logic, select Create Incident Record.Add the following fields and associated values:
Field Value Short description Select the data pill picker icon (
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **short\_description**.|
|Description|Select the data pill picker icon \(
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **short\_description**.|
|Assignment group|Select the data pill picker icon \(
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **assignment\_group**.|
|Urgency|Select the data pill picker icon \(
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **severity**.|
|State|Select the data pill picker icon \(
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **state**.|
2. Select **Done**.
Under the
Ifflow logic next tothen, select Update Incident Record.In the Fields input, add the following fields and associated values:
Field Value Short description Select the data pill picker icon (
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **short\_description**.|
|Description|Select the data pill picker icon \(
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **short\_description**.|
|Assignment group|Select the data pill picker icon \(
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **assignment\_group**.|
|Urgency|Select the data pill picker icon \(
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **severity**.|
|State|Select the data pill picker icon \(
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **state**.|
2. Select **Done**.
Publish the subflow.
Back in the Hardware Fulfillment Process record, in the Inbound Flows related list, select New.
In the form, fill in the following fields:
Field Description Process Event From the list, select Request Hardware. Inbound Subflow Select Copy of Remote Process Sync Inbound Flow Template - Basic.Remote System Select the lookup using list icon (
Lookup using list icon\), and then select the `Customer Instance - Instance A` record from the list.|
2. Leave all other fields as they are, and then select **Submit**.
In Instance A, navigate to IntegrationHub > Remote Process Sync > Process Sync Definitions, and then select the
Hardware Request Processrecord from the list.Make a copy of the
Remote Process Sync Inbound Flow Template - Basicrecord.Navigate to Workflow Studio and select the Subflows tab.
Filter the Name column to locate the
Remote Process Sync Inbound Flow Template - Basicrecord and select it.In the subflow, select the More Actions menu, then select Copy subflow.
In the subflow, update the Payload.
Expand the
Transform Payload from Inbound Sampleaction.In the Sample Payload field, enter the following sample payload:
{"capture_metadata":{"changed_by":"admin","timestamp":"2020-10-26 14:18:45"}, "changed_fields":[ {"display_value":"","value":"incident","key":"sys_class_name"}, {"display_value":"","value":"d4cdfce8db4c2410cfe4d9595e96197b","key":"sys_id"}, {"display_value":"","value":"INC0040014","key":"number"}, {"display_value":"","value":"101","key":"state"}, {"display_value":"","value":"Resolved by caller","key":"close_code"}, {"display_value":"System Administrator","value":"6816f79cc0a8016401c5a33be04be441","key":"resolved_by"}, {"display_value":"","value":"","key":"close_notes"}]}Note: This payload is a complex object that represents the captured metadata and fields that are sent from Instance B to Instance A.
Select Done.
Under the
Ifflow logic next tothen, select Update Incident Record.In the Fields input, add the following fields and associated values:
Field Value State Select the data pill picker icon (
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **state**.|
|Resolved by|Select the data pill picker icon \(
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **resolved\_by**.|
|Resolution notes|Select the data pill picker icon \(
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **close\_notes**.|
|Resolution code|Select the data pill picker icon \(
Data pill picker icon\). Dot-walk to and then select **1 - Transform Payload from Inbound Sample** > **Changed Fields** > **close\_code**.|
2. Select **Done**.
In the subflow, delete the
Elsestatement.Publish the subflow.
Back in the Hardware Fulfillment Process record, in the Inbound Flows related list, select New.
In the form, fill in the following fields:
Field Description Process Event From the list, select Hardware Request Fulfilled. Inbound Subflow Select Copy of Remote Process Sync Inbound Flow Template - Basic.Remote System Select the lookup using list icon (
Lookup using list icon\), and then select the `Vendor Instance - Instance B` record from the list.|
2. Leave all other fields as they are, and then select **Submit**.
Result
We've finished building our Remote Process Sync integration. The integration will now trigger whenever a user creates an Incident record with the Hardware assignment group in Incident A. When this happens:
- The fields specified in Instance A's Capture Definition are captured and stored in a local record.
- The local record is correlated with a remote record in Instance B.
- The captured fields are mapped to the fields we specified in Instance B's Inbound Flow.
Then, when a user resolves the correlated Incident record in Instance B:
- The fields specified in Instance B's Capture Definition are captured and stored in a local record.
- The local record is correlated with the remote record in Instance A.
- The captured fields are mapped to the fields we specified in Instance A's Inbound Flow.
What to do next
Test out your Remote Process Sync integration by creating an Incident record in Instance A with the Hardware assignment group. Then, resolve the correlated Incident record in Instance B. If your correlated records don't sync as expected, check your Inbound API User's credentials and Process Sync Definition configuration in each Instance. If you continue to experience issues with your example integration, refer to Monitoring and troubleshooting your integration.