# How to submit a pipeline from the command line (finngen-cli)

The other way to submit a pipeline, besides the [Pipeline tool](https://docs.finngen.fi/working-in-the-sandbox/running-analyses-in-sandbox/pipelines-tool-instructions/how-to-use-the-pipelines-area), is by command line. `Finngen-cli` is a command line tool to run FinnGen applications in Sandbox. The command line is accessible through [Terminal Emulator from the Application](https://docs.finngen.fi/working-in-the-sandbox/quirks-and-features/navigating-the-sandbox) menu in the Sandbox.

**!! NB !!** Please be cautious with how many GWAS you create and the number of phenotypes you include. Submitting more than ten GWAS jobs simultaneously or GWAS with more than 15 phenotypes may jam the process and can make your organization's pipeline unusable for others. If you are going to launch more than 5 GWASs or GWAS with tens of phenotypes please contact the <humgen-servicedesk@helsinki.fi> and we can temporarily increase the resources of your organization's Sandbox and downscale afterward.

To open the finngen-cli help page and to list all finngen-cli commands in Terminal Emulator type

```
finngen-cli --help 
```

![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-ab81dbe7e683caa80fd575cfdce5c1dfeae6990d%2Fimage%20\(169\).png?alt=media)

To see the help page for each command type

```
finngen-cli <command> --help
```

#### For example:

```
finngen-cli request-workflow --help
```

![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-b5ef950a712e29aa61e527df43433392e3b0e9b8%2Fimage%20\(770\).png?alt=media)

In Sandbox any pipeline can be run using the **finngen-cli request-workflow**. You just need to provide wdl, json, and sub-wdl files packed in a zip. Pipeline input files are run from /finngen/red/ folder.

For example, to run a workflow with user defined WDL, JSON, and dependencies:

```
finngen-cli request-workflow -w /pathto/my.wld -i /pathto/my.json -d myd.wld.zip
```

You will get the following notification if the workflow request creation succeeded

![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-664a01b5ec641074dd7470776d593ef8be975656%2Fimage%20\(845\).png?alt=media)

**Note:** If your WDL uses sub-workflow, this is the only way to submit your job. If you are using this, your WDL and JSON needs to be in /finngen/red. You can import the WDL and JSON using the green bucket (eg. from the git repository). See instructions [on how to upload files to your own IVM via /finngen/green](https://docs.finngen.fi/working-in-the-sandbox/quirks-and-features/how-to-upload-to-your-own-ivm-via-finngen-green).

The third dependence is the [Docker images](https://docs.finngen.fi/working-in-the-sandbox/quirks-and-features/docker-images) used by the WDL. You can [check what is currently available in Sandbox container repository](https://docs.finngen.fi/working-in-the-sandbox/quirks-and-features/docker-images/containers-available-to-sandbox) using **finngen-cli list-images.**

After the workflow is submitted successfully you can check the status of your run from the Pipeline tool menu (Applications -> Pipelines)

![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-f614a06d1ac72b220a72905a706d9ece9747bcb3%2Fimage%20\(837\).png?alt=media)

The **finngen-cli request-gwas** is an automatic system where you don’t need to handle the input JSON or WDL but only the phenofile or lists of phenotypes. Detailed instructions on how to run **finngen-cli request-gwas** are in [Custom GWAS command line (CLI) tool](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/untitled/custom-gwas-command-line-cli-tool). See also [How to run SAIGE (GWAS)](https://docs.finngen.fi/working-in-the-sandbox/running-analyses-in-sandbox/how-to-run-genome-wide-association-studies-gwas/how-to-run-gwas-using-saige). Note that the status of workflows submitted with command **finngen-cli request-gwas** can be checked from the "RECENTS" menu in the [custom GWAS command line (CLI) tool](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/untitled/custom-gwas-command-line-cli-tool), not from FinnGen Pipeline tools.

#### More about the pipeline tool:

* [Pipelines](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/pipelines)
* [How to use the Pipeline tool](https://docs.finngen.fi/working-in-the-sandbox/running-analyses-in-sandbox/pipelines-tool-instructions/how-to-use-the-pipelines-area)
* [Pipelines is based on Cromwell and ](https://docs.finngen.fi/working-in-the-sandbox/running-analyses-in-sandbox/pipelines-tool-instructions/pipelines-is-based-on-cromwell-and-wdl)WDL
* [FAQ about Pipelines](https://docs.finngen.fi/faq/about-pipelines)
* [Custom GWAS command line (CLI) tool](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/untitled/custom-gwas-command-line-cli-tool)
* [If your pipeline job fails](https://docs.finngen.fi/working-in-the-sandbox/running-analyses-in-sandbox/pipelines-tool-instructions/if-your-pipeline-job-fails)

See tutorial video on how to run pipelines in Terminal:

* [Sandbox training / Pipeline module](https://www.finngen.fi/en/members/recordings/finngen-sandbox-training-pipeline-module-19th-march-2019)
* [Users' Meeting video on how to use finngen-cli tool](https://www.finngen.fi/en/members/recordings/finngen-users-meeting-14th-december-2021)
