# CWL Tool

Common Workflow Language (CWL) provides an alternative workflow specification to WDL. This guide demonstrates running the `02_download_collection_files` workflow in CWL format using CWLtool and Docker.

### Prerequisites

* Python 3.6 or higher
* [Docker](https://docs.docker.com/desktop/)
* Optional: cURL and git

## Setup Instructions

You'll need to download:

* [cwltool](https://github.com/common-workflow-language/cwltool)
* [02\_download\_collection\_files.wdl](https://raw.githubusercontent.com/DNAstack/dnastack-client-library-worked-examples/master/examples/wdl/02_download_collection_files.wdl)

### Getting the Example Workflow

Download the worked examples repository using either method:

#### Clone with Git

```shell
git clone https://github.com/DNAstack/dnastack-client-library-worked-examples.git
```

Or [Download](https://github.com/DNAstack/dnastack-client-library-worked-examples/archive/refs/heads/master.zip) and Unzip

It is assumed that all commands will be run from the root directory of this repository on your local machine. From the directory where you’ve downloaded the examples repository.

```
cd dnastack-client-library-worked-examples/
```

### Installing CWL Tool

Install cwltool using either method:

Download and install [cwltool](https://github.com/common-workflow-language/cwltool) by one of the following methods.

#### Using `apt` for Debian, Ubuntu, and similar Linux distributions

```shell
sudo apt-get install cwltool
```

#### Or use `pip`

```shell
pip3 install cwlref-runner cwltool
```

## Running the workflow

To run the workflow:

```shell
cwltool ./examples/cwl/02_download_collection_files.cwl
```

Output files can be found in the current directory.
