nextflow-io / nextflow-io/nextflow
Validation using records is not working
Open
Nobody has claimed this yet.
error-improvements
- Dominant language
- Groovy
- Stars
- 3.5k
- Forks
- 811
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 61
Description
Bug report
Expected behavior and actual behavior
When using records with types , the values should be validated with their respective record type
Steps to reproduce the problem
Using this minimal example:
nextflow.enable.types = true
record Sample {
id: Boolean
path: Path
}
process hello{
input:
sample: Sample
script:
"""
echo "Hello sample ${sample.id}!" >>output.txt
echo "sample.id class = ${sample.id?.getClass()}" >>output.txt
"""
}
workflow {
sample1 = record(id: "NotANumber",path: file("dummy.txt", checkIfExists: false))
//sample1 = record(id: 1.1 as Float,path: file("dummy.txt", checkIfExists: false))
//This is the only one that fails
//sample1 = record(id: 1,path: "NotAPath")
hello(sample1)
}
workflow {
sample1 = record(id: "notNumber")
hello(sample1)
}
Program output
The issue is that only the case of NotAPath fails with the expected:
Caused by:
Not a valid path value: 'NotAPath'
Environment
- Nextflow version: 6.04.0
- Java version: openjdk 17.0.18 2026-01-20
- Operating system: macOS
- Bash version: zsh 5.9 (arm64-apple-darwin25.0)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the minimal reproduction from the issue with type checking enabled, then trace how the Sample record is validated when passed to the process input. Done means values that do not match the declared Boolean, Float, and Path types are consistently rejected, while valid values continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100