Post request from HTML form to on-premise Orchestrator

I would like to submit a post request to an on-premise orchestrator (not cloud) from a web form. The idea is to have the robot start the process “only” when new data is submitted as opposed to have it scheduled around the clock. Is there a step-by-step guide on how to achieve this? It would be great if I could submit a post request and start a process that way. However, any alternative solutions with similar results are welcome.
Thank you!

HI @Francois_Marckendy_Joseph,

I think this will help your to identify Orche. API

Thank you for your reply. I’m not familiar with postman. Is that a server? Sorry, I’m a beginner when it comes to API calls. I’m just curious on how it works

H @Francois_Marckendy_Joseph,

Postman give you the ability to run and tested out APIS or even you can create API using Postman so Uipath created a full doc for their API you can get a better understand of the API anatomy by using Postman link

Happy Automation

Thanks for the reply. I have watched some tutorials on postman and they all seem to be about “testing” APIs and it requires them to launch the postman app (or web app) in order to do so. What I want to happen is when the client click “Submit” on my web form, I want a request to be sent to Orchestrator to start the process (without having to log in to postman). Sorry if I’m misunderstanding all this.

Hi @Francois_Marckendy_Joseph

This is to understand their API you can use following activities to do the calling from your UIpath process

Happy Automation

Thanks again for your reply. However, I’m starting to think that there may not be a way to achieve my goal. I can’t use Uipath Activities to “trigger” the process itself since the activities would require that the process is already running in order to be executed. I’m trying to trigger the Uipath process to start from an html form. I need to be able to make an API call to orchestrator to initiate the Uipath process. Is that possible at all?

This is definitely a possible automation.

You could use Microsoft automate to send Http api requests call to your orchestrator and start a process. We have done a similar integration using a in-house chatbot.

Your approach would be :

When a user submits a form, you get an email or some kind of a triggering event which also has the form data.

Your Microsoft flow/automate form needs to use this trigger.

A) In Microsoft flow /automate you get the authorization token from orchestrator server.

B) Post your form values to a predefined queue. Using send to queue api call

C) The robot can be run in two ways, either using automatic triggers on orchestrator (when a new item is added to the queue) or by sending another api call to Start a job.

Any application which can send api requests can do this for you. It need not be Microsoft automate :slight_smile:

You could even use a simple python script / server which keeps listening to a form submission and performs the A, B, C steps mentioned above.

Thanks for replying. I definitely follow your logic here. But would there be a way to have Microsoft automate (or any other eligible applications) to send the Http API request to orchestrator from the form without having to send the email? I’m trying to do two main things here :

Step 1 ) Remotely trigger a process to start on Orchestrator
Step 2 ) Call step 1 when the form is submitted

I’m still trying to find a solution for step 1 that can be called from the form. Once I have that, then it’s a matter of making the call when the form is submitted. Does that make sense?

Hello Francois,
IN this I start a robot in Orchestrator on Prem from Postman:

and if you reuse some code here you have full Node.JS code in the description of this video:

Thanks,
Cristian Negulescu

1 Like

Hello Jeevith,

would you mind sharing how the Integration with in-house developed chatbot with orchestrator is been done. We also have a similar use case. We have our own chatbot which uses NLU from MS Azure and now we would like to integrate this chat bot to On-Premise Orchestrator. Could not find any information on the forum apart from standard integration with Google Dialogflow and Druid. Thanks in advance.

Regards,
Ganesh Hegde

Hi @Ganesh_Hegde,

Let me break down the approach we used.

The chat platform we used allowed us to send predetermined form data / any chat data from the chatbot to a UiPath queue. We configured the queue such that when the queue is populated with an item, a robot picks up the queue item and run the required process. The chat program you are using might or might not have the functionality to send HTTP requests.

  1. User Payload: A user provides a query string or lets say the chatbot has asked the user a question. The answer to the question can be used as a payload and send to your chatbot server.

  2. In your chat program or the server where the chat was registered, your chat program triggers an event which uses UiPath Orchestrator authentication procedure and later takes the User Payload and adds it as an item to the Queue in your orchestrator. Optionally you could also start the robot process.

    • If it is a password changing robot process, I advice you check if the Chat program ensures that the communication between the Chatbot server, Clients, and output from UiPath Orchestrator are encrypted, so this will affect how you implement Step 2. Encryption will be the hardest challenge here. You want your new password string to be encrypted from Robot Process → Chatbot Server → Chatbot Client. The latter two may have an encryption key already but you will have to encrypt Process Output as Payload and in the Chatbot Server decrypt it with the same encryption key. The last Post, will automatically be encrypted (I am assuming this, you will have to check it. Not sure how this can be done on Azure. On a local machine you could try WireShark to see if your responses are encrypted. Then you use the same approach on Azure to ensure end-to-end encryption)
  3. The UiPath orchestrator will take care of scheduling the process and run it depending on how you want it. Usually, chatbots need to answer ASAP so you will need to ensure you have a free UiPath robot license when request come in. Within your robot you could then use a Post HTTP request which sends back the result to the chatbot server.

  4. Your Chatbot Server recieves the payload and forwards it to your Chatbot Client.

You can use the video reply from @Cristian_Negulescu to build a robust API call regime between your Chatbot Server and UiPath Orchestrator.

Things to also think about:

  1. In the Chatbot Client, you will have inform the user that the process is running in the background and that they will have to wait for a reply.
  2. The Chatbot Client also needs a reponse text if the HTTP requests take too long.
  3. When the Chatbot client registeres the Trigger Event, it has to wait for the whole reply cycle (until UiPath sends the output payload)
  4. Since your Chatbot can have many features as you move forward, you will need to think about how to organize your UIPath Orchestrator Post request for each of those features and choosing which robots can run, which processes.
  5. The above design is more of a POC but is best to not send HTTP post to the Chatbot Client directly and use the Chatbot Server as the middle man to handle incoming and outgoing data from the Chatbot Client

Hope this helps. Good luck with it!

1 Like

Hi @Francois_Marckendy_Joseph,

As I described in the posts above such integrations are possible. All you need to ensure is communication between the form data and UiPath Orchestrator (add as an Queue item).

Form Submission → API Call using Javascript → Forwards the form data as a Queue Item → Runs the robot

If your form is a HTML form, you can do this using Javascript. The pseudo code for it is

  1. Get Form Data after clicking on the submit button
  2. Authenticate with UiPath API (You will need to get an API key from your Orchestrator instance)
  3. Use Add to Queue API endpoint (See: Transaction Requests (uipath.com))
  4. Starting a job (See: Jobs Requests (uipath.com))

Network:
It is always easier if your Form html page is in the same network as your Orchestrator instance, it makes API calls easier and you do not need to open any ports.

@jeevith

Thanks a lot for the detailed information. Our Chatbot already uses HTTP. As you said encryption part we need to take care.

Did you have to develop any custom activities for any purpose ? or Session management was entirely handeled in Chatbot Server ?

In our case, the HTTP requests and responses were all handled by the Chat platform.

On the UiPath end of the solution everything was standard our process did not use any custom activities. I remember this was an early POC so we just used community license of UiPath with the relevant API calls as I mentioned in the Post #12 in this thread.