Triggering UiVision BOTs from Servicenow Orchstrator

Looking for some help/guidance in terms of invoking UIVision BOTs (Desktop automation) from Servicenow Orchstrator

In one of the topic, i can see that it is possible. But when i tried, it doesnt work.

Does someone have a how-to documentation on this orchestration? or a video explaining the steps?

Any response would be appreciated.

Hi! Did you already try using the RPA command line API? This should work well:

For example, you should be able to call the RPA software via a ServiceNow PowerShell activity:

https://docs.servicenow.com/bundle/london-servicenow-platform/page/administer/orchestration-activity-designer/task/t_CreateAPowershellActivity.html

So technically the flow is:

Servicenow Orchstrator → Powershell script → UI.Vision RPA command line

Ui.Vision RPA can be fully controlled via Powershell. Some example scripts are here:

This works for web and desktop automation. The great thing about this is that you can test everything with Powershell and then “connect” it to Servicenow Orchstrator.

Note: I have not used Servicenow Orchstrator, but have used other schedulers and created a lot of Powershell RPA scripts.

Some RPA + Powershell tutorials:

and

Hi. Thanks for your response.

Yes we are using Ui Vision Command line API both python & powershell. But no luck.

We are using playandwait method as mentioned in RPA docs.
Python:
PlayAndWait(timeout_seconds = 60, username = username, password =password, path_downloaddir = r’C:\Users\Ayush\Downloads\’, path_autorun_html = r’C:/uivision/UI.Vision-TestCase1.html’, browser_path=r’C:\Program Files (x86)\Google\Chrome\Application\chrome.exe’)

powershell:
#Launch Kantu for Chrome via command line
& “C:\Google\Chrome\Application\chrome.exe” “file:///D:/UIVision/UI.Vision-TestCase1.html?cmd_var1=username&cmd_var2=password&closeBrowser=1&closeKantu=0&closeKantu=0&direct=1&savelog=log1.txt”

Once we execute these commands from servicenow MID server, we could see chrome.exe running in task manager, but nothing in the foreground. we made sure the uivision html file is located in the destination machine.

Then we tried simulating the same exercise by invoking standard application like notepad.exe through powershell, result is the same. notepad.exe gets created which we can see in task manager, but does not show in foreground.

Need some help here.

Ah, I think I know what the issue is: Two issues:

(1) If you are doing desktop automation, the machine needs to be unlocked.

See here: How to run desktop automation on a locked machine

There are two good options:

  • Run RPA inside a virtual machine (VM) (very secure)

  • Autologin (less secure, but every easy to do)

notepad.exe gets created which we can see in task manager, but does not show in foreground.

(2) You need to make sure that ServiceNow starts the task as a normal user, not as a background or service account. I think that happens now. That is why you do not even see the Notepad app!

I guess Service Now has an option for this. I found this which sounds like the same issue solved: Workflow Run Script as a specific user - ServiceNow Community

If Service Now can not run a script as different user, you can do this directly in your Powershell script. If you google “Powershell runas different user” you will find a few good links for impersonation. For example:

Thanks.

My VM is in unlocked state. But still couldnt make it work either trough standalone powershell or through servicenow orchestrator.

…so if you just start a Powershell file like this one manually, it still does not work? If you run the PS script, what happens then? A short screencast might be helpful to understand what goes wrong.