Triggering from any and all successful tasks in a family


Newbie user here (still on Cylc 7.9). Is there a way to trigger a task off a family each time any of that family succeeds? Basically, each time a task finishes successfully in a family, I want to transfer that data somewhere. Something like:

FAMILY:succeed-each-one => transfer_data

Or am I stuck with:

family_task_1 => transfer_data_1
family_task_2 => transfer_data_2
family_task_3 => transfer_data_3

Where transfer_data_n is the same script, but just written out a lot in [runtime] section, i.e.:

      script = ''
      script = ''
      script = ''

Thanks in advanced.

Good question!

No, the point of a family trigger is make the downstream task(s) trigger once when some collective family state is achieved (succeed-all, succeed-any, …).

To do what you want efficiently though, just use parameterized tasks:

# (Cylc 7 syntax)
      m = 0..5
      graph = "f<m> => g<m>"
      # ...
      # ...

(Use cylc list or cylc graph on the above to see the resulting tasks).

Note, you can still have the individual tasks inherit from families under [runtime], just don’t use family triggers in the graph if you want member-to-member rather than collective triggering.

Also, you can pass the parameter value to each task so it knows (say) which file to process, and you can single out specific tasks if needed e.g. f<m=2>` - see the User Guide section on parameterized tasks.

1 Like

Thanks Hilary! This is exactly what I wanted. Cheers!