Skill Tracer
Skills › Scientific Agent Skills › dnanexus-integration › workflow-languages.md

workflow-languages.md

302 lines · skills/dnanexus-integration/references/workflow-languages.md at 5f2bc03

Open on GitHub
1# Workflow Languages and Imports
2

Workflow Languages and Imports

Raw lines 1 to 2
3## Choose a Workflow Path
4
5| Source | DNAnexus path |
6|---|---|
7| Existing apps/applets assembled visually or by API | Native workflow |
8| WDL draft-2, 1.0, or 1.1 | dxCompiler |
9| CWL 1.2 | dxCompiler |
10| Nextflow source folder/repository | `dx build --nextflow` |
11| One Python/Bash program | Applet/app, not a workflow |
13Keep the source workflow, compiler/importer version, container digests, input
14JSON, and generated executable IDs together as provenance.

Choose a Workflow Path

SourceDNAnexus path
Existing apps/applets assembled visually or by APINative workflow
WDL draft-2, 1.0, or 1.1dxCompiler
CWL 1.2dxCompiler
Nextflow source folder/repositorydx build --nextflow
One Python/Bash programApplet/app, not a workflow

Keep the source workflow, compiler/importer version, container digests, input JSON, and generated executable IDs together as provenance.

Raw lines 3 to 15
16## Native Workflows
18Native workflows connect app/applet stages. Build from a `dxworkflow.json`:
20```bash
21dx build --workflow "path/to/workflow-source" \
22 --destination "project-xxxx:/workflows/my-workflow"
23```
25Inspect inputs:
27```bash
28dx run "workflow-xxxx" -h
29```
31Run:
33```bash
34dx run "workflow-xxxx" \
35 --input-json-file "inputs.json" \
36 --destination "project-xxxx:/runs/run-001" \
37 --cost-limit 50
38```
40This returns an `analysis-...` ID. Each stage runs as a job or nested analysis.
42Use native workflows when:
44- Components already exist as maintained DNAnexus apps/applets.
45- Users need UI-editable stage connections.
46- The pipeline is small enough to maintain as a native workflow definition.
48Promote stable inputs/outputs to workflow-level fields. Keep project-qualified
49default links only when the referenced data is deliberately shared and
50accessible in every intended context.

Native Workflows

Native workflows connect app/applet stages. Build from a dxworkflow.json:

dx build --workflow "path/to/workflow-source" \
  --destination "project-xxxx:/workflows/my-workflow"

Inspect inputs:

dx run "workflow-xxxx" -h

Run:

dx run "workflow-xxxx" \
  --input-json-file "inputs.json" \
  --destination "project-xxxx:/runs/run-001" \
  --cost-limit 50

This returns an analysis-... ID. Each stage runs as a job or nested analysis.

Use native workflows when:

  • Components already exist as maintained DNAnexus apps/applets.
  • Users need UI-editable stage connections.
  • The pipeline is small enough to maintain as a native workflow definition.

Promote stable inputs/outputs to workflow-level fields. Keep project-qualified default links only when the referenced data is deliberately shared and accessible in every intended context.

Raw lines 16 to 51
52## WDL and CWL with dxCompiler
54Current baseline: **dxCompiler 2.18.0**.
56Supported language versions at that baseline:
58- WDL draft-2
59- WDL 1.0
60- WDL 1.1
61- CWL 1.2
63WDL 2.0/development support is not production-ready. CWL 1.0 and 1.1 must be
64upgraded to 1.2 before compilation.

WDL and CWL with dxCompiler

Current baseline: dxCompiler 2.18.0.

Supported language versions at that baseline:

  • WDL draft-2
  • WDL 1.0
  • WDL 1.1
  • CWL 1.2

WDL 2.0/development support is not production-ready. CWL 1.0 and 1.1 must be upgraded to 1.2 before compilation.

Raw lines 52 to 65
66### Setup
68Prerequisites:
70- Current `dx` toolkit and authenticated project context
71- dxCompiler 2.18.0 JAR from the official GitHub release
72- Java 8 or 11
73- Docker only if using the documented containerized compiler workflow
75Pin the JAR release and verify release checksums or provenance before use. Do
76not use an unversioned download URL in production automation.

Setup

Prerequisites:

  • Current dx toolkit and authenticated project context
  • dxCompiler 2.18.0 JAR from the official GitHub release
  • Java 8 or 11
  • Docker only if using the documented containerized compiler workflow

Pin the JAR release and verify release checksums or provenance before use. Do not use an unversioned download URL in production automation.

Raw lines 66 to 77
78### Validate WDL
80dxCompiler uses strict WDL parsing. Validate and lint with the matching
81wdlTools release before compilation.
83Then compile:
85```bash
86java -jar "dxCompiler-2.18.0.jar" compile \
87 "workflow.wdl" \
88 -project "project-xxxx" \
89 -folder "/workflows" \
90 -inputs "inputs.json"
91```
93The compile command can create a DNAnexus-formatted input JSON. Run the
94compiled workflow with `dx run` and the generated input file:
96```bash
97dx run "workflow-xxxx" \
98 --input-json-file "inputs.dx.json" \
99 --destination "project-xxxx:/runs/run-002" \
100 --cost-limit 50
101```
103Run `java -jar dxCompiler-2.18.0.jar help` for the exact options supported by
104that pinned release.

Validate WDL

dxCompiler uses strict WDL parsing. Validate and lint with the matching wdlTools release before compilation.

Then compile:

java -jar "dxCompiler-2.18.0.jar" compile \
  "workflow.wdl" \
  -project "project-xxxx" \
  -folder "/workflows" \
  -inputs "inputs.json"

The compile command can create a DNAnexus-formatted input JSON. Run the compiled workflow with dx run and the generated input file:

dx run "workflow-xxxx" \
  --input-json-file "inputs.dx.json" \
  --destination "project-xxxx:/runs/run-002" \
  --cost-limit 50

Run java -jar dxCompiler-2.18.0.jar help for the exact options supported by that pinned release.

Raw lines 78 to 105
106### Authenticated WDL imports
108dxCompiler 2.17.0 and later support per-domain bearer tokens for protected HTTP(S) WDL
109imports through `DXCOMPILER_WDL_IMPORT_BEARER_TOKENS`.
111This variable is highly sensitive:
113- Inject only through a secret manager.
114- Scope each token to the required import domain.
115- Never print or log the variable.
116- Never accept an arbitrary import host while credentials are active.
117- Remove the variable after compilation.
118- Do not embed it in workflow source, inputs, or extras.
120Prefer immutable source references and checksum imported WDL dependencies.

Authenticated WDL imports

dxCompiler 2.17.0 and later support per-domain bearer tokens for protected HTTP(S) WDL imports through DXCOMPILER_WDL_IMPORT_BEARER_TOKENS.

This variable is highly sensitive:

  • Inject only through a secret manager.
  • Scope each token to the required import domain.
  • Never print or log the variable.
  • Never accept an arbitrary import host while credentials are active.
  • Remove the variable after compilation.
  • Do not embed it in workflow source, inputs, or extras.

Prefer immutable source references and checksum imported WDL dependencies.

Raw lines 106 to 121
122### Prepare CWL
124dxCompiler expects one packed CWL 1.2 document.
1261. Upgrade older CWL to 1.2.
1272. Pack imports into one compound document.
1283. Validate with `cwltool --validate`.
1294. Compile the packed file.
131```bash
132cwltool --validate "workflow.cwl.json"
134java -jar "dxCompiler-2.18.0.jar" compile \
135 "workflow.cwl.json" \
136 -project "project-xxxx" \
137 -folder "/workflows"
138```
140Pin `cwltool`, the upgrader/packer, and dxCompiler in reproducible
141environments.

Prepare CWL

dxCompiler expects one packed CWL 1.2 document.

  1. Upgrade older CWL to 1.2.
  2. Pack imports into one compound document.
  3. Validate with cwltool --validate.
  4. Compile the packed file.
cwltool --validate "workflow.cwl.json"

java -jar "dxCompiler-2.18.0.jar" compile \
  "workflow.cwl.json" \
  -project "project-xxxx" \
  -folder "/workflows"

Pin cwltool, the upgrader/packer, and dxCompiler in reproducible environments.

Raw lines 122 to 142
143### Known constraints
145Review the current dxCompiler README and release notes before migration. At the
146documented baseline, relevant limitations include:
148- WDL task/workflow names must be unique across the import tree.
149- Some permissive type conversions accepted by other WDL engines are rejected.
150- CWL 1.0/1.1 is not compiled directly.
151- Calling native DNAnexus apps/applets from CWL through `dxni` is not supported.
152- Some CWL requirements and global workflow publication remain unsupported.
154Do not promise byte-identical behavior to Cromwell or another CWL runner
155without conformance tests.

Known constraints

Review the current dxCompiler README and release notes before migration. At the documented baseline, relevant limitations include:

  • WDL task/workflow names must be unique across the import tree.
  • Some permissive type conversions accepted by other WDL engines are rejected.
  • CWL 1.0/1.1 is not compiled directly.
  • Calling native DNAnexus apps/applets from CWL through dxni is not supported.
  • Some CWL requirements and global workflow publication remain unsupported.

Do not promise byte-identical behavior to Cromwell or another CWL runner without conformance tests.

Raw lines 143 to 156
157## Nextflow
159Creating a DNAnexus app/applet from Nextflow source requires a DNAnexus license.
160Current dx-toolkit supports Nextflow engine versions `25.10` and `24.10`;
161`25.10` is the current default and `24.10` is retained only as an unmaintained
162compatibility option.

Nextflow

Creating a DNAnexus app/applet from Nextflow source requires a DNAnexus license. Current dx-toolkit supports Nextflow engine versions 25.10 and 24.10; 25.10 is the current default and 24.10 is retained only as an unmaintained compatibility option.

Raw lines 157 to 163
164### Repository import
166```bash
167dx build --nextflow \
168 --repository "https://github.com/nextflow-io/hello" \
169 --repository-tag "<pinned-tag-or-commit>" \
170 --destination "project-xxxx:/applets/hello"
171```
173Pin a repository tag or commit. Do not import a floating default branch for a
174production pipeline.
176For a private repository, `--git-credentials` accepts a DNAnexus file. Use a
177short-lived, read-only credential and store it in a project whose membership
178has been reviewed. Anyone with sufficient project access may be able to read
179that file.

Repository import

dx build --nextflow \
  --repository "https://github.com/nextflow-io/hello" \
  --repository-tag "<pinned-tag-or-commit>" \
  --destination "project-xxxx:/applets/hello"

Pin a repository tag or commit. Do not import a floating default branch for a production pipeline.

For a private repository, --git-credentials accepts a DNAnexus file. Use a short-lived, read-only credential and store it in a project whose membership has been reviewed. Anyone with sufficient project access may be able to read that file.

Raw lines 164 to 180
181### Local source
183```bash
184dx build --nextflow "path/to/pipeline" \
185 --nextflow-version "25.10" \
186 --destination "project-xxxx:/applets/my-pipeline"
187```
189An nf-core-style layout is encouraged but not required.

Local source

dx build --nextflow "path/to/pipeline" \
  --nextflow-version "25.10" \
  --destination "project-xxxx:/applets/my-pipeline"

An nf-core-style layout is encouraged but not required.

Raw lines 181 to 190
191### Inspect and run
193```bash
194dx run "applet-xxxx" -h
195```
197The generated executable exposes fields for Nextflow run options,
198configuration files, and a YAML/JSON parameter file. Use the generated help
199rather than assuming field names.
201```bash
202dx run "applet-xxxx" \
203 --input-json-file "nextflow-inputs.json" \
204 --destination "project-xxxx:/runs/run-003" \
205 --cost-limit 100
206```
208The execution is a head job supervising process subjobs. Monitor both:
210```bash
211dx watch "job-head"
212dx watch "job-child"
213dx find jobs --root-execution "job-head"
214```
216Check current CLI help if a filter name differs; dx-toolkit evolves.

Inspect and run

dx run "applet-xxxx" -h

The generated executable exposes fields for Nextflow run options, configuration files, and a YAML/JSON parameter file. Use the generated help rather than assuming field names.

dx run "applet-xxxx" \
  --input-json-file "nextflow-inputs.json" \
  --destination "project-xxxx:/runs/run-003" \
  --cost-limit 100

The execution is a head job supervising process subjobs. Monitor both:

dx watch "job-head"
dx watch "job-child"
dx find jobs --root-execution "job-head"

Check current CLI help if a filter name differs; dx-toolkit evolves.

Raw lines 191 to 217
218### Offline execution
220With dx-toolkit 0.415.0, rebuilt Nextflow applets honor
221`nextflow_run_opts="-offline"` and automatically enable offline mode when the
222job has no outbound network access. `-offline=false` requests online mode; it
223does not grant network permission. Pre-stage required plugins, pipeline
224resources, containers, and input data so offline execution does not need a
225registry or remote download. Rebuild older applets to incorporate the updated
226template, then test a small run under the intended network policy.

Offline execution

With dx-toolkit 0.415.0, rebuilt Nextflow applets honor nextflow_run_opts="-offline" and automatically enable offline mode when the job has no outbound network access. -offline=false requests online mode; it does not grant network permission. Pre-stage required plugins, pipeline resources, containers, and input data so offline execution does not need a registry or remote download. Rebuild older applets to incorporate the updated template, then test a small run under the intended network policy.

Raw lines 218 to 227
228### Containers
230DNAnexus Nextflow execution supports Docker as the container runtime. Pin
231containers by immutable digest.
233Options include:
235- Pulling from an approved registry
236- `--cache-docker` to cache image tarballs in the selected project
237- `--docker-secrets` for a DNAnexus file containing private registry
238 credentials
240Registry credentials are readable data objects to users with sufficient
241project access. Use pull-only, short-lived credentials and review membership.
243External image pulls require network access. Caching images improves
244reproducibility and reduces registry dependence.

Containers

DNAnexus Nextflow execution supports Docker as the container runtime. Pin containers by immutable digest.

Options include:

  • Pulling from an approved registry
  • --cache-docker to cache image tarballs in the selected project
  • --docker-secrets for a DNAnexus file containing private registry credentials

Registry credentials are readable data objects to users with sufficient project access. Use pull-only, short-lived credentials and review membership.

External image pulls require network access. Caching images improves reproducibility and reduces registry dependence.

Raw lines 228 to 245
246### Resume and cache
248Nextflow pipeline applets support resume/cache-preservation inputs. Current
249platform guidance limits preserved sessions in a project to 20. Clean old
250work directories and cache sessions deliberately to control storage costs.
252Only one job can resume and preserve the same session at a time. Do not launch
253concurrent writes to one preserved session.

Resume and cache

Nextflow pipeline applets support resume/cache-preservation inputs. Current platform guidance limits preserved sessions in a project to 20. Clean old work directories and cache sessions deliberately to control storage costs.

Only one job can resume and preserve the same session at a time. Do not launch concurrent writes to one preserved session.

Raw lines 246 to 254
255### Head job and process resources
257The head job orchestrates the pipeline; process subjobs perform scientific
258work. Size them separately:
260- Choose a stable head-job instance that can manage the graph.
261- Use Nextflow `cpus`, `memory`, and `disk` directives for processes.
262- Confirm the generated executor maps requirements as expected.
263- Keep queue size within platform limits (current documented maximum: 1000).

Head job and process resources

The head job orchestrates the pipeline; process subjobs perform scientific work. Size them separately:

  • Choose a stable head-job instance that can manage the graph.
  • Use Nextflow cpus, memory, and disk directives for processes.
  • Confirm the generated executor maps requirements as expected.
  • Keep queue size within platform limits (current documented maximum: 1000).
Raw lines 255 to 264
265### Advanced work directory
267DNAnexus documents using an S3 bucket as a Nextflow work directory through
268OIDC. This requires a reviewed cloud trust policy and narrow bucket
269permissions. Do not embed AWS credentials; use the DNAnexus job OIDC provider
270and least-privilege IAM role.

Advanced work directory

DNAnexus documents using an S3 bucket as a Nextflow work directory through OIDC. This requires a reviewed cloud trust policy and narrow bucket permissions. Do not embed AWS credentials; use the DNAnexus job OIDC provider and least-privilege IAM role.

Raw lines 265 to 271
272## Portability Test Plan
274For any imported workflow:
2761. Validate source with its native tooling.
2772. Pin compiler/importer and container versions.
2783. Compile/import into a test project.
2794. Run a small non-sensitive fixture.
2805. Compare outputs and checksums to the reference runner.
2816. Compare scatter behavior, retries, and resource mapping.
2827. Test failed-task reporting and resume.
2838. Confirm output locations and metadata.
2849. Record execution cost and wall time.
28510. Test in every intended cloud/region.
287Scientific equivalence matters more than successful compilation. Validate
288reference builds, coordinate systems, sort orders, floating-point tolerances,
289and tool versions.

Portability Test Plan

For any imported workflow:

  1. Validate source with its native tooling.
  2. Pin compiler/importer and container versions.
  3. Compile/import into a test project.
  4. Run a small non-sensitive fixture.
  5. Compare outputs and checksums to the reference runner.
  6. Compare scatter behavior, retries, and resource mapping.
  7. Test failed-task reporting and resume.
  8. Confirm output locations and metadata.
  9. Record execution cost and wall time.
  10. Test in every intended cloud/region.

Scientific equivalence matters more than successful compilation. Validate reference builds, coordinate systems, sort orders, floating-point tolerances, and tool versions.

Raw lines 272 to 290
291## Security Checklist
293- No workflow source or inputs contain credentials.
294- Imported URLs are trusted and immutable.
295- Protected-import tokens are domain-scoped and not logged.
296- Container images are pinned and provenance-checked.
297- Private repository/registry files are in tightly controlled projects.
298- Network access is limited to required hosts.
299- External work-directory roles are least privilege.
300- PHI does not leave approved projects/TREs.
301- Cost limits, timeouts, and concurrency are bounded.
302- Generated apps/applets are reviewed before publication.

Security Checklist

  • No workflow source or inputs contain credentials.
  • Imported URLs are trusted and immutable.
  • Protected-import tokens are domain-scoped and not logged.
  • Container images are pinned and provenance-checked.
  • Private repository/registry files are in tightly controlled projects.
  • Network access is limited to required hosts.
  • External work-directory roles are least privilege.
  • PHI does not leave approved projects/TREs.
  • Cost limits, timeouts, and concurrency are bounded.
  • Generated apps/applets are reviewed before publication.
Raw lines 291 to 302