General concepts:

  • Flows - You can create as many flows as needed to run on your account. Each flow start with a trigger (either a webhook or a triggerless trigger) . When a flow is activated, it uses it's own temporary database of variables as defined by the steps in it. The flow communicates (pull or push data) with the account's database with API.

  • Webhook - Activity by users in the Labguru account can be used as triggers to activate workflows. Each flow will have it's own webhook, with a unique id (multiple flows can have the same trigger, each will be a different webhook) All existing webhooks can be viewed from the Labguru app by adding "/admin/webhooks" to the URL.

  • Triggerless triggers - Flow triggers that do not depend on user activity in the Labguru application. Currently, there are 3 types:

    • Manual (can be activated from a button in the 'Logs' tab in the flow page)

    • Periodic (set a time cycle for the flow to be activated automatically)

    • External - Trigger by creating a POST request to a specific API endpoint. You can send parameters/files and they will be available as variables

  • Runs - Each time the flow is activated it counts a single run. All runs are documented in the flow 'Logs' tab. Runs can be archived, re-run or deleted from the log.

  • Steps - Flows are built from steps that mark the chronological progression of the flow (one step at a time). Flows can also branch out, allowing multiple steps to run in parallel. Steps can also be conditions that helps specify when the flow needs to be activated, continued or stopped.

  • Lab scripter - Specific steps that allow to add Python or Ruby code blocks (or upload code files). Using Lab scripter gives the ability create very specific flows and to achieve exact results

  • Variables - Variables can be anything from a number, a string or JSON files of a Labguru pages (experiment, project etc.). Variables can be created in steps (for example a 'Get experiment' or a 'Create report' step) and in Lab scripters. Once a variable is created, it can be used in following steps. Variables only exists inside the flow "space", changes made on variables inside the flow will not affect pages in Labguru unless specified differently in a step. Every flow starts with one variable which is the trigger variable (expect in flows with triggerless triggers). All variables available in a flow can be seen in the 'Variables' box at the top right corner in the 'Editor' tab.

Creating a new flow:

  1. Click on the "+" button on the index page.

  2. Name the new workflow (by clicking on the default name and type a new one).

  3. Choose a trigger from the list of possible triggers (The trigger can be edited at any time).

  4. Adding steps

    1. To add a new step, click on the 'Arrow down' icon at the bottom right corner of the step that is supposed to come before the new step.

    2. To branch out, click on the diagonal arrow icon. This option is available only after the step already has a proceeding step.

The steps:

  • Conditions - Can be performed on text (strings) or numbers (integers). Users can choose whether the flow continues or stops when the condition is met. The option to archive stopped runs can help reduce the number of irrelevant runs in the 'Logs' tab.

    • For strings - Can be done on any text field in a variable. i.e. {{experiment_1.name}} or {{trigger_stock.type}}.

    • For integer - Can be done on any numerical field in a variable. i.e. {{experiment_2.id}} or {{equipment_1.owner_id}}.

    • Between numbers - Check if the value is within range of any numerical field.

    • Exist - Check if an object has an internal value.

  • Get - Store a page as a variable in the flow database as a JSON file format. Pages can be called either by name ( i.e. {{trigger_experiment.name}}) or by id (i.e. {{experiment_1.project_id}} - pay attention! this call is actually for a project, that you know it's ID from an associated experiment that was already stored as a variable).

  • Find -

    • Find Section - Finds a section in an experiment stored as a variable by its name and stores it as a variable.

    • Find Element by Name - Finds an element in an experiment stored as a variable by its name and type and stores it as a variable.

    • Find Element by Section - Finds an element in an experiment stored as a variable by it's section name and type and stores it as a variable.

  • Report -

    • Create Report Basic - Creates an empty report in account. User can choose how to title it. Report is also added as a variable to in the editor.

    • Copy form data to report - Create a new section in a report that is stored as a variable. The section will be based on a text template taken from a document that is stored as a variable, and inject data from a Form Element input fields that is stored as a variable. Adding values from a Form Element can be done adding double curly brackets with form input fields name in the document (i.e. {{performed _by}} ).

    • Update Report - Add a new section to a report stored as a variable, the section will include a text box with a template described in the step. User can inject into the text, data from a Form Element that is stored as a variable. Adding values from a Form Element can be done using the double curly brackets with form input fields name in it (i.e. {{performed _by}} )

  • Datasets -

    • Create dataset - Creates a new dataset in Labguru from an Excel attachment.

    • Update dataset - Adds a vector to an existing dataset (TBA).

  • Excel Calculation - Read data from a sheet in an Excel attachment that is stored as a variable and perform calculations on data in that sheet. The result is added as a new section, in the experiment where the attachment is located. To add calculations, Use the double curly brackets to when adding a calculation to text (e.i {{=average(A1:A10}} )

  • Create Task - Creates a task in Labguru, set due date and assign it to a member.

  • Link Objects - Link to pages that are available as variables.

  • Send email to - Sends an email to a member by email or user number (e.i. {{experiment_01.user}} ). The email can be linked to a page that is stored as a variable and can have content predefined in the step.

  • Downloader - Downloads the actual file from an 'attachment' variable to temp folder in the editor (for calculation or analysis).

  • Upload attachment - Add an attachment to a page in Labguru that is stored as a variable in the editor.

  • Flow delegator - Sends the flow to trigger another flow. Useful in situations that a flow needs to be activated by two different triggers (for example, update a plasmid name when plasmid created or edited).

  • Variables logger - Adds details on all variables in flow to the log.

  • Extract images from Word Document - Extract all images from a doc/docx file and store them as variables.

  • Lab scripter - see the following.

Using the Lab scripter step:

General use:

  • Use either Python or Ruby code inside the Lab scripter. You can alternatively upload a code file.

  • Name the step by using the 'Explanation' field. The name will appear in the log and will help orientation.

  • You can use inside the Lab scripter step Labguru-related functions that are listed in the methods page (accessible by clicking on the "i" icon in the menu on the top right corner of each step).

  • Use the 'Output variables' field to "export" variables to be used in the following steps in the flow.

Useful commands:

  • Log - Use the Log function to add comments in the logs of the runs. i.e. log(x) or log("Yay") or log("Experiment Id is #{variable_name}") (in Ruby) - useful for debugging and for having more informative logs. The print function is also available in Python

    log(x)
    print(x) *IN PYTHON*
  • Using Variables - To use a variable that was defined in preceding steps in the Lab scripter, use the function:

    X = variable('variable_name')
    variable

  • Store Variables - In order to use objects created in the Lab scripter in following steps use the function:

    store_variable("new_name_of_variable", name_used_in_Lab_scripter)

    and then add the new variable name in the 'Output variables' field at the bottom of the step. You can add multiple variables by using the store_variable function for each one and then naming all of them in 'Output variables' separated by comma.

    Store Variables

Using the API

  • To make GET, POST and PUT requests in Lab scripter, use the get_api, post_api and put_api methods that can be found in the list of methods. For more information on Labguru API

Debugging tips:

While creating a new step (or updating an existing one), there are a few useful tips that can help the process:

  1. Use the "Re-run" buttons to quickly reactivate the trigger without going back to Labguru and reproduce the trigger. Re-runs are available in the corner of any log - either in 'Editor' or 'Logs' tabs.

  2. Turn "When stopped archive?" in all condition steps to False to avoid logs being missed due wrongly archived. Once a condition was verified to be written properly, turn "When stopped archive?" to True if needed (to reduce the "noise" of irrelevant runs from the log).

  3. Add Variables logger steps to verify variables were stored properly.

  4. Use the log function in Lab scripters that are not working to better locate the problematic line.

Did this answer your question?