Working with files in a HighBond robot or a Workflow robot

Note

For information about ACL robots, see Working with tables and files in an ACL robot.

In a HighBond or Workflow robot, you can work with two types of files:

Type of file Category of data Location in Robots Description
Working files Working data Working data tab

Working files serve as general output or input in a robot and do not remain associated with the specific task or task run that produces them.

You can also upload working files – manually, or using an ACL robot.

Result files Results data Task runs tab

Result files are output by a specific task run and remain permanently associated with the task run that produces them.

Data flows in a HighBond or Workflow robot

The diagram below illustrates the different data flows possible in a HighBond or Workflow robot, and how they relate to files contained in the robot.

A diagram showing the different ways that data can flow into, around, and out of a robot.

Working files

A working file is any file produced by a Python/HCL script that you save to the Working data tab in a HighBond or Workflow robot. The Working data tab is the central data storage area in the robot. Working files allow you to output data from one task and preserve it for use in a subsequent task. The tasks must be in the same robot.

You can also upload working files to the Working data tab in a robot – manually, or using an ACL robot.

Working files remain dynamic (writable) and can be updated by a subsequent task run, or overwritten by a subsequent upload.

Save a working file

To save a working file to the Working data tab using a Python/HCL script, you first produce a file using script logic. In the same script, you then save the file using the HCL save_working_file() method. For more information, see save_working_file() method.

Upload a working file manually

You can manually upload files, such as Excel or CSV, to the Working data tab. Manually uploaded files can contain static data such a list of prohibited merchant category codes, or an employee list, that you input as part of your scripted data analysis. For more information about uploading a working file manually, see Managing working data stored in a robot.

Note

You can manually upload only supported file types to the Working data tab.

Upload a working file using an ACL robot

If your organization uses an on-premise Robots Agent, you can use an ACL robot to upload the data in a local Analytics table to a compressed CSV file (*.csv.gz) in the Working data tab. This capability allows you to build integrated ACLScript-Python/HCL data automation workflows that move data from your local network to your cloud-based Robots instance.

For more information about uploading a working file using an ACL robot, see Exporting data to the Robots app in Diligent One.

Load an existing working file

To use an existing working file as input for a Python/HCL script, you must first load the file from the Working data tab using the HCL load_working_file() method. Once the file is loaded, you can use it as input in script logic. For more information, see load_working_file() method.

Result files

A result file is any file produced by a Python/HCL script that you save to an individual task run in a HighBond or Workflow robot. Result files allow you to preserve the output results from a particular task run.

Result files are a read-only end product that you can download for viewing. You cannot update result files in Robots.

To save a result file, you first produce a file using Python/HCL script logic. In the same script, you then save the file using the HCL save_result_file() method. For more information, see save_result_file() method.

Development mode and production mode

Robot tasks, and all input and output data contained in a robot, are segregated by mode. Data that is output in one mode, or manually uploaded in one mode, is not available in the other mode. For more information, see Development mode and production mode in Robots.

Working with files in the Robots script editor

When you manually run a Python/HCL script in the Robots script editor any new files created by the script, or any pre-existing files loaded from the Working data tab, are made available in the Session files panel. You can open the Session files panel to view a list of individual files, with the option of downloading any file to your computer. Loaded working files are a copy, rather than the actual source file.

Example of files in the Session files panel

In the example below, the Session files panel contains two files:

  • Invoices_Q1_2022.xlsx is an Excel file loaded from the Working data tab using the HCL load_working_file() method.

  • Invoices_Q1_2022_prepared.xlsx is a new version of the file that has been prepared and saved using methods from the Python pyexcel library. The file is subsequently saved to the Working data tab using the HCL save_working_file() method.

    Note

    The Python pyexcel library is used here as one example. Any type of file output by any type of Python script logic is made available in the Session files panel.

    The Robots script editor with the Session files panel open and containing two Excel files.

The benefit of session files

Session files are made available to assist you as you develop Python/HCL script automation:

  • You see the actual files created or loaded by a script, which helps you validate script logic.

  • You can download individual files and review their format and content to verify that they meet your expectations.

  • You can review all file operations and associated script logic, and make any necessary adjustments, before you save a new version of a script, which typically reduces the number of script versions you create in the course of script development.

The duration of session files

Session files are temporary copies held in session memory and retained for the duration of the session only. They are automatically deleted when you exit the script editor or end the session.

Permanent copies of the files are saved as either working files or result files if the script saves them using the save_working_file() method or the save_result_file() method. Pre-existing working files loaded from the Working data tab are not affected when the temporary session copy is deleted.

Viewing the files in a HighBond robot or a Workflow robot

To view the working files or the result files contained in a HighBond robot or a Workflow robot you must first download them to your local computer.

Download a working file

  1. Open the Robots app.
  2. From the dashboard in Robots, select the tab for the appropriate robot type.
  3. Click the robot that contains the working file.
  4. In the upper-right corner of the robot, click Production or Development to select the mode to use.

    For more information, see Development mode and production mode in Robots.

  5. Select the Working data tab.
  6. Select the working file that you want to download.
  7. In the File details panel, click Download.

    Result The file is downloaded to your local file system and can be opened in its native application.

Download a result file

  1. Open the Robots app.
  2. From the dashboard in Robots, select the tab for the appropriate robot type.
  3. Click the robot that contains the result file.
  4. In the upper-right corner of the robot, click Production or Development to select the mode to use.

    For more information, see Development mode and production mode in Robots.

    Note

    Workflow robots do not support tasks and results in development mode.

  5. Select the Task runs tab.
  6. Select the task run with the results that you want to download.
  7. In the Task run details panel, under Output, click Download beside the name of file that you want to download.

    Result The file is downloaded to your local file system and can be opened in its native application.