RPAMy robot
Run Code project
Run Code project
Runs a Roberty Code project of the workspace with the given arguments, waits for the run to finish and returns the project's output.
Options
Code project
Roberty Code project of the workspace that will be run.
Arguments
Object handed to the project as arguments, for example { "x": 1 }. Optional field; when empty, the project receives {}.
Run on
Sets the device the project runs on:
- Least busy device — default. Among the project's production devices that are online and have the project published, the project runs on the least busy one.
- Current device — the project runs on the same device that runs the robot, which must be part of the project.
Advanced options
Timeout
Maximum time, in milliseconds, the action waits for the project's result. The default value is 600000 (10 minutes). Use 0 to wait indefinitely.
Returns
Javascript code
js
actions["action-id"].requestId // run identifier in Code (Text)
actions["action-id"].response // project output (Any)
Field selection
- requestId — run identifier in Code (Text)
- response — project output (Any)
Rules and conditions
- The Code project and Timeout fields are required.
- With Current device, the device running the robot must be part of the project, be online and have the project published; otherwise the action fails.
- Projects set not to run in parallel (
blockParalleloption in the project'sroberty.json) cannot run on the robot's own device, which is already busy with it:- with Current device, the action fails with the
CODE_PROJECT_BLOCKS_PARALLEL_ON_CURRENT_DEVICEerror; - with Least busy device, the robot's device is left out of the choice; if the project has no other device, the action fails with the
NO_OTHER_DEVICE_FOR_BLOCKING_CODE_PROJECTerror.
- with Current device, the action fails with the
- While waiting, the action checks the run status every 2 seconds.
- If the project run fails, the action fails with the project's error message.
- If the Timeout is reached before the run ends, the action fails with the
TIMEOUTerror.