Restarting a workflow mid-way when it has finished, running 1 task

I have a task that silently fails (because the error trapping is inadequate), so cylc thinks it has succeeded, and shuts down the suite because the workflow has finished.

It took me a while to figure out what to do next, because the documentation didn’t really seem to cover exactly this case (or not where I was looking). Can this be improved?

I cylc play --pause (because otherwise it shuts down immediately), then cylc reload. Then I can retrigger the task, but I have to release (play) the whole suite to actually let the task run. How do I just release a single task? cylc release doesn’t seem to be enough.

It sounds like you’re after cylc trigger --flow=none <task_id> (followed by cylc play <workflow_id> to resume and let the task submit).

the --flow=none option means the triggered task will not belong to any “flow”, so no other tasks will run and the workflow will shut down after that task is finished.

I’m sure it can be improved. We could use a section on how to manipulate tasks various ways in a restarted completed workflow… How to "continue" a completed workflow · Issue #525 · cylc/cylc-doc · GitHub

You don’t need cylc reload there. The scheduler automatically parses the updated flow.cylc on restart.

@MetRonnie 's suggestion will run a single task with no ongoing flow, but only if the scheduler is not globally paused. (In which case the triggered task will run when you unpause the scheduler).

Cylc 8 makes a distinction between scheduler pause (hold all job submission) and task hold (hold job submission even if the task is ready to run).

In Cylc 7 (if I recall correctly) we faked scheduler pause by holding all tasks at once, which allowed individual task release.

So if you want to allow only a single task to run, you could cylc hold other tasks that are ready to run (or would soon become ready) then unpause the scheduler. Note you can hold future tasks in Cylc 8 (in Cylc 7 you could only tasks already spawned into the waiting state).

In principle we could allow cylc trigger to force a task to run despite the paused scheduler, but then what should happen downstream of the triggered task (if the scheduler is still paused).

I really appreciate the explanantions. Since I’m building a workflow, adding new tasks to a completed flow is pretty common just now.
So, if I have finished my R1 tasks, and I add the first cycling tasks, I don’t want to let the whole thing run because I haven’t yet added all the intercycle dependencies and cylc will expect to let the first tasks of the cycle run immediately. So, inferring from what you’ve just told me, I will need to add my new tasks, play (pause) the workflow, hold the future cycle(s), trigger the new tasks, then unpause the flow. And that will allow only the first cycle’s new cycling tasks to run?

Yes, more or less.

Once you’ve held any tasks that are ready to go, you can unpause the scheduler before doing any triggering if you like.

Cycling tasks with no prerequisites will spawn immediately out to the runahead limit, but you can hold them all at once:

cylc hold "test//*/a"

It might be easier, during initial development, to set a final cycle point so there are no future points to run at all.