If you just need a random number i would recommend solving this through a javascript expression.

As an expression tool, this might look like:

```
cwlVersion: v1.0
class: ExpressionTool
requirements:
InlineJavascriptRequirement: {}
inputs:
min:
type: int
max:
type: int
outputs:
random_integer:
type: int
expression: |
${
var randomInt;
var min = Math.ceil(inputs.min);
var max = Math.floor(inputs.max);
randomInt = Math.floor(Math.random() * (max - min + 1)) + min;
return {"random_integer": randomInt};
}
```

You can also just add a javascript expression directly into your tool or workflow, without the overhead of an expression tool.
The javascript math is plucked from stackoverflow, but it *looks* like it should provide random integers.

•

link
modified 12 months ago
•
written
12 months ago by
Tom • **530**