Pass variable between tasks

two tasks A->B

A determines a value that B would like to use.

could have A write to a file, and then B read the file.

is there a method within cylc to pass values between tasks?


The cylc broadcast command allows you to modify items in the [runtime] section of the workflow configuration. It is often used to set environment variables for tasks.

There is a tutorial for this confusingly hidden in the Rose documentation (will be moved into the Cylc docs soon):

Sometimes the filesystem is the better way to exchange data, some quick notes:

  • Broadcasts can be set, reset and cleared, they appear in cylc review.
  • Broadcasts can target multiple tasks, or entire cycles.
  • Jobs run with any settings broadcasted when the job was submitted (whereas if you change a file that could take effect whilst a task is running).
  • Broadcasts can change [runtime] settings (including [environment] variables but excluding inherit).
  • Broadcasts require http(s) or ssh+http(s) task comms (i.e. can’t work with polling task comms).
  • Broadcasts work for tasks run on platforms with different filesystems where using files would be tricky.
  • Broadcasts are not suitable for serialising data structures (e.g. Python pickle)