How To Use UiPath Orchestrator Webhooks

A dialogue from an Indian Soldier “We shouldn’t act on assumptions but need to do so based on confirmations”

Now, This is the time to do things based on confirmations.

Let’s get into the topic –  UiPath Orchestrator Webhooks

First will try to understand some basics related to Webhooks

What is an API?

API is the acronym for Application Programming Interface, which is a software intermediary that allows two applications to talk to each other. Each time you use an app like Facebook, send an instant message, or check the weather on your phone, you’re using an API.

In simple terms, API is an agreed way to send and receive data between computers. For example, if you want to develop a mobile application which shows the google maps, but the maps reside on google servers, then there is a way to ask google server to provide the maps. The way to ask google server to send you the maps is through API provided by the google.

I hope you got a brief idea on API.

Now let us see what are Webhooks and how does it work in UiPath Orchestrator
In simple terms, Webhooks are also sometimes referred to as “Reverse APIs”. Webhooks operate on the concept of “event reaction”. For example, previously we used to check our prepaid balance in mobile phones all by ourselves but now the telecom operators are sending us notifications a week before to recharge a mobile phone. In this case the event is low balance.

With webhooks you will get the notifications when certain events happen on the server. You do not need to poll the server. So a webhook is simply an end-point URL provided by the client-side application to the server-side application.

Webhooks configuration in UiPath Orchestrator

  • Login the orchestrator with tenant admin and password
  • Click on the account which is at the top right corner
  • Select “Webhooks”. Refer below screenshot.

Click on + sign to add webhook.
Refer below screenshot

  • Add “URL”.
    In my case it is http://ip-address:5000. Here you need to change IP-address to your machines IP address or API endpoint, 5000 is the port where my client-side application is running.
  • Check “Disable SSL Verification”. I disabled SSL verification because here I’m using the only HTTP not https.
  • Select event type as “Send All Events” or “Select Individual Events”
  • Click “Save”. Refer below screenshot.

Prerequisites for client

  • Python – Flask(python module)
  • An endpoint or IP address accessible to orchestrator
  • Python client script

from flask import Flask, request
import json
from twilio.rest import Client

app = Flask(__name__)

@app.route(‘/’,methods=[‘POST’])
def foo():
   print request.data
   return “OK”

if __name__ == ‘__main__’:
   app.run(host=’0.0.0.0′)

  • Save the above python script as client.py and run it.
  • If you’re able to see the output as below screenshot, then your script is working fine.
  • Now its time to get all the events from the orchestrator to your client application which can further take an action like sending email to support team, creating a ticket, sending SMS, Whatsapp messages(using Twilio), etc.
  • Here I selected all the events. So whenever any action related to Job, Robot, Process, QueueItem, Queue, and Schedule are performed then will be notified with webhook and you will the output as shown in below screenshot.

 

Hope it has helped you……..

Advertisements

Leave a Reply