Running a task only on a Saturday?

Hi @samoore,

You’re on the right track.

is there a more elegant way to achieve this?

That’s not particularly inelegant - it clearly expresses the actual dependencies you’ve described. However, you could generate them with a Jinja2 loop.

How do I get rid of the task4 instance on the very first T00Z cycle?

There are two problems with using P6D

  • You want a 7 day cycle that lands on each Saturday, not a 6 day cycle
  • P6D is short for R/^/P6D, i.e. it starts at the initial cycle point (which you say must be a Sunday). To fix this, use the full recurrence expression with an offset starting point.

This should do it:

#!Jinja2
[scheduler]
   cycle point format =CCYY-Www-D  # Year-Week-DayOfWeek
[scheduling]
   initial cycle point = 20220522T0000Z  # or 2022-W21-7
   initial cycle point constraints = W-7  # Must start on a Sunday
   [[graph]]
      P1D = "task1 => task2 => task3"
      R/^+P6D/P1W = """
         {% for i in range(7) %}
            task3[-P{{i}}D] => task4
         {% endfor %}
      """
[runtime]
   [[task1]]
   [[task2]]
   [[task3]]
   [[task4]]

Note I’ve used a week-based cycle point format, which makes it easy to see what’s going on for this sort of workflow, e.g. when graphing it. Just comment out that one line to revert to the normal format.

To see the effect of the Jinja2 loop:

$ cylc view -j --stdout .  # (if in the source directory)

To graph 2 weeks of the workflow:

$ cylc graph . 2022-W21 2022-W22-6

(Note you can still use week-based formats anywhere, like this, regardless of the format set in the workflow definition).