> For the complete documentation index, see [llms.txt](https://help.fovus.co/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.fovus.co/docs/pipeline/nextflow/pipeline-submission/prepare-inputs.md).

# Prepare inputs and configure Nextflow

Upload large shared inputs to Fovus Storage and configure nextflow\.config for the nf-fovus plugin before submitting.

This page covers two preparation steps: uploading large shared inputs to Fovus Storage so every task can read them efficiently, and configuring `nextflow.config` with the nf-fovus plugin and `workDir`.

See [Pipeline overview](/docs/pipeline/pipeline-overview.md) for how Pipelines differ from Jobs and when to choose local vs Fovus-hosted execution.

## Upload large input files

Large shared inputs — reference genomes, shared datasets — should live under `/fovus-storage/pipelines/` before you run the pipeline. Upload once to this folder and every task reads the same path. Because the folder sits on the Fovus distributed filesystem, tasks avoid copying multi-gigabyte files into each working directory, which keeps I/O overhead low.

Small files (scripts, sample sheets, params) can ship with the pipeline at creation time or pass through Nextflow `params` without a separate upload step.

{% columns %}
{% column %}
**Upload to `/fovus-storage/pipelines/` when:**

* The file is large
* Many tasks read the same path
* Copying into every task folder would waste I/O
  {% endcolumn %}

{% column %}
**Skip a separate upload when:**

* Files are small
* You bundle them with the pipeline at submission
* You only need paths already under `/fovus-storage/pipelines/`
  {% endcolumn %}
  {% endcolumns %}

For large files, avoid `ext.remoteInputsForAllTasks` — it copies into every task working directory. Pre-stage once under `/fovus-storage/pipelines/` instead. See [remoteInputsForAllTasks](/docs/pipeline/nextflow/nextflow-config-reference.md#remoteinputsforalltasks) in the config reference for the small-file case.

{% tabs %}
{% tab title="Fovus CLI" %}

```bash
fovus pipeline upload LOCAL_PATH [FOVUS_PATH]
```

* `LOCAL_PATH` — local file or folder to upload
* `FOVUS_PATH` — optional relative path under `/fovus-storage/pipelines/`

Example:

```bash
fovus pipeline upload /data/genome-data/ genome-data/
```

Files are available at `/fovus-storage/pipelines/genome-data/`.
{% endtab %}

{% tab title="Mounted storage" %}
If [Fovus Storage is mounted locally](/docs/storage/mount-storage-locally.md), copy files using any standard tool:

```bash
cp -r /data/genome-data/ /fovus-storage/pipelines/genome-data/
```

Or with `rsync` if available:

```bash
rsync -avh /data/genome-data/ /fovus-storage/pipelines/genome-data/
```

{% endtab %}
{% endtabs %}

### To use uploaded files in your pipeline

Treat files under `/fovus-storage/pipelines/` like any path on Fovus Storage — use the same absolute path in your Nextflow scripts.

Via `params`:

```groovy
params.genome = '/fovus-storage/pipelines/genome-data/GRCh38.fa'
```

Via Nextflow `file()`:

```nextflow
input = file('/fovus-storage/pipelines/genome-data/GRCh38.fa')
```

## Configure nextflow\.config

### plugins

Declare the nf-fovus plugin so Nextflow loads it before execution:

```groovy
plugins {
  id 'nf-fovus'
}
```

Nextflow downloads the plugin on first run and uses the [latest published release](https://registry.nextflow.io/plugins/nf-fovus). To pin a version, append `@` and the release number (for example `'nf-fovus@1.0.12'`). See [all released versions](https://registry.nextflow.io/plugins/nf-fovus) on the Nextflow plugin registry.

### process

The `process {}` block sends every task to Fovus and sets global defaults. All three settings below are required:

```groovy
process {
  executor = 'fovus'
  ext.benchmarkingProfileName = 'Default CPU'
  ext.timeToCostPriorityRatio  = '0.5/0.5'
}
```

Settings in the outer `process {}` block apply to **every** process. A `withName: 'process_name' {}` subblock overrides values for that process only.

Precedence (lowest to highest):

1. Defaults in the pipeline script
2. `process {}` in `nextflow.config`
3. `withName: 'process_name' {}` in `nextflow.config`

For every `ext.*` parameter — types, defaults, and when to use each — see the [Nextflow configuration reference](/docs/pipeline/nextflow/nextflow-config-reference.md).

### fovus

Identify the pipeline in Fovus:

```groovy
fovus {
  pipelineName = 'My Fovus Pipeline'
}
```

Optional fields: `cliPath` (path to the `fovus` executable), `projectName` (budget grouping).

### workDir

Point intermediate files at the pipeline area on Fovus Storage:

```groovy
workDir = '/fovus-storage/pipelines'
```

The path **must end in `/pipelines`**. This directory lives on the Fovus distributed filesystem so compute nodes share data with minimal I/O overhead.

### Docker

Only if your processes use containers:

```groovy
docker {
  enabled = true
}
```

The nf-fovus plugin supplies container run options automatically — you do not need to set `runOptions` manually.

### Example configurations

The tabs below are complete `nextflow.config` examples you can copy and adapt.

{% tabs %}
{% tab title="Minimal config" %}

```groovy
plugins {
  id 'nf-fovus'
}

process {
  executor = 'fovus'
  ext.benchmarkingProfileName = 'Default CPU'
  ext.timeToCostPriorityRatio  = '0.5/0.5'
}

fovus {
  pipelineName = 'My Fovus Pipeline'
}

workDir = '/fovus-storage/pipelines'
```

{% endtab %}

{% tab title="Multi-process config" %}

```groovy
plugins {
  id 'nf-fovus'
}

process {
  executor = 'fovus'
  ext.benchmarkingProfileName = 'Default CPU'
  ext.timeToCostPriorityRatio  = '0.5/0.5'
  ext.walltimeHours            = 6

  withName: 'heavy_process' {
    ext.benchmarkingProfileName = 'High Memory BP'
    ext.walltimeHours           = 12
    ext.allowPreemptible        = true
  }

  withName: 'gpu_process' {
    ext.benchmarkingProfileName = 'GPU Optimized BP'
    ext.minGpu                  = 1
  }
}

fovus {
  pipelineName = 'MyPipeline On Fovus'
  projectName  = 'genomics-q1'
}

workDir = '/fovus-storage/pipelines'
```

{% endtab %}
{% endtabs %}

## Choose how to run

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-cloud" style="color:$primary;">:cloud:</i> Fovus-hosted</h4></td><td>Submit via CLI or Web UI; Fovus runs the Nextflow manager on a cloud headnode. Recommended for most pipelines.</td><td><a href="/docs/pipeline/nextflow/pipeline-submission/fovus-hosted-manager.md">Run fully hosted by Fovus</a></td></tr><tr><td><h4><i class="fa-terminal" style="color:$primary;">:terminal:</i> Local Nextflow manager</h4></td><td>Run <code>nextflow run</code> on your Linux machine or Fovus Workstation. Requires local Nextflow and a storage mount on Linux/WSL.</td><td><a href="/docs/pipeline/nextflow/pipeline-submission/local-hosted-manager.md">Run with local Nextflow manager</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.fovus.co/docs/pipeline/nextflow/pipeline-submission/prepare-inputs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
