Running your robot in Robocorp Cloud
Now that our robot is done, what used to take Maria hours each week now happens in a matter of seconds!
There is still one detail, though: Maria would need to install Robocorp Lab, download our robot code, click that
>> button to run our robot... It beats copying and pasting data for hours each week for sure, but we can make life even easier for her: it would be great if the robot could run automatically in the cloud, for example, every Friday at noon. How can we do it?
By using Robocorp Cloud, of course!
A factory in the cloud
Think about an old school car factory: you have various assembly lines, which are set up so that a series of operations are performed on the car that moves down them. Robocorp Cloud works the same way. You set up an assembly line (the Process), and you can add to it multiple operations (the Steps) that are performed on whatever you are working on.
Our robot is really simple for now, and it fits all in one step, but in the future, we could add more, or we could decide to split the robot into multiple steps, and Robocorp Cloud supports that easily.
Robocorp Cloud is very powerful and can support very complicated workflows. What we see here is the easiest possible scenario. Beginners' course, remember? 😀
To set this all up, we will have to go through these steps:
- Logging into Robocorp Cloud
- Creating a new Organization for RobotSpareBin Industries
- Creating a new Workspace
- Creating a new Robot
- Uploading the robot code
- Creating a Process (the "assembly line", remember?)
- Adding the Step to the Process and setting it up
- Executing and scheduling the process.
Still with us? Great!
Logging into Robocorp Cloud
Visit https://cloud.robocorp.com and log into your Robocorp Cloud account:
Creating a new organization
Organizations allow you to group users, workspaces, processes, and robots. When you registered for your Robocorp Cloud account, an example personal organization was created for you. You are sure that this robot will only be the first of a long list, so you decide to create an organization for RobotSpareBin Industries!
On the Robocorp Cloud homepage, click on the
New organization button, and enter the details for RobotSpareBin Industries:
Creating a new workspace
Inside the new organization, we need to create a workspace. A common use case is to create a workspace for the production environment, and one or more for development and staging environments. We will only create the production workspace for now:
On the Robocorp Cloud homepage, click on the
Create workspace button inside our new organization, and create a new workspace called
Creating a new robot
While on the
Production workspace page, click on the
Robots link in the top bar. Click on the button to create a new robot.
Sales Data Robot, leave the other options unchanged, and click on the
Pushing the robot code
For this step to work, make sure that your Robocorp Lab installation is linked to your Robocorp Cloud account.
Ok! We have a robot created in Robocorp Cloud, and we have the robot on our local computer. Now it's time to send it soaring into the cloud by uploading the robot code.
Important: We will want to use the
robotsparebin-complete robot in Robocorp Lab for this part:
- Close your current robot by closing the Robocorp Lab window, and open the
robotsparebin-completeone from the Welcome Screen.
- Click on the
Publish to Robocorp Cloudbutton on the top right corner.
- Select the
Productionworkspace from the list on the left, then the
Sales Data Robotrobot, and click on the
Publish to Robocorp Cloudbutton:
- You should see a green success message.
Whew! That's our robot setup taken care of. Let's move to the Process!
Creating a new process
Click on the
Processes link in the top bar. Click on the button to create a new process. (It works just like adding a new robot!) :)
Let's give it an evocative name, like
Maria's copy paste weekly marathon:
Access the configuration for our process by clicking on it:
So many buttons! But no worry, we will go step by step as always. 🙂
Adding the robot step to the Process
Think of all the robots that you will add in Robocorp Cloud as your "robot fleet in the garage": you have them safe there, and they are available when you need them in your processes.
Next, we want to associate our robot to our process, and select a runtime environment for it:
- Click on the
Add stepbutton in the
Stepssection in the Process detail page.
- A popup window will appear: select
Sales Data Robot > RobotSpareBin Complete.
- Select the default
robocorp/robocontainer:latestoption from the
- Click on the
Add to processbutton.
Wait, what is a runtime environment? 🤔
During development, each time you clicked on the
>> button, you were running the robot on your local computer. When using Robocorp Cloud, the robot can be executed in different ways. The easiest way is to run the robot in a "cloud runtime environment", something we can call a "virtual machine".
For now, it's enough for you to know that in Robocorp Cloud all robots need a runtime environment to run, and the easiest way is to use a Robocorp Hosted environment, so that everything happens in the cloud.
This is not the only option: you also have the possibility of having your computer (or Maria's) running the robot locally, but triggered by Robocorp Cloud. That is the job of Robocorp App.
Whew! That was a lot of clicking! But now the fun starts!
Running the process
All is set now for our robot to run in the cloud!
Go back to the list of processes by clicking on the
Processes link in the top bar, and click on the
Start button for our
Maria's copy-paste weekly marathon process. You will be taken to a new screen where you can follow how the process is going! After some time, you should see a "Success" message:
Great! The robot is now happily running in the cloud!
Viewing the results
When the robot has finished running, we can look at the details of how the process worked out:
Run artifacts section, we can see our familiar screenshot of the sales summary, and the PDF that we generated!
Scheduling the process
We have already done so much to improve Maria's life. But right now, she would need to log into Robocorp Cloud herself and push the
Start button. Or, even worse, call you every Friday at 12 to push the button, and that's no way to live your life! 😀
Instead, now that the robot is configured to run in Robocorp Cloud, we can schedule it to run automatically!
Go back to the details page for our Process, find the "Scheduler" section, and set it up like this:
Now Robocorp Cloud will start our robot exactly at 12 every Friday.
Maria is off the hook completely, and she can do more interesting stuff at RobotspareBin. Maybe she will get a promotion; after all, optimizing this was her idea!
What we learned
- You can run robots in Robocorp Cloud with the push of a button!
- You need to upload your robot's code to Robocorp Cloud.
- You need to create a Process to run your robots.
- A robot step can be run in multiple processes.
- You need to select a runtime environment for your robot step when you add it to a process.
- A "runtime environment" is the actual computer that will execute the robot: it can be a Docker container in the cloud, or a physical machine running the Robocorp App.
- You can schedule your processes in Robocorp Cloud to run at specific intervals automatically.