Scheduling a "final" task?

Interested to hear what the experts have to say here, but I wonder whether the answer might involve the [[[ R1/P0Y ]]] (aka [[[ R1/$ ]]]) syntax mentioned in the scheduling advanced examples?

Should be clear I’ve never played with this, mention only as have spotted it in passing!

Not sure if you can put your final task in the graph there “bare” - would be nice if could (bit like a finally clause in Python).

But given usual eager-to-run behaviour in normal cycle points, suspect you might have to explicitly specify in graph that all the various last-task-in-earlier-cycle-points are prerequisites for this final task, so you could get your guaranteed “this really will run last”?

  • If it’s this, it looks like the $ symbol may be helpful when specifying prerequisites, to avoid missing any other tasks running at the final cycle point.

Alternatively, if you can make each cycle point complete with an identical task, and you can avoid running those tasks at the final cycle point (e.g. via date exclusion???), I wonder if it would be possible to use a trigger family (my new favourite toy!), and have something like (untested)

# <snip>
[[dependencies]]
[[R1]
# <snip>
[[[PT1H]]]
# Or whatever your regular cycle is
# Likely needs adjusting to avoid running *at* final cycle point?
# Would this be PT1H!$ ???
graph = """a =>
    b =>
    cycle_complete
"""
[[[ R1/P0Y ]]]
graph = COMPLETE_TRG:succeed-all => my_really_final_task

[runtime]
# <snip>
[[COMPLETE_TRG]]
   [[[meta]]]
       title = Trigger for tasks at end of given cycle points
# <snip>
[[cycle_complete]]
inherit = FOO, BAR, COMPLETE_TRG
# <snip>

This is naively hoping that not specifying previous cycles in COMPLETE_TRG:succeed-all automagically picks up cycle_complete tasks from all previous cycles as prerequisites… :slight_smile:

  • Edit: hmm, actually, from the inter-cycle trigger docs I don’t think this will pick up cycle_complete tasks from previous cycles :(.