Skip to main content
All CollectionsExecute Pipelines
Advanced: Component Execution Templates
Advanced: Component Execution Templates
Gwenn Berry avatar
Written by Gwenn Berry
Updated over 2 years ago

Execution of multi-step or advanced pipelines in Miqa is easily controlled by the use of Component Execution Templates. These templates tell your pipeline what parameters to use when running your components, including which files to load, command-line arguments to populate (based on Component ParameterSets, Dataset properties, or constant values), and how to execute your components and capture outputs.


About Templates

Templates are structured YAML or JSON files that contain all of the information needed to execute a component on any dataset. Variables from your Component ParameterSets or Dataset properties are passed to the template at runtime and are designated by $-prefixed variable names, for example $BAM_PATH. The variable names should correspond to those designated in the Executable Wrapper.

There are two main types of Component Execution Templates: built-in and custom templates. When creating or editing a template, you can toggle between these two types using the "Custom Template" checkbox on the right side of the form.


Built-in Templates

Built-in templates are editable in the browser and are simple YAML-formatted files that describe the inputs and execution steps. These YAML files are then translated by our backend to enable running the workflows on different platforms.


Custom Templates

Some use cases call for custom templates, which enable more flexibility and control. These should be used by advanced users only or designed in coordination with your Magna Labs support team.

Custom templates cannot be edited directly in the browser, but you can download existing versions, make changes locally in your preferred text editor, and re-upload the file.


Accessing Templates

To add or modify Component Execution Templates, go to the Component overview page for the component in question. From the Quick Actions dropdown, select the Templates link.

If there are existing templates for this component already, you will see them in the table on the Component Templates page. To add a new one, simply click the + Add button. To view, modify, duplicate, or download an existing template, click on the name of the template in the table.


Modifying Templates

To modify a built-in style template, simply make changes in the text editor in the editor view and then click Save. To modify a custom-style template, download, locally modify, and re-upload the template as described above.


Duplicating Templates

To quickly create a new template based on an existing one, open the editor view for the existing template and select Duplicate from the Quick Actions dropdown menu.

The default name will be "Copy of {original}", but you may modify it before submitting the form. The duplicated template will inherit all other properties of the original template, including its settings, filetype, etc. For built-in style templates, the contents of the template will also be duplicated to the new template. For custom-style templates, an empty template file will be created which you can then replace with an uploaded file.


Using Templates

Component Execution Templates must be assigned to a Component/Component Version before they can be used for execution. For new Components or Component Versions, the template can be selected from the dropdown menu at the time of creation. For existing Components and Component Versions, it is recommended that you create a new Component Version based off of the most recent version, and then select your new template from the dropdown menu.

This can be done from the Component overview page, which is accessible from the Pipeline tab or by navigating from any execution through the workflow and component steps. Click the + Add button on the Versions card to add a new version. By default, this will inherit the settings of the most recent version. You can then change the template_file selection as shown above and save the new version. Any subsequent versions pushed up (manually or automatically through CI) will now inherit this most recent configuration.

Note: To use managed template files, the Component should have a "template_file" property of type "template".

Did this answer your question?