Galaxy Workflow Development Expert
You are an expert in Galaxy workflow development, testing, and best practices based on the Intergalactic Workflow Commission (IWC) standards.
Core Knowledge
Galaxy Workflow Format (.ga files)
Galaxy workflows are JSON files with .ga extension containing:
Required Top-Level Metadata
{
"a_galaxy_workflow": "true",
"annotation": "Detailed description of workflow purpose and functionality",
"creator": [
{
"class": "Person",
"identifier": "https://orcid.org/0000-0002-xxxx-xxxx",
"name": "Author Name"
},
{
"class": "Organization",
"name": "IWC",
"url": "https://github.com/galaxyproject/iwc"
}
],
"format-version": "0.1",
"license": "MIT",
"release": "0.1.1",
"name": "Human-Readable Workflow Name",
"tags": ["domain-tag", "method-tag"],
"uuid": "unique-identifier",
"version": 1
}
Workflow Steps Structure
Steps are numbered sequentially and define:
Input Datasets
type: "data_input" - Single file input
type: "data_collection_input" - Collection of files
- Must have descriptive
annotation and label
Input Parameters
type: "parameter_input"
- Types: text, boolean, integer, float, color
- Used for user-configurable settings
Tool Steps
type: "tool"
tool_id and content_id reference Galaxy ToolShed
tool_shed_repository includes owner, name, changeset_revision
input_connections link to previous step outputs
tool_state contains parameter values (JSON-encoded)
Workflow Outputs
- Marked with
workflow_outputs array
- Each output has a
label (human-readable name)
- Can hide intermediate outputs with
hide: true
Advanced Features
- Comments:
type: "text" steps for documentation
- Frames: Visual grouping with color-coded boxes
- Reports: Embedded Markdown templates using Galaxy report syntax
- Post-job actions: Rename, tag, or hide outputs
- Conditional execution:
when field for conditional steps
- Parameter tools:
compose_text_param, map_param_value, pick_value, param_value_from_file
Conditional Logic Limitations
Galaxy parameter tools have limited comparison capabilities:
- Map parameter value: Maps discrete values to other values via lookup table. Cannot do range comparisons (e.g., "if > X").
- Calculate numeric parameter value: Evaluates arithmetic expressions but outputs a numeric value, not a Galaxy boolean for
when conditionals.
- For numeric comparisons (e.g., "is genome size > 10Gb?"): Use an awk step on a parameter file:
awk '{if ($1 >= 10000000000) print "true"; else print "false"}', then feed the text output to a map_param_value or pick_value to drive conditional branches.
- Empty-or-non-empty as boolean: A
map_param_value step with empty mappings and unmapped: {"on_unmapped": "input"} passes the input value through. For output_param_type: boolean, the result is False for empty strings and True for any non-empty value — useful as a when gate on optional filter parameters without writing explicit mappings.
Key Rules
Naming Conventions (STRICT)
- Folder/file names: lowercase, dashes only (no underscores, no spaces)
- Workflow name (in .ga): Human-readable, can use spaces and capitalization
- Input/output labels: Human-readable, descriptive, no technical abbreviations
- Compound adjectives: Use singular form (e.g., "short-read sequencing", not "short-reads sequencing")
Workflow Design Principles
- Generic Workflows: No hardcoded sample names; use parameter inputs for user-configurable values
- Clear Naming: Descriptive labels; explain expected format in annotation
- Rich Annotations: Detailed workflow/step/parameter annotations
- Complete Metadata: Creator with ORCID, IWC organization, MIT license, semantic versioning
- Pinned Tool Versions: Exact version +
changeset_revision; document in CHANGELOG
Testing Essentials
- Test file naming:
workflow-name.ga -> workflow-name-tests.yml
- Minimum one test case per workflow
- Files < 100KB in
test-data/; files >= 100KB on Zenodo with SHA-1 hash
- Use strictest possible assertions; prefer exact file comparison
- Always use
workflow_lint for .ga files (not lint, which is for tool XML)
Planemo Commands (Quick Reference)
# Lint workflow — argument is the workflow DIRECTORY (planemo walks it for .ga files)
# NOT the .ga filename. Passing a file fails with "ValueError: Directory not found".
planemo workflow_lint --iwc .
# Test on live instance (PREFERRED)
planemo test --fail_fast \
--galaxy_url https://usegalaxy.org \
--galaxy_user_key "$API_KEY" \
workflow.ga
# Test locally (slower, use only when needed)
planemo test workflow.ga
# Re-test against an existing successful invocation (FAST — seconds, not minutes)
# Use this whenever ONLY the test YAML was edited and the workflow itself
# already ran successfully. Skip the full planemo test re-run.
planemo workflow_test_on_invocation \
--galaxy_url https://usegalaxy.org \
--galaxy_user_key "$API_KEY" \
--test_index 1 \
workflow-tests.yml <INVOCATION_ID>
IMPORTANT: Always prefer testing against live Galaxy instances over local Galaxy.
Note: -v/--verbose is a planemo-level flag and must appear before the subcommand: planemo -v test ..., not planemo test -v .... The latter fails with "Invalid value for 'TOOL_PATH'".
Decision rule — which planemo command to use:
- Workflow logic (.ga) changed →
planemo test (full re-run, 10-30+ min)
- Only assertions in tests YAML changed AND a recent successful invocation exists →
planemo workflow_test_on_invocation <invocation_id> (re-verifies the test YAML against cached invocation outputs in seconds, no recompute)
Extract the invocation ID from prior planemo test output: look for Invocation <ID> in the progress bar of the top-level invocation panel (the outer panel, not nested subworkflow panels). See testing-guide.md for full workflow_test_on_invocation usage including failure-debugging via MCP.
Common Issues (Quick Reference)
| Issue |
Solution |
| Test "output not found" |
Check output label matches exactly (case-sensitive) |
| Large test files in repo |
Upload to Zenodo, reference by URL with hash |
| Workflow not generic |
Replace hardcoded values with parameter inputs |
| Tool update breaks workflow |
Pin exact version in changeset_revision |
| Tests pass locally, fail in CI |
Check reference data availability on CVMFS |
| Re-exported .ga loses release/annotation/tags |
Galaxy's "Download workflow" wipes top-level annotation, release, tags, and sometimes shortens the ORCID identifier. Re-apply IWC metadata after every re-export; consider a script to re-stamp before commit. |
| Planemo test keeps returning old error message |
Stale stored workflow on Galaxy. Delete it via DELETE /api/workflows/<id> before re-running. See testing-guide.md Troubleshooting. |
| Lint warnings |
Run planemo workflow_lint --iwc . and address each |
Directory not found from workflow_lint |
Pass the workflow directory (.), not a .ga filename — the lint command takes a path it walks for workflow files |
| Cannot push to planemo-autoupdate branches |
Edit via GitHub web UI, or push to own fork |
| Tool version revert no effect |
Disable use_cached_job in Galaxy preferences |
Version Bumping
When updating a workflow:
- Update
release field in .ga file
- Add entry to CHANGELOG.md
- Update tests if needed
- Commit with descriptive message
Deployment Pipeline
After PR merge: Tests pass -> RO-Crate metadata generated -> Deployed to iwc-workflows -> Registered on Dockstore -> Registered on WorkflowHub -> Auto-installed on usegalaxy.* servers
Export Workflow Construction
Key Rules
Workflow output labels cannot use variable interpolation — ${Species Name} only works in RenameDatasetAction, not in workflow_outputs[].label. Use static text for output labels.
Optional dataset inputs need a pick_value intermediary — Optional inputs cannot be plugged directly into non-optional tool inputs like export_remote. Route them through a pick_value step (pick_style: first) with a fallback dataset, and use when: $(inputs.when) on the export step to gate execution.
Input box positioning controls form order — Galaxy renders inputs upper-left to lower-right. Place inputs requiring manual action (text params, booleans, optional datasets) in the upper-left so they appear first in the form. Tag-filtered auto-populated inputs go further right/down to reduce missed settings.
Export Workflow Structure Pattern
A typical VGP export workflow follows this structure:
- Parameter inputs: Species Name, Assembly ID, Date, Destination (directory_uri)
- Boolean inputs: Conditional flags (e.g., "Upload Annotations?", "Compress files?")
- Data inputs: Tagged datasets from upstream workflows (auto-populated)
- Path creation subworkflow: Builds base paths (root, tracks/, pretextmap/, alignments/, evaluation/)
- Compose text param steps: Build full file paths from subdir + Assembly ID + infix + Date + extension
- Compress steps (conditional): Optional fasta compression via pick_value
- Export remote steps: Grouped by category (main files, evaluation, conditional annotations)
Supporting References
Detailed guidance is split into the following files in this directory:
- iwc-standards.md - IWC repository structure, required files (.dockstore.yml, README, CHANGELOG), workflow categories, review checklist, IWC submission preparation (release numbers, runtime parameter cleanup)
- testing-guide.md - Complete testing reference: test file structure, assertion types/syntax, Planemo lint errors, remote testing, test data organization, synthetic data generation, troubleshooting tool failures, adjusting assertions
- workflow-patterns.md - Common workflow patterns, tool version migration in .ga files, ToolShed API for version discovery, tool update verification, writing methods sections for publications
- galaxy-workflow-viz/ - Generate Galaxy-branded SVG workflow diagrams (bezier connections, node cards, terminal positioning) for documentation, READMEs, and landing pages. See
galaxy-workflow-viz/SKILL.md and galaxy-workflow-viz/examples/ for style reference.
Related Skills
- galaxy-tool-wrapping - Creating Galaxy tools that can be used in workflows
- galaxy-automation - BioBlend & Planemo foundation for workflow testing
- conda-recipe - Building conda packages for workflow tool dependencies
Applying This Knowledge
When helping with Galaxy workflow development:
- Creating new workflows: Follow IWC structure and naming conventions
- Writing tests: Use appropriate assertions and test data management
- Reviewing workflows: Apply the review checklist systematically
- Debugging: Check lint output and test logs carefully
- Updating workflows: Maintain CHANGELOG and version properly
- Documentation: Write clear, detailed annotations and READMEs
Always prioritize:
- Reproducibility: Pin versions, hash test data
- Usability: Human-readable names, clear documentation
- Quality: Comprehensive tests, generic design
- Standards: Follow IWC conventions strictly
1---
2name: galaxy-workflow-development
3description: Expert in Galaxy workflow development, testing, and IWC best practices. Create, validate, and optimize .ga workflows following Intergalactic Workflow Commission standards.
4version: 1.0.0
5---
6
7# Galaxy Workflow Development Expert
8
9You are an expert in Galaxy workflow development, testing, and best practices based on the Intergalactic Workflow Commission (IWC) standards.
10
11## Core Knowledge
12
13### Galaxy Workflow Format (.ga files)
14
15Galaxy workflows are JSON files with `.ga` extension containing:
16
17#### Required Top-Level Metadata
18```json
19{
20 "a_galaxy_workflow": "true",
21 "annotation": "Detailed description of workflow purpose and functionality",
22 "creator": [
23 {
24 "class": "Person",
25 "identifier": "https://orcid.org/0000-0002-xxxx-xxxx",
26 "name": "Author Name"
27 },
28 {
29 "class": "Organization",
30 "name": "IWC",
31 "url": "https://github.com/galaxyproject/iwc"
32 }
33 ],
34 "format-version": "0.1",
35 "license": "MIT",
36 "release": "0.1.1",
37 "name": "Human-Readable Workflow Name",
38 "tags": ["domain-tag", "method-tag"],
39 "uuid": "unique-identifier",
40 "version": 1
41}
42```
43
44#### Workflow Steps Structure
45
46Steps are numbered sequentially and define:
47
481. **Input Datasets**
49 - `type: "data_input"` - Single file input
50 - `type: "data_collection_input"` - Collection of files
51 - Must have descriptive `annotation` and `label`
52
532. **Input Parameters**
54 - `type: "parameter_input"`
55 - Types: text, boolean, integer, float, color
56 - Used for user-configurable settings
57
583. **Tool Steps**
59 - `type: "tool"`
60 - `tool_id` and `content_id` reference Galaxy ToolShed
61 - `tool_shed_repository` includes owner, name, changeset_revision
62 - `input_connections` link to previous step outputs
63 - `tool_state` contains parameter values (JSON-encoded)
64
654. **Workflow Outputs**
66 - Marked with `workflow_outputs` array
67 - Each output has a `label` (human-readable name)
68 - Can hide intermediate outputs with `hide: true`
69
70#### Advanced Features
71
72- **Comments**: `type: "text"` steps for documentation
73- **Frames**: Visual grouping with color-coded boxes
74- **Reports**: Embedded Markdown templates using Galaxy report syntax
75- **Post-job actions**: Rename, tag, or hide outputs
76- **Conditional execution**: `when` field for conditional steps
77- **Parameter tools**: `compose_text_param`, `map_param_value`, `pick_value`, `param_value_from_file`
78
79#### Conditional Logic Limitations
80
81Galaxy parameter tools have limited comparison capabilities:
82- **Map parameter value**: Maps discrete values to other values via lookup table. Cannot do range comparisons (e.g., "if > X").
83- **Calculate numeric parameter value**: Evaluates arithmetic expressions but outputs a numeric value, not a Galaxy boolean for `when` conditionals.
84- **For numeric comparisons** (e.g., "is genome size > 10Gb?"): Use an **awk** step on a parameter file: `awk '{if ($1 >= 10000000000) print "true"; else print "false"}'`, then feed the text output to a `map_param_value` or `pick_value` to drive conditional branches.
85- **Empty-or-non-empty as boolean**: A `map_param_value` step with **empty mappings** and `unmapped: {"on_unmapped": "input"}` passes the input value through. For `output_param_type: boolean`, the result is `False` for empty strings and `True` for any non-empty value — useful as a `when` gate on optional filter parameters without writing explicit mappings.
86
87### Key Rules
88
89#### Naming Conventions (STRICT)
90
91- **Folder/file names**: lowercase, dashes only (no underscores, no spaces)
92- **Workflow name** (in .ga): Human-readable, can use spaces and capitalization
93- **Input/output labels**: Human-readable, descriptive, no technical abbreviations
94- **Compound adjectives**: Use singular form (e.g., "short-read sequencing", not "short-reads sequencing")
95
96#### Workflow Design Principles
97
981. **Generic Workflows**: No hardcoded sample names; use parameter inputs for user-configurable values
992. **Clear Naming**: Descriptive labels; explain expected format in annotation
1003. **Rich Annotations**: Detailed workflow/step/parameter annotations
1014. **Complete Metadata**: Creator with ORCID, IWC organization, MIT license, semantic versioning
1025. **Pinned Tool Versions**: Exact version + `changeset_revision`; document in CHANGELOG
103
104#### Testing Essentials
105
106- Test file naming: `workflow-name.ga` -> `workflow-name-tests.yml`
107- Minimum one test case per workflow
108- Files < 100KB in `test-data/`; files >= 100KB on Zenodo with SHA-1 hash
109- Use strictest possible assertions; prefer exact file comparison
110- Always use `workflow_lint` for `.ga` files (not `lint`, which is for tool XML)
111
112#### Planemo Commands (Quick Reference)
113
114```bash
115# Lint workflow — argument is the workflow DIRECTORY (planemo walks it for .ga files)
116# NOT the .ga filename. Passing a file fails with "ValueError: Directory not found".
117planemo workflow_lint --iwc .
118
119# Test on live instance (PREFERRED)
120planemo test --fail_fast \
121 --galaxy_url https://usegalaxy.org \
122 --galaxy_user_key "$API_KEY" \
123 workflow.ga
124
125# Test locally (slower, use only when needed)
126planemo test workflow.ga
127
128# Re-test against an existing successful invocation (FAST — seconds, not minutes)
129# Use this whenever ONLY the test YAML was edited and the workflow itself
130# already ran successfully. Skip the full planemo test re-run.
131planemo workflow_test_on_invocation \
132 --galaxy_url https://usegalaxy.org \
133 --galaxy_user_key "$API_KEY" \
134 --test_index 1 \
135 workflow-tests.yml <INVOCATION_ID>
136```
137
138**IMPORTANT**: Always prefer testing against live Galaxy instances over local Galaxy.
139
140**Note**: `-v`/`--verbose` is a **planemo-level** flag and must appear **before** the subcommand: `planemo -v test ...`, not `planemo test -v ...`. The latter fails with "Invalid value for 'TOOL_PATH'".
141
142**Decision rule** — which planemo command to use:
143- Workflow logic (.ga) changed → `planemo test` (full re-run, 10-30+ min)
144- Only assertions in tests YAML changed AND a recent successful invocation exists → `planemo workflow_test_on_invocation <invocation_id>` (re-verifies the test YAML against cached invocation outputs in seconds, no recompute)
145
146Extract the invocation ID from prior `planemo test` output: look for `Invocation <ID>` in the progress bar of the top-level invocation panel (the outer panel, not nested subworkflow panels). See `testing-guide.md` for full `workflow_test_on_invocation` usage including failure-debugging via MCP.
147
148#### Common Issues (Quick Reference)
149
150| Issue | Solution |
151|-------|----------|
152| Test "output not found" | Check output label matches exactly (case-sensitive) |
153| Large test files in repo | Upload to Zenodo, reference by URL with hash |
154| Workflow not generic | Replace hardcoded values with parameter inputs |
155| Tool update breaks workflow | Pin exact version in changeset_revision |
156| Tests pass locally, fail in CI | Check reference data availability on CVMFS |
157| Re-exported .ga loses release/annotation/tags | Galaxy's "Download workflow" wipes top-level `annotation`, `release`, `tags`, and sometimes shortens the ORCID identifier. Re-apply IWC metadata after every re-export; consider a script to re-stamp before commit. |
158| Planemo test keeps returning old error message | Stale stored workflow on Galaxy. Delete it via `DELETE /api/workflows/<id>` before re-running. See `testing-guide.md` Troubleshooting. |
159| Lint warnings | Run `planemo workflow_lint --iwc .` and address each |
160| `Directory not found` from `workflow_lint` | Pass the workflow directory (`.`), not a `.ga` filename — the lint command takes a path it walks for workflow files |
161| Cannot push to planemo-autoupdate branches | Edit via GitHub web UI, or push to own fork |
162| Tool version revert no effect | Disable `use_cached_job` in Galaxy preferences |
163
164### Version Bumping
165
166When updating a workflow:
1671. Update `release` field in .ga file
1682. Add entry to CHANGELOG.md
1693. Update tests if needed
1704. Commit with descriptive message
171
172### Deployment Pipeline
173
174After PR merge: Tests pass -> RO-Crate metadata generated -> Deployed to iwc-workflows -> Registered on Dockstore -> Registered on WorkflowHub -> Auto-installed on usegalaxy.* servers
175
176---
177
178## Export Workflow Construction
179
180### Key Rules
181
1821. **Workflow output labels cannot use variable interpolation** — `${Species Name}` only works in `RenameDatasetAction`, not in `workflow_outputs[].label`. Use static text for output labels.
183
1842. **Optional dataset inputs need a `pick_value` intermediary** — Optional inputs cannot be plugged directly into non-optional tool inputs like `export_remote`. Route them through a `pick_value` step (pick_style: first) with a fallback dataset, and use `when: $(inputs.when)` on the export step to gate execution.
185
1863. **Input box positioning controls form order** — Galaxy renders inputs upper-left to lower-right. Place inputs requiring manual action (text params, booleans, optional datasets) in the upper-left so they appear first in the form. Tag-filtered auto-populated inputs go further right/down to reduce missed settings.
187
188### Export Workflow Structure Pattern
189
190A typical VGP export workflow follows this structure:
191- **Parameter inputs**: Species Name, Assembly ID, Date, Destination (directory_uri)
192- **Boolean inputs**: Conditional flags (e.g., "Upload Annotations?", "Compress files?")
193- **Data inputs**: Tagged datasets from upstream workflows (auto-populated)
194- **Path creation subworkflow**: Builds base paths (root, tracks/, pretextmap/, alignments/, evaluation/)
195- **Compose text param steps**: Build full file paths from subdir + Assembly ID + infix + Date + extension
196- **Compress steps** (conditional): Optional fasta compression via pick_value
197- **Export remote steps**: Grouped by category (main files, evaluation, conditional annotations)
198
199---
200
201## Supporting References
202
203Detailed guidance is split into the following files in this directory:
204
205- **[iwc-standards.md](./iwc-standards.md)** - IWC repository structure, required files (.dockstore.yml, README, CHANGELOG), workflow categories, review checklist, IWC submission preparation (release numbers, runtime parameter cleanup)
206- **[testing-guide.md](./testing-guide.md)** - Complete testing reference: test file structure, assertion types/syntax, Planemo lint errors, remote testing, test data organization, synthetic data generation, troubleshooting tool failures, adjusting assertions
207- **[workflow-patterns.md](./workflow-patterns.md)** - Common workflow patterns, tool version migration in .ga files, ToolShed API for version discovery, tool update verification, writing methods sections for publications
208- **[galaxy-workflow-viz/](./galaxy-workflow-viz/)** - Generate Galaxy-branded SVG workflow diagrams (bezier connections, node cards, terminal positioning) for documentation, READMEs, and landing pages. See `galaxy-workflow-viz/SKILL.md` and `galaxy-workflow-viz/examples/` for style reference.
209
210---
211
212## Related Skills
213
214- **galaxy-tool-wrapping** - Creating Galaxy tools that can be used in workflows
215- **galaxy-automation** - BioBlend & Planemo foundation for workflow testing
216- **conda-recipe** - Building conda packages for workflow tool dependencies
217
218---
219
220## Applying This Knowledge
221
222When helping with Galaxy workflow development:
223
2241. **Creating new workflows**: Follow IWC structure and naming conventions
2252. **Writing tests**: Use appropriate assertions and test data management
2263. **Reviewing workflows**: Apply the review checklist systematically
2274. **Debugging**: Check lint output and test logs carefully
2285. **Updating workflows**: Maintain CHANGELOG and version properly
2296. **Documentation**: Write clear, detailed annotations and READMEs
230
231Always prioritize:
232- **Reproducibility**: Pin versions, hash test data
233- **Usability**: Human-readable names, clear documentation
234- **Quality**: Comprehensive tests, generic design
235- **Standards**: Follow IWC conventions strictly