# Workflow Build Process

You can create workflows using the [web interface](/developer/workflows/building-and-running-workflows.md) or the CLI tools provided by the [DNAnexus SDK](/downloads.md). This page focuses on creating a workflow in a terminal. It walks you through important features of the DNAnexus workflow build infrastructure that help you build your workflows programmatically.

{% hint style="info" %}
The [DNAnexus SDK](/downloads.md), `dx-toolkit`, is required to build workflows from JSON definitions.
{% endhint %}

For information on building Nextflow workflows, see [Running Nextflow Pipelines](/user/running-apps-and-workflows/running-nextflow-pipelines.md).

## Workflow Directory Structure

DNAnexus workflows can be built using the [`dx build`](/user/helpstrings-of-sdk-command-line-utilities.md#build) command, which takes the workflow JSON representation from your local workstation and uploads it to a [workflow object](/developer/api/running-analyses/workflows-and-analyses.md) on the Platform. The DNAnexus SDK expects the workflow definition to reside in a directory with the following structure:

```
MyWorkflow
├── dxworkflow.json
└── Readme.md
```

### Workflow Metadata

The file `dxworkflow.json` is a DNAnexus workflow metadata file. If it is detected in the directory provided to `dx build`, the dx-toolkit attempts to build a workflow on the Platform by passing the workflow specification in `dxworkflow.json` to [`/workflow-xxxx/new`](/developer/api/running-analyses/workflows-and-analyses.md#api-method-workflow-new).

### Readme File

The `Readme.md` file, if present, is inserted into the `description` field of the workflow.

## Building a Workflow

Having placed the workflow metadata in `MyWorkflow`, you can load your workflow on the DNAnexus Platform:

```shell
dx build MyWorkflow
```

The built workflow is in a [closed](/developer/api/data-object-lifecycle.md), immutable state. Adding the `--keep-open` option keeps the workflow open allowing you to edit the workflow from the DNAnexus UI.

```shell
dx build MyWorkflow --keep-open
```

## Getting a Workflow

Similarly to apps and applets, developers can use the command [`dx get`](/user/helpstrings-of-sdk-command-line-utilities.md#get) to download the workflow description from the Platform, for example:

```shell
dx get MyWorkflow
```

This creates a directory `MyWorkflow` (after the workflow's name) containing the workflow representation in the working directory. It can be used again to create a new workflow with `dx build`.


---

# Agent Instructions: 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:

```
GET https://documentation.dnanexus.com/developer/workflows/workflow-build-process.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
