OBLYTECH Logo
OBLYTECH Logo

Connecting UiPath Automation to ServiceNow with Integration Hub

Connecting UiPath to ServiceNow means activating the UiPath spoke in Integration Hub and saving a connection and credential alias with your UiPath account details. You can authenticate with OAuth or an API key. OAuth needs spoke version 2.2.1 or later and cannot run through a MID Server, so your network path often decides the route.

What the UiPath spoke covers

The UiPath spoke is the ServiceNow Store application that links the two platforms. Once active, Workflow Studio flows can start UiPath jobs, look up robots and queues, and receive job events from UiPath. For how spokes are built, cloned and maintained in general, see ServiceNow Integration Hub spokes: build, clone or maintain.

Verify compatibility with your UiPath version before proceeding. If you are comparing with another spoke, the Okta spoke guide covers its setup and actions.

What you need before you open the connection form

Three ServiceNow-side items come first. The instance needs an Integration Hub subscription, which is a separate subscription. The UiPath spoke has to be activated, and the person configuring the connection needs the admin role. Spoke versions 2.4.0 and later can use feature-specific admin roles instead, so confirm which role your spoke version needs.

On the UiPath side, collect your account details first. For UiPath Cloud Platform you need the token URL, a client ID, the account logical name, the tenant logical name and the user key. For a UiPath Platform installed on a private or public cloud, you need the tenant name and credentials that can authenticate the Orchestrator API.

OAuth or API key: choosing the route

The two routes differ in version requirements, MID Server support and the UiPath values you collect. The table lists the differences that matter when you choose. For the wider question of which integration pattern suits a given flow, see ServiceNow integration methods: which pattern to choose.

Point OAuth API key
Minimum spoke version 2.2.1 Not applicable
MID Server Cannot be used Supported, with conditions
Role for setup Admin Admin
Starting point in UiPath Register an external application Read the API access values
ServiceNow template UiPath Configuration Template – OAuth Client Credentials UiPath Cloud, or Private/Public Cloud
Certificate for on-premises MID Server Not applicable SSL certificate from a trusted certificate authority

If your instance can reach UiPath directly and your spoke is at 2.2.1 or later, OAuth avoids the MID Server path altogether. If your traffic has to pass through a MID Server, the API key route is the one that supports it. Pick the route first, then gather the values that route needs.

Setting up the OAuth route

The OAuth setup has two halves. Start in UiPath. Log in as an administrator, go to Admin, then External Applications, and select Add Application. Enter an application name and set the application type to Confidential application.

Under Resources, add the Orchestrator API Access resource and select these scopes: OR.Robots.Read, OR.Robots.Write, OR.Jobs.Read, OR.Jobs.Write, OR.Machines.Read, OR.Execution.Read, OR.Queues.Read, OR.Queues.Write and OR.Folders.Read. In the redirect URL field, enter the redirect URL of your ServiceNow instance. When you click Add, UiPath displays an App ID and an App Secret. Copy and record both now, since the ServiceNow credential form asks for them.

Then move to ServiceNow. Go to All, then Connections & Credentials, then Connection & Credential Aliases, and open the UiPath record. Set the configuration template to the OAuth client credentials option, then click the Create New Connection & Credential related link. The credential fields take the App ID as the OAuth client ID, the App Secret as the OAuth client secret, and the same instance redirect URL you registered in UiPath. Click Create, then Submit.

Last, open the UiPath connection record from the Connections tab and select a value for the Orchestrator Feature Enabled field.

Setting up the API key route

The API key route also starts in UiPath. Log in to your cloud account as an administrator, go to Preferences, then Privacy & Security. For the tenant you need, select View API access. The page shows four values: the user key, the organization ID, the tenant name and the client ID. Record them before you open ServiceNow.

In ServiceNow, open the UiPath alias record and choose the template that matches your deployment. The two templates ask for different fields, so do not copy values from one form to the other.

The UiPath Cloud template asks for a connection name, a connection URL built from your platform address, a credential name, the token URL, the client ID, the account logical name, the tenant logical name and the user key. The account logical name takes the organization ID you copied, and the tenant logical name takes the tenant name.

The Private/Public Cloud template asks for a connection name, the UiPath instance URL, a credential name, a token URL that points at the authenticate endpoint on your instance, the tenant name, and a username or email address with its password.

If you run this route through a MID Server, the Use MID server option must be enabled on the connection record, and an SSL certificate from a trusted certificate authority must be in place for on-premises support. Click Create, then Submit, then set the Orchestrator Feature Enabled field on the UiPath connection record, the same final step as the OAuth route.

How connection and credential aliases work

A Connection & Credential alias labels a credential or connection record, and you can add connection attributes to it so flows in Workflow Studio can use them. For the alias and promotion side of Integration Hub authentication, see Integration Hub authentication: aliases and promotion.

Credentials stored in Connections and Credentials are encrypted and managed by ServiceNow. You can update a credential without changing the connection configuration, and the change applies to new requests. Each connection shows a status. Configured means the connection is set up, Connected means it is working and ready, and Expired means the authentication credentials have expired. Not Configured and Deactivated cover connections that are incomplete or switched off.

Running UiPath actions through a MID Server

The spoke’s calls can run on the instance or, when Use MID server is set, on a MID Server, which gives you a route for calls that have to leave through your own network. The connection record linked to the alias controls where actions run. On the Private/Public Cloud template, MID Server users need the sn_uipath_spoke.uipath_admin role.

To enable it, go to All, then IntegrationHub, then Connection & Credential Alias. Open the UiPath alias, go to the Connections tab, and open the default connection record. Select Use MID server, and the Advanced MID Server Configuration tab appears. Choose Auto-Select MID Server to let the instance pick a server, Specific MID Server to pin one, or Specific MID Cluster to use a group.

A MID Cluster is a group of MID Servers. When you choose Specific MID Server cluster, automatic reassignment selects from members of that cluster. Auto-select chooses a server based on MID Server criteria, such as the application and capability it supports.

Receiving UiPath job, robot and process events

Events flow from UiPath to ServiceNow through webhooks. The webhook registry holds the callback address and secret, and the routing policies decide which subflow runs for each incoming event. Confirm the ServiceNow roles your instance requires for the webhook registry and routing policy records before you start.

Start in ServiceNow. Go to UiPath, then UiPath Webhook Registry, and select New. Enter a name and a description, then select Generate Callback URL and Secret. Copy both values. Generate New Secret changes the secret later, and the new value must then be entered in UiPath as well.

Next, open UiPath, then UiPath WebHook Routing Policies. The spoke ships with three policies, covering jobs, robots and processes. Each has a condition and an answer, which is the subflow to trigger when the condition is met. Set the condition and answer, then click Update. The Active flag defaults to False, so switch it to True for each policy you use.

Then register the callback in UiPath. Log in as an administrator, go to Orchestrator, then Tenant, and open the Webhooks tab. Select Add webhook, enter the callback URL and the secret, tick Enabled, choose the events to subscribe to, and save.

The registry accepts Job, Robot and Process events, and the spoke validates the secret before it accepts data. Once the policies are active, incoming data fills the ServiceNow tables that Automation Center reads. For a broader approach to diagnosing failures like these, see the ServiceNow Integration Hub troubleshooting guide.

What the spoke gives your flows

The prebuilt actions are grouped by the UiPath area they touch: environments, folders, jobs, machines, processes, queues, releases, robots and sessions. Job actions include looking up a job by ID, looking up jobs with a filter query, and starting jobs.

Three default subflows answer the routing policies for job, process and robot events. A fourth, Process UiPath Any Webhook, handles any other entity. To build a new subflow, copy a default one so the default input payload items remain in place.

Environment, robot and session actions work within classic folders. For modern folders, set the Execution Target on the Start Jobs action to Allocate Dynamically. For the wider RPA picture of bots, queues and monitoring in ServiceNow, see ServiceNow RPA capabilities.

Frequently asked questions

Which authentication route should I choose for the UiPath spoke?

Choose OAuth when your instance can reach UiPath directly and your spoke is at version 2.2.1 or later. Choose the API key route when the connection has to pass through a MID Server, because OAuth cannot be used with one.

Who needs the admin role for the setup?

On spoke versions before 2.4.0, both setups call for the admin role. From 2.4.0 the spoke uses feature-specific admin roles instead of the broad admin role.

Why does the OAuth registration ask for a redirect URL?

Enter the same instance redirect URL in the UiPath application registration and in the ServiceNow credential form.

Why might a webhook event not reach my flow?

Check the routing policy’s Active flag, check the callback URL and secret match the registry record, and make sure the event is Job, Robot or Process.