Accessing multiple parameter values in a single task

Hello,

I have a set of parameters defined as
[cylc]
[[parameters]]
vars = a,b,c
which get used in the workflow to run separate tasks, e.g
foo => bar<vars>

I have another task that only runs once, but needs knowledge of all the parameter values defined by “vars” to be used as arguments to a script , e.g
[[my_new_task]]
script = “”"
my_script.sh a b c
“”"

Could you provide any pointers on how best to achieve this please? Currently being run with Cylc 7.8.14 but in process of porting to cylc8 so a solution that can be applied to both would be most helpful.

Many thanks,

We usually use Jinja2 to achieve this e.g:

#!Jinja2

{% set params=['a', 'b', 'c'] %}

[task parameters]
    param = {{ params | join(', ') }}

[scheduling]
    [[graph]]
        R1 = foo => bar<param>

[runtime]
    [[my_new_task]]
        script = my_script.sh {{ params | join(' ') }}

To see how this evaluates, use the cylc view -p command:

$ cylc view -p .
[task parameters]
    param = a, b, c
[scheduling]
    [[graph]]
        R1 = foo => bar<param>
[runtime]
    [[my_new_task]]
        script = my_script.sh a b c

Perfect, thanks Oliver