Hands-on: Creating workflows from local files¶
- 10 min
- Easy
If you have a workflow, script or notebook on your local machine, and has not saved or published it to any of the supported repositories (Galaxy, Git, WorkflowHub), you can still register it in LabID, by creating a workflow and version "from scratch".
Creating workflows and versions directly in LabID can be convenient if you are not familiar with Git, or workflows for which version control systems are not appropriate (e.g ones including binary files such as KNIME workflows). It can also be a quick way to keep track of test workflows for which creating a repository is not worth the effort.
To create a new workflow from local files:
- go to the workflow list page
- at the top left after clicking the New workflow , select New workflow.
Step 1 : Fill-in workflow informations¶
The first step is the creation of a parent Workflow, to which a first Workflow Version will then be associated with a specific set of files.
For the Workflow provide the few required informations:
- a name (ex: "My first KNIME workflow")
- an optional description of what this workflow is doing
- a Workflow Manager / programming language (ex: KNIME)
Additional options define user-permissions in LabID as for other registered entities.
Once the form is filled, click the button Save item at the top right corner, which will take you to the first Workflow Version for this Workflow.
Step 2 : Edit the workflow version¶
The new workflow version has a default name and no associated files, so let's edit it.
Start by clicking the Edit button at the top right corner.
Edit metadata¶
- edit the default name to easily recognize it in the list of workflow versions, we recommend including the name of the parent workflow and a version indicator (such as "My first KNIME workflow - v1").
- you can also select a license to this workflow version, or leave it for now. You can always edit the version later to edit it, or any other field.
Associate files to the version¶
Here we will associate a single "placeholder" file mimicking a knime workflow file.
For a real workflow, you should associate any file needed to run the workflow, but also configuration files, environment file or list of dependencies (ex: requirement.txt), a README and a License file.
Let's create our placeholder file, here we will just use a simple text file with a fake knwf extension. We will write some dummy text in the file, otherwise the server wont accept it empty (with a size of 0 byte).
If your workflow is a python script, you can directly associate your file obviously.
On Mac and Linux, you can open a terminal anywhere (ex: in your Download folder), then execute.
On windows, - you can just right-click, click "New File", and name it accordingly - open it in a text editor, enter some text like "empty" and save it
Back in LabID, on the Workflow Version page
- At the bottom click the Browse button and select the file you just created, or drag and drop the file directly
- In the dropdown,
File Typesselectmainwhich indicates this is the main or entry point workflow file
Once you are done, click the Save and exit button at the top right.
Which files should I select ?
Files associated to a workflow version should be the scripts and other files that compose this version and might change with new versions. You can add individual files but no directories. You could also add a single zip file representing the full version, but you wont be able to preview the files in LabID.
Configuration files in Workflow versions and Workflow runs
Configuration files stored at the Workflow Version level are typically environment files with all the dependencies required by this workflow version. The configuration files used when executing the workflow should be associated with the Workflow Run, just like inputs, outputs and logs/reports files.
Releasing a workflow version¶
Before referencing this workflow version in workflow runs, we recommend to first release it in LabID.
To do so, from the workflow version page,
- exit the edit mode
- click the Release button in the top right corner
The workflow version should now be labeled as "Released". Released workflows versions cannot have their files edited or removed (only the metadata can be edited); adding new file is also not possibe. The idea is to ensure that workflow versions associated to workflow runs should not be changed to ensure it corresponds to the version that was executed. In practice, it is common to test a workflow with some test runs before releasing a workflow version, so LabID does not enforce using released workflow versions for workflow runs, it is only recommended once the workflow version is stable.
Creating new versions
You cannot create additional versions of a workflow while the current version is not released !
Release vs Publish
The Publish button is used to publish the workflow version to Workflow Hub (or dev.workflowhub). See Export workflows to WorkflowHub. Workflow versions that were imported from external repositories (ex: Git) or have been published from LabID into WorkflowHub have a "Published" label similar to the "Released" one.
Creating new versions¶
To create a new version, make sure to release the current version and click the + New version button at the top right.
The new workflow version page is initialized with the set of files from the previous version. You can replace those files with new versions, remove them if they became obsolete, and add new files as needed.
Make sure to rename the workflow version to something meaningful, as described in the section Edit metadata.
Once you start using this new version with workflow runs, don't forget to release it!
Overview of registered versions
From a workflow version page, click on Workflow to be taken to the parent workflow page. The workflow page lists all versions registered for this specific workflow.
Exporting workflow versions from LabID¶
Once you have created some workflow versions in LabID, you can share them with other LabID users, so they can register workflow runs with those. For this, simply adjust the visibility in the Sharing panel of the workflow and workflow version pages.
To share workflow versions with others out of LabID, you have 2 options :
-
exporting the workflow version to workflow hub (or dev.workflow.hub)
-
exporting the workflow version as a Workflow RO-Crate
From the workflow version page in LabID, click RO-Crate to download a Workflow RO-Crate for this workflow version. This is basically a zip file containing all files composing the workflow, together with a json file describing the content of this zip.
Such file can be used for instance to import the worflow version in another RO-Crate-capable software.
Export as RO-Crate also available for workflow runs
You will find a similar "Export to RO-Crate" button for workflow runs.
This uses the Workflow Run RO-Crate profile, which is an extension to the Workflow RO-Crate profile mentioned above.