Developing Robots
Task-based scripts
Step-by-step instructions for how to create and run, "hello world" job!
We'll start by creating a test.rb file and then output a simple message there
So after creating the file, paste the following code and save it
#!/usr/bin/env ruby
puts "Hello, I'm AnyRobot! 😀"With the file prepared this way, go to the portal and click create then workflow.
On this page, we need to enter a name such as test-workflow-rb, select the bot on which we want to perform this workflow, and in genre select file-based and upload the newly created test.rb file, the completed form should look roughly like this.

Once done, click Save and after going to the next page, click Save again and you should be taken to the newly created workflow page. From here you should be able to click the green play button which should run the uploaded script on the bot.
The test script is very short so you probably won't even notice when it has executed but you can go into AnyRobot Runner and check the activity monitor where you will notice that the script has executed.

Task-based example
I highly encourage you to check out the sample repository for a task-based solution. You can find them in this git repository.
Project-based scripts
To be announced...
Configuring project settings
This is a configuration file in which we can set universal tasks for all scripts from a given project.
Project-based example
To check out an example of a project solution you need to fork this repository.
Then you need to copy the portal's public key which is located in the admin panel under SSH-keys and after that, you need to add it as a deploy key in the settings of your forked repository.
The last step is to create a new project in the portal, to do that you need to click create -> project and then enter there the name of the repository and the ssh link to that repository.
After completing these steps you should already be able to create a new workflow using the script from the project.
Environment variables
The important thing when creating robots is to know the available environment variables that can come in handy. Below is a list of available variables divided into 3 parts:
Valid for any job
ANYROBOT_PORTAL_URL- URL of portal which Runner uses.ANYROBOT_WORKFLOW_ID- Internal (UUID) Workflow ID.ANYROBOT_WORKFLOW_NAME- Name of the workflow (in orchestrator).ANYROBOT_WORKFLOW_GENRE- Genre of workflow executed (valid list: “project”, “file”).ANYROBOT_JOB_ID- Currently executed Job ID.ANYROBOT_JOB_TRIGGER_GENRE- How Job was triggered (valid list: “manual”, “webhook”, “schedule”).ANYROBOT_JOB_TRIGGER_ID- Id of job trigger (can be null if manual etc) - uuid.ANYROBOT_BOT_ID- Bod id (uuid).ANYROBOT_BOT_NAME- Bot name (used in orchestrator).ANYROBOT_PAYLOAD_FILE- the path of the payload json file.
Additional variables for project-based jobs
ANYROBOT_PROJECT_ID- Id of the project.ANYROBOT_PROJECT_NAME- Project name in orchestrator.ANYROBOT_PROJECT_URL- Project (repo) name in orchestrator.ANYROBOT_PROJECT_BRANCH- Project (branch) used by orchestrator/runner.ANYROBOT_TASK_NAME- Task name used by orchestrator (example: “general/test.rb”).
Additional variables for file-based jobs
ANYROBOT_TASK_FILE- Path to the downloaded task file.
Overview
It can also be very helpful when creating new robots and scripts to read these documents:
Once you're familiar with them, you'll know the vast possibilities AnyRobot provides to help you with your automation.
Last updated