Robot YAML configuration format

Robot YAML format

For a robot.yaml to be valid, it has only two mandatory parts:

  • At least one task defined, and that must have either command, shell or robotTaskName defined.
  • Artifacts output path must be defined.
tasks: # You can define 1..n tasks to a robot. # Naming: Think of actions or verbs this robot can perform. # Task names given here are visible in Control Room. # The task supports three ways of defining the action performed: # `command`, `shell` or `robotTaskName`. # Below are examples for each. User specified task name: # 'command': Separates the arguments to a list # that takes care of arguments with spaces. command: - python - -m - robot - --report - NONE - --outputdir - output - --logtitle - Task log - tasks.robot User specified task name 2: # 'shell': You have to quote items in the command with spaces using " shell: python -m robot --report NONE --outputdir output --logtitle "Task log" tasks.robot User specified task name 3: # 'robotTaskName': Assumes a task with the same name exists in a .robot file. robotTaskName: Calculate and log the result condaConfigFile: conda.yaml # A relative path to your environment config file. # Defining the conda.yaml file is optional. # E.g., if the running environment is preset and you don't need any setup. artifactsDir: output # A relative path to a folder where the artifacts are stored. # The contents of this folder will be sent to Control Room. PATH: # The paths listed here are added to the PATH environment variable # for the duration of the execution. - . PYTHONPATH: # The paths listed here are added to the PYTHONPATH environment variable # for the duration of the execution. - . ignoreFiles: # A relative path to the .gitignore file that controls what is placed in the # robot zip file. This can be used to control what items are not packaged # when pushing the robot to Control Room. Defining this is optional. - .gitignore

Note that with the robot.yaml you can define:

  • A large robot with multiple Python tasks or tests and a complex environment.
  • A simple Python robot with some environment requirements.
  • Just a simple executor that runs a known script in a preset environment.

...and everything in between, examples below.


A simple single task robot example

An example where you only have a single Robot Framework file to execute with minimal folder structure and no optional fields:

tasks: Read the Emails: shell: python -m robot --report NONE --outputdir output --logtitle "Task log" tasks.robot condaConfigFile: conda.yaml artifactsDir: output PATH: - . PYTHONPATH: - .

Full example with multiple tasks

tasks: Read Input Forms: robotTaskName: Read Inputs Create PDFs: robotTaskName: Generate PDF Email Customers: robotTaskName: Send Emails condaConfigFile: conda.yaml artifactsDir: output ignoreFiles: - .gitignore PATH: - . - bin PYTHONPATH: - . - variables - libraries - resources

Minimal example

An example, where you only have scripts to execute, you don't need Robot Framework nor any environment setup. In this case, your robot can be just a robot.yaml file and nothing else.

tasks: Trigger start script: shell: C:\\my-known-location\\my-trigger-script.bat artifactsDir: output PATH: - .
Last edit: June 28, 2021