Starting an OpenRPA Robot with OpenFlow and Node-RED

Hello guys!

I wanted to ask if there is a solution for my problem.

So, i have a Robot that is scratching info about worktime of employees. This robot works with a local app. I need to run this robot every morning, but instead starting it manually i wanna do a form in OpenFlow with some input parameters (like date the report is gonna be created) and a button that starts the Node-RED flow where the robot is triggered. I tried with dashboard buttons in Node-RED and realized that this is not what i need. So I ask you for help :frowning:

Thank you in advance!

I’m not sure i completely understand.
Starting a robot by clicking play, starting it from Node-RED using an inject node or using a openflow form or Node-RED dashboard with a button, all involves a manual process ( clicking a button ).
Are you looking for another way to present “the button to click” ? or are you looking for something that automates this, so you do not have to click a button ?

  • If the first, could you tell more about your requirements ? why is a Node-RED dashboard or openflow form not good enough ? what is missing ?
  • if the latter. Well, if you already have a workflow in Node-RED that can do it, you can install one of the manual scheduling modules in node red to automate it. I personally like the cron module, but there are many options.
    There is also a post dedicated to different ways of automating a robot here:
    Scheduling Robot

Sorry, i’ll explain easier. Let’s skip the robot sequence.

So here is my form with the button “Open RPZ” (no, i don’t wanna automate this button, it will be pressed by me or another coworker).

I try to inject next actions like “switch” and some debugs by pressing the button in openflow forms. i’m new here and don’t understand many things, i tried to find some documentation about how to inject robot from openflow using form, but found nothing.

I saw this guy https://www.youtube.com/watch?v=yOEKMKeVUSA doing the work i needed, but he didn’t show the code to inject and functions (i need only this section).

The main problem is how to connect the OpenFlow Forms Button to Node-RED so the openrpa robot can inject itself from button pressing.

My English is kinda bad, I try my best to explain more clearly my problem :smile:

A video would be better, but I’m not mentally in a place where i can record something, so I am going to try here.

Forms can be used by an agent, or from Node-RED

When using Node-RED you need to use these two nodes
image

The idea is, everything starts from the first node, and using functions nodes ( with multiple out’s ) and/or switch nodes, and “end” using the last node, that will then update the current state and status of the workflow instance.

When you add the “workflow in” node and give it a name it will add an entry under “form workflows” inside openflow. ( if you enable “web” )
image

When you click the workflow on the “form workflows” section of openflow, it well send a message to the “workflow in” and you can now add logic for what form to show and/or add data to the form fields. To begin with the msg.payload will be empty, so this is an indicator send the first form to the user.
When a user clicks a button on a form, you can get that by reading “submitbutton” on the msg.payload, so if you want present multiple options for the user, this is how you detect what button was pressed. ( each button name will also be present in the msg.payload as a boolean value i thing )

In the most basic form, you would simply show only one form. Something like this


In this case, the workflow would instantly get completed and show whatever is on “toms form” … ie you cannot do anything else. If we left out the form, the user would get redirected to the front page. That can be confusing, since you don’t know if the workflow did what it was suppose to, so you might add some login.
So if you add a button to the form ( like you your screenshot ) and add a switch and set status to idle at the top, and completed at the button “workflow out” node
image
Inside the switch we then check if the user has pressed the button.
if not, then the user just started the workflow, so we show the form and go idle ( idle=waiting for user input )
once button is pressed, we complete the workflow ( and after that you could trigger the openra robot )

using these simple building block you can create VERY complex workflows ( and if you are using assign workflow it can becomes even crazyer but lets save that for a later post or video )

For more simple flows that just need to show multiple forms, i like to have a “stage” field on the payload. This allows to for easily creating back and forward buttons in the workflow ( wizards )

You can “feed” data into the form, from node-red … if the data is already in openflow, you might also look into “form resources” in openflow. This allows you to create a “view” of data, than can then be used insert select/auto complete boxes in the form.

Okey, I will try by following your advices

Thanks a lot!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.