FAIR Computational Workflows

NB: We are developing a summary table for recommendations for FAIR workflows against the FAIR Principles.


Introduction
In data intensive science, e-infrastructures and software tools are heavily used to help scientists manage, analyze, and share increasing volumes of complex data [Atkinson 2017].Data processing tasks like data cleansing, normalisation and knowledge extraction need to be automated stepwise in order to foster performance, standardisation and re-usability.Increasingly complex data computations and parameter-driven simulations need infrastructures and consistent reporting to enable systematic comparisons of alternative setups [Deelman 2017].As a response to these needs, the practice of performing computational processes using workflows has taken hold in different domains such as the Life Sciences [Cohen-Boulakia 2017], biodiversity [Mathew 2014], astronomy [Freudling 2013], geosciences [Duffy 2012], social sciences [Turner 2015] and more generally machine learning systems such as TensorFlow.
A workflow is a precise description of a procedure -a multi-step process to coordinate multiple tasks.In computational workflows, each task represents the execution of a computational process, such as running a code, the invocation of a service, the calling of a command line tool, access to a database, submission of a job to a compute cloud, or even the execution of another workflow.Figure 1 gives an example of a real workflow represented using the Common Workflow Language 1[Amstutz 2016].
Computational workflows promise support for automation that scales across computational infrastructures and large datasets and shield users from underlying execution complexities and inter-resource incompatibilities.From an execution perspective they are a means to handle the work of accessing an ecosystem of software and platforms, managing data, securing access, and handling heterogeneities.From a reuse and reproducibility perspective the automated methods can be packaged and ported across computational platforms easing how we can create and execute workflows in different environments and among diverse skill/expertise levels of users.From a reporting perspective they are a means to specify and document the workflow design and report the methodology: accurately recording the data inputs, parameter configurations and history of their runs and the provenance of their output data products [Cuevas-Vicenttín 2012].The provenance of a result (i.e., why and how a given result has been obtained by an analysis) enables the understandability and comparison of multiple results, and facilitates the exchange, standardisation and reusability of results.
The rise in the use of workflows has been accompanied by the many diverse systems by which they can be implemented.At one end of the spectrum are ad-hoc scripts (Command Line, Python, Java, etc.) and interactive notebooks -which provide an intuitive interface to quickly interact with the analysis results (e.g., Jupyter2 , RStudio3 , Zeppelin4 ).At the other end are highly featured workflow management systems (WfMS) some aimed at general application s (e.g.KNIME5 ) whilst others have been adopted by specific communities with specialised features and component collections (Nipype6 for neuro-bioimaging).
Figure 1: A workflow for detecting variants in genome sequences.The workflow is specified in the Common Workflow Language viewed using the CWL Viewer.Any CWL compliant execution engine should be able to execute this workflow.https://w3id.org/cwl/view/git/5a67e91727c8eb44afff27f9e4774eafef579c58/detect_variants/detect_variants.cwlWfMS can roughly be divided into coarse-grained, with a prime focus on chaining locally hosted or distributed tools (e.g.Galaxy 7 , KNIME, Taverna 8 ) and fine-grained focusing on optimising computational resources over Distributed Computing Infrastructures or HPC for applications (Pegasus 9 , Spark, SnakeMake 10 , Nextflow 11 , Dispel4Py 12 ) and cloud-based container orchestration (Kubernetes13 ).Many WfMS mix the two kinds [Moreno 2019].All WfMSs aim to handle common cross-cutting concerns on behalf of the workflow execution.Concerns include: resource scalability (optimisation, concurrency and parallelisation), secure execution (of tools in their environment, monitoring and fault handling); tracking (process logging and data provenance tracking) and data handling (secure access, movement, reference management).WfMSs vary how their users interact with them, for example by APIs or command lines, or for those with more limited programming skills, a GUI for authoring the workflow specification by "drag, drop and linking".WfMS may execute over HPC or geographically distributed clusters, clouds across systems, or even from desktops.They consequently vary in their mechanisms to prepare their components to become executable steps and must manage their portability and their dependencies on the infrastructure used to run them.
Workflows are composed of modular building blocks that have been prepared with standardised interfaces to be linked together and run by a computational engine.Thus the key characteristic of computational workflows is the separation of the workflow specification from its execution, capturing the control flow order between components and explicitly exposing the dataflow and data dependencies between the inputs and outputs of the processing steps.This separation is fundamental to supporting workflow comprehension, design modularity, workflow comparisons and alternative execution strategies.A WfMS explicitly makes this distinction.Interactive notebooks can do so when organized appropriately by defining their dataflow in the form of interactive computational cells; i.e., input and output variables explicit in each cell, data dependencies are explicit on each cell, and the steps are executed in order.Notebooks can also be used as "meta workflows" as the steps can be scripts or command-line calls to a WfMS.Scripts tend to interleave data and computational processes, although systems such as YesWorkflow [McPhillips 2015] seek to provide users of scripting languages with the means to annotate existing scripts with special comments that reveal their hidden computational modules and dataflows.
We propose that FAIR Principles apply to workflows, and WfMSs, in two major areas: • Properly designed workflows contribute to FAIR data principles, since they provide the metadata and provenance necessary to describe their data products and they describe the involved data realms in a formalized, completely traceable way.
• Workflows are Digital Objects in their own right, encapsulating methodological know-how that is to be found and published, accessed and cited, exchanged and combined with others, and reused as well as adapted.These two aspects are explored of the rest of the article.References to FAIR principles [Wilkinson 2016] are given in brackets.

FAIR Data and Workflows
Key contributions of workflows to FAIR Data compliance lies in the standardisati0n of practices, in a world of expanding and diversifying processing tools and computational operating environments, and in the formal computer-interpretable capture of provenance data.Computational workflows are at their heart automated data processing machinery.The effectiveness of that automation is not only enhanced by FAIR data, automation changes expectations with respect to data quality, clear identification, explicitness of data organisations, structures and semantics, machine-readable licenses and access permissions.FAIR data would enable a WfMS to automatically make informed choices from the phase of the workflow design (e.g., by suggesting tools fitting data features when several alternative tools could be considered for a given data analysis step) to the phase of workflow execution (e.g., by validating the data against a step's expected type).A WfMS thus needs to be able to access precise information on data origin, the way of accessing it, and a set of associated metadata.Domains such as the Life Sciences have developed ontologies, vocabularies and services for data interoperability (I3) and identifier resolution (F1), i.e., efforts such as the Breeding API (BrAPI)14 to standardise the interface for exchanging data between applications and the EDAM ontology15 to precisely specify the input and output of tools executed in a workflow (see FAIRsharing.org for examples).The formalised and finer grained annotation of data carries a cost, which is arguably why a significant amount of workflow processing is still metadata wrangling, format transformations and identifier mapping [Garijo 2014].
The workflow specification itself can be thought of as "prospective provenance", that is, as a recipe to produce a data product that exposes the extent of the effort made to make the data FAIR that could be validated against emerging FAIR indicators [Metrics paper in this issue].Determining whether the data produced by a workflow is FAIR is not straightforward and requires concrete criteria.
The combination of FAIR data, FAIR tools (inputs, outputs, disclosure of the task, statistics) with FAIR Infrastructure [Hardisty in this issue] (metadata are available on the underlying resources for running workflows and managing results) would significantly assist in the operation of workflows.Examples include annotations on tools and libraries (e.g.Bio.tools16 , Bioconductor, CRAN, PyPI) and on software containers (e.g.Biocontainers17 ).Standardised specifications on handling data formats and executables, automated handling of tool dependencies, and versioning and explicit metadata on computational resource needs would aide harmonisation of software tools execution and efficient job scheduling and data movement throughout different FAIR e-infrastructures.
For data generation a standardised workflow specification and automated execution contributes to transparency, reproducibility, analytic validity, quality assurance and the attribution and comparison of results.If well designed workflows can automate the production of metadata descriptions of data products (F2, I2, I3, R1.3) and the deposition of data in searchable resources (F4).Identifiers, licensing and access present interesting challenges in workflow execution: • Identifiers (F1, F3, A1) concerns include the propagation of identifiers through the workflow, tracking data citation [Groth in this issue] and the minting of identifiers for large numbers of intermediate results.Minids [Chard 2016] are proposed as light weight identifiers to unambiguous name, identify and reference research data products that can then optimise data exchange by reference this reducing unnecessary or insecure data movement.
Workflows need to move data references through their engines not the data itself.
• Licensing (R1.1).As workflows often combine data, data licenses need to be respected, honoured and prop, as do licenses on the software used by the workflow tasks.Combining licenses is particularly tricky and can impact on the ability to license the workflow itself or its data products.
• Data access (A1.1, A1.2): Single sign on to WfMS requires harmonised AAI propagation through the different tasks of the workflow which may be hosted by different service providers using different systems.
Workflows intrinsically provide precise documentation of how the data has been generated (R1.2).
The detailed record of the details of every executed process together with comprehensive information about the execution environment used to derive a specific data product is retrospective provenance, either observed by the WfMS or disclosed to it by the computational task itself.A great deal of work has focused on provenance tracking of [Herschel 2017] leading to standardisation efforts such as Prov [Khan 2019].Challenges remain: provenance standards have yet to be fully embraced by WfMS, there are shortages of provenance processing tools, and automated provenance collection can be too fine-grained and too detailed to be of service to researchers [Alper 2018].The computational steps are themselves unFAIR.Although open source tools allow us to inspect procedures, many codes (especially those only available as run-time binaries) are black boxes or proprietary software that do not disclose the link between their inputs and outputs, breaking the provenance lineage of data.Steps in coarse-grained workflows are often wrapped applications with buried workflows and manual steps within.Data resources and tools do not always report basic metadata such as their version or licence in a standardised, machine processable way.Bioschemas18 aims to get such metadata marked-up in resources in a lightweight way.A greater problem is unFAIR service provision, whereby the components change their interfaces without notice breaking the workflows that use them.Given their data focus, the FAIR principles are chiefly focused on the availability of metadata rather than the quality of service of the databases, tools and the e-infrastructures the data exist within.

FAIR Workflows as Digital Objects
The initial FAIR criteria were envisioned for data.As workflows are digital objects in their own right it is natural to draw an analogy with data and to try to apply the FAIR Principles to them.The majority of workflows are not yet registered in specialised repositories or are stored in software repositories indistinguishable from other software.Conventions for naming workflows still have to be devised (F1).Workflows range in the quality of their documentation, as are other software, described using proprietary or native programming languages.
Researchers have been actively exploring ways to for workflows to be FAIR.Workflow registries and repositories typically cater for specific WfMSs, such as KNIMEHub 19 for KNIME and nf-core 20 for Nextflow Life Science pipelines, to support findability and accessibility (F4), with description and metadata associated with deposited workflows (F2) and in some cases persistent, unique identifiers (F1).Access is typically baked into the workflow applications (A1), for example only Galaxy workflows are only available in dedicated Galaxy installations such as Workflow4Metabolomics21 .Others such as (e.g.WINGS 22 ) provide means to export workflows as Linked Data.Workflow findability in repositories has been studied [Starlinger 2012] alongside workflow similarity [Starlinger 2014] where workflows are compared based on their metadata and structure.For workflows to be accessible in the same way as data, they need to be archived and cited just as data is archived and cited using citation metadata [Smith 2016].In the schema.orgmark-up used by citation infrastructures such as Datacite, terms indicate data is derived from other data.Ideally there should also derived from terms indicating the software or service to perform that transformation harmonised with workflow provenance.
myExperiment 23 [De Roure 2009] is an attempt at a WfMS agnostic repository, pioneering approaches for workflow sharing and publishing with licenses, crediting authors when workflow designs were reused or repurposed, and packaging workflows into collections and with other digital objects such as associated data files and publications.The work laid the foundations for workflow based Research Objects24 [Belhajjame 2015] that allows for bundling of all the artefacts associated with an investigation or piece of research into one whole that can also be cited.The Figure 1 workflow's description files and links to executable containers and data files can be downloaded in a Research Object zip-based bundle along with citation metadata and assigned a DOI.The European Open Science Cloud for Life Sciences has started work to build a workflow registry using CWL with Research Objects federated with registries for tools (bio.tools) and containers (Biocontainers).
Several attempts have been made to standardise workflow descriptions in order to aid discoverability (F2) and enable interoperability (I1).The Interoperable Workflow Intermediate Representation [Plankensteiner 2011] was proposed as a common bridge for translating fine-grain workflows between different languages independent of the underlying distributed computing infrastructure [Terstyanszky 2014].GA4GH Workflow Execution Service and Task Execution Schema25 , the Workflow Description Language26 and the Common Workflow Language (CWL) are recent community efforts to describe workflows.The CWL specification aims to describe workflows and command-line tool interfaces in a way that makes them portable and scalable across a variety of software and hardware environments and runnable by other CWL-compliant engines.This last point is critical.Workflow are not data, they are software that are intended to be executed.Workflows as software challenge the FAIR principles by their structure, forms, versioning, executability, and reuse.
Structure.Workflows are inherently composite whose components can be workflows in a nested, fractal way.Workflows will be reused as sub-workflows.The distinction between a workflow and its components steps [Haendel 2016] is blurred.FAIR criteria can thus be applied simultaneously on multiple levels.To render a workflow findable relies on the findability of the involved tools and data types as researchers often use these as search attributes.FAIR properties on the componentsmetadata, licensing, author credit, access authorization and so on -propagate to the workflow level and may be incompatible.Versioning.Software is a living artefact to be maintained, updated, and eventually deprecated.The components, the WfMS itself and the underlying computational infrastructures they run on evolve and change.Workflow evolution is a form of provenance [R1.2] that tracks any alteration of an existing workflow resulting in another version that may produce the same or different results [Casati 1998].Moreover, to make methodological variants workflows will be recycled and repurposed: cloned, forked, merged and dramatically changed.Workflow repositories such as nfcore embrace this software nature, building on top of collaborative development environments such as github that natively support versioning as well as testing and validation.FAIR principles have to address versioning and "fixivity" -the need to snapshot a workflow to fix its reproducible state and associate a persistent identifier.
Executability.Workflows are executable objects.To be interoperable (I1) and reusable (R1) they need to be portable, encapsulating all their runtime dependencies.Lightweight container-based virtualisation solutions to distribute software and share execution environments (e.g.CONDA, Docker, Singularity) revolutionise workflow reusability.Nevertheless, workflows are time limited objects whose active lifespan is dependent on that of their components and WfMS as much as on their scientific relevance.Consequently CWL addresses both explicit support for containerised execution and the lifting of workflow description from the WfMS or application it is embedded in so that it may be runnable in other CWL-compliant engines even when no longer executable in its native form (A2).In workflow e-infrastructures (e.g. in local workstations or in cloud environments), resource limitations need to be defined by the workflow.Implicit security aspects and stability of the workflow environment need to be covered by the infrastructure and its components and not by the workflow.
Reuse.Reusing workflows involves a continuum of situations from pure redo where the exact same workflow (same tools) is re-executed in the exact same environment with the exact same data and parameter settings, to workflow replication, where minor changes can be made usually in the workflow environment and/or parameter settings but the results remain the same, to workflow reproducibility where the aim of the analysis remains the same but the means (steps) or data may vary, to eventually workflow reuse where only part of the original workflow is considered with a possible different aim in workflow repurposing [Garijo 2017, Wroe 2006].Regardless of intent, the workflow user must be confident that the expected results are generated.R1 means robust software practices [Artaza 2016, Taschuk 2017, Leprevost 2014] that entails: • Proper testing of the computational workflow and its modules as well as the software tools that are invoked during workflow runtime; • Validation of interoperability claims that tests workflow replication on different platforms; • Validation of parameters to preclude workflow failure and faulty or unsafe results.The formulation of parameter must therefore be FAIR and must include documentation and explanation of their purpose and range definitions (testing of parameter ranges).The BioCompute Object specification [Alterovitz 2018] emphasises detailed representation and validation of parameters for regulatory approval of reusable computational pipelines for precision medicine.
These thoughts lead to two conclusions (i) that treating FAIR workflows as data artefacts only goes so far, and that FAIR software principles should built on best practices for software maintainability, maturity and computation reproducibility guidelines [Stodden 2016] (ii) the individual parts, forms, versions and execution environments of a workflow need to be FAIR by themselves, leading to complex interdependencies which need to be covered by FAIR metrics.

Conclusions (Notes)
• Properly designed workflows contribute to FAIR data practices, since they provide the metadata and provenance necessary to describe their data products and they describe the involved data realms in a formalized, completely traceable way.The processing and production of FAIR data is not scalable without automation there remain major challenges.The transformational power of workflows for FAIR data.
• Workflows are Digital Objects in their own right [REF Wittenburg paper in this issue], encapsulating methodological know-how that is to be found and published, accessed and cited, exchanged and combined with others, and reused as well as adapted.FAIR principles for software are different to data, and so will be their FAIR metrics/indicators, FAIR software is actually maintainable software using best software practices [Artaza 2016, Taschuk 2017] for maintainability and maturity; Reproducibility is essential • FAIR needs to be built in to WfMS and embedded in tools and practices and that will cost Fundamentally, how we identify, cite and credit composite software is an open question [Katz 2014].Forms.When we speak of a FAIR workflow what do we mean?A workflow can be a CWL specification with test or exemplar data; an implementation of that design in a WfMS; an instantiation of that implementation ready to be run with input data and parameters set and computational services spun up; a run result with intermediate and final data products and provenance logs.Workflow-centric Research Objects attempt to create a metadata framework to capture and aggregate each form, but each may have different FAIR criteria.