Run a Bot
This page explains how to launch a Bot when the user has one available on his platform. The tutorial is based on a knapsack problem application in order to provide more specific examples for the user.
Once a workflow has been loaded by a user or a platform provider, or even created through the workflow builder, it is available on the main page of the Bot Store.
In the following picture, the Workflow Knapsack Problem has been shared by a team member in the specific Workspace Demo. Thus, the workflow is available both in this section and in the Overview of all my bots section. This last section shows all the workflows available to the user on every Workspace to which he have access, including those created by him and not shared with a specific Workspace.
Global information is also visible on the workflow identification card, such as its name, a brief description of its purpose (when provided by the user or the developer), and the last calculation (or Job) that was launched with this workflow.
Several options are available when the workflow has been identified on the Bot Store page. According to the following picture, three main options provide access to several functionalities:
1 - Click on the workflow's name: This opens a page to run, start, edit, share, report an issue, delete, export the workflow, or change its description, name, or documentation. A summary of the last calculations (Jobs) launched by the user with this workflow is also provided.
2 - Click on the three dots: This opens a small modal page to open, edit, share, delete the workflow, or copy its link for sharing outside the platform.
3 - Click on the play button: This opens the workflow form page used to provide input values and launch a workflow calculation.
In order to launch the workflow, several input values are required for calculation and are requested from the user on the form page (see the picture of the third item of 2. Identify your workflow and its options).
For this specific Knapsack Problem application, input values are separated into four main categories. As a reminder, the Knapsack problem consists of a knapsack that can contain up to a certain mass of items. Several items are available in a store, and each one has both a mass and a price. The challenge is to find the best solution that consists of the highest summed price of items that can fit into the knapsack for the maximum mass.
Thus, the necessary input values are defined as:
- A list of items with a mass and a price defined for each one of them
- A knapsack with its specific maximum mass capacity
In the form, these input values are presented in the first two main categories, “GENERATOR-items” and “GENERATOR-knapsack”.
A new item can be created by clicking on “+ Add Empty Row” in the “GENERATOR-items” category.
Specific values can then be provided by the user for the mass and price. A name may also be added to identify this item in the database more easily. When both attributes are provided by the user, data can be saved using the usual saving icon on the field's right-hand side.
The new item is created, added to the problem items, and will be used in the calculations.
If several items have already been created by the user or shared through a workspace by other team members, they are also available for form filling. A created or provided item can be added to the problem items by clicking on “+ Add” in the “GENERATOR-items” category.
A new page opens for the user to select the desired items.
By clicking on several items and validating on the “Select” button, items are directly added to the problem items with their own mass, price, and name attributes.
The other required input values are filled in the same way:
- Create a knapsack with its own allowed_mass and name characteristics.
- Specify a minimum mass that filters out all solutions generated that don't meet this minimum mass in the final knapsack.
- Assign a name to the entire simulation to easily identify and find it later.
In some cases, the workflow creator may choose to impose default values for specific inputs. In such cases, those values are considered optional and stored in a separate section of the form.
For the knapsack example, the two optional parameters are:
- The maximum amount of gold available to buy items. It has a direct impact on the total accumulated items' prices that can fit in the knapsack.
- The maximum number of iterations.
In specific cases, if a previous calculation has produced results or not, it can be useful to load the previous input values that generated those outcomes. An option is available on the top right-hand side of the window to load these inputs. The user can then relaunch the calculation, modify the data before doing so, or even reset the entire form with the subsequent button if a mistake has been made.
If required, documentation is available for each parameter when the workflow developer has filled in the specific class or method docstrings. These can help the user select the correct value, type, or unit or even understand the meaning of a parameter notation before filling in the input value.
When your form is complete, launch your workflow by clicking the Submit button on the bottom right-hand side of the window.
If the page doesn't change immediately, wait a few seconds before investigating. Do not click the Submit button again, as it may launch a second instance of the calculation. If you have forgotten a required input value, the workflow will not run and you need to specify the field before trying to launch the calculation again.
Once the workflow has successfully submitted the input values and is running, you can track its progress on the tracking page that opens automatically.
Several phases may appear during the calculation:
- Pending: The current computation is in queue and waiting for another calculation to finish.
- Computing: The current computation is currently running.
- Inserting_in_db: Objects are being serialized and inserted into the database to be stored so that the user can explore the results and work with them later.
- Success: The current calculation has finished without any errors.
- Failure: The current calculation has been blocked by an error during the computing or inserting_in_db phases. The error may be a result of incorrect input values or development errors that have been identified in the Admin - Systems Logs panel.
- Aborted: The current calculation has been stopped by the user.
- Lost: The current calculation has been stopped due to a platform restart and data have been lost.
Different pieces of information are also available to the user on the interface:
- The date and time at which the workflow was launched.
- The date and time at which the workflow finished.
- The duration of the workflow, which includes the pending, computing, and inserting_in_db phases.
- The execution time for the workflow, which refers only to the time during the computing phase.
- The current state or phase of the workflow, as described above.
- The origin object of the workflow, which redirects to the workflow object presentation page when clicked.
- The result object of the workflow, which redirects to the workflow run object presentation page (i.e., the page displaying the results) when clicked.
- When clicked, the support button redirects to a page on the platform that uses the current workflow as a reference to request a bug fix or a new feature.
- The form button redirects to the form page, where the user can rerun the workflow with the same or different data.
- Information on the logs produced by the workflow. These logs correspond to messages intentionally developed by the workflow developer to provide the user with information.
- Two pieces of information are provided on the time spent since the current workflow was launched: the total duration of calculations and insertion in the database, and the calculation process accomplishment percentage.
When a workflow has reached its Success state, the user can access its results page by clicking on the Results button.