# Command to restart workflow from a given task in middle of workflow to last task of workflow

**URL:** https://cylc.discourse.group/t/command-to-restart-workflow-from-a-given-task-in-middle-of-workflow-to-last-task-of-workflow/1339
**Category:** Cylc Support
**Created:** [September 1, 2026, 7:14pm UTC](https://cylc.discourse.group/t/command-to-restart-workflow-from-a-given-task-in-middle-of-workflow-to-last-task-of-workflow/1339 "2026-09-01T19:14:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bpabla50](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@bpabla50](https://cylc.discourse.group/u/bpabla50)
#### Post date: [September 1, 2026, 7:14pm UTC](https://cylc.discourse.group/t/command-to-restart-workflow-from-a-given-task-in-middle-of-workflow-to-last-task-of-workflow/1339/1 "2026-09-01T19:14:21Z")

</div>

Hi  
I am using following procedure to restart a given task somewhere in work flow

```auto
  cylc vr gmcylc_u3 ....validate and reload workflow
 cylc play gmcylc_u3 ... needed only, if workflow already stopped
 cylc trigger gmcylc_u3//^/Prep ; trigger aka rerun Prep task; ^ ==> from first cycle

```

What will be the command to say, a) run all tasks starting from Prep to last task of workflow b) start from Prep to finish following 5 tasks c) start from Prep task, and finish upto say Runmodel

---

<div class="post-metadata">

### Author: ![oliver.sanders](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/oliver.sanders/32/110_2.png) [@oliver.sanders](https://cylc.discourse.group/u/oliver.sanders)
#### Post date: [September 2, 2026, 8:59am UTC](https://cylc.discourse.group/t/command-to-restart-workflow-from-a-given-task-in-middle-of-workflow-to-last-task-of-workflow/1339/2 "2026-09-02T08:59:28Z")

</div>

If you want to re-run the workflow from beginning to end, the easiest way is to create a new run with `cylc vip`. This creates a new installation of the workflow, separate to the old one which prevents data assets created by the first run, from polluting the second.

We would only _re_-run tasks _within_ the same installation (the question you are asking) if we wanted them to inherit the data left behind by their predecessors. So, in general, create a new run with `cylc vip` and remove the old run with `cylc clean`.

However, there are situations where we would want to re-trigger a subgraph of tasks with the data from their previous runs, an example might be incremental build systems.

  

In these situations, if you know the list of tasks you want to run, trigger them all in a single command and Cylc will run them through in order, for example:

```auto
# re-run the specified tasks
cylc trigger 'gmcylc_u3//' '//^/Prep' '//^/task-1' '//^/task-2' '//1/foo[123]'

```

Note, you can groups of tasks by referencing cycles (e.g, `//^` or `//1`), or families (e.g, `//^/PREP`), or using patterns (e.g, `//^/*hpc`, `//5/foo_*`).

  

If you cannot list the tasks you want to re-run, the documented solution is to [create a new “flow”](https://cylc.github.io/cylc-doc/stable/html/user-guide/interventions/index.html#re-run-multiple-tasks). This is an advanced intervention that creates a new execution of the workflow’s graph.

```auto
# re-run Prep and everything after it
cylc trigger 'gmcylc_u3//^/Prep' --flow=new

```

  

If you want to prevent a workflow from running past a specified point, e.g, “run the next 5 tasks”, then hold the tasks you don’t want to run.

This can be done by:

- Setting the workflow’s `--hold-after-cycle` (see `cylc play --help`).
- Holding the tasks you don’t want to run (see `cylc hold --help``).
- Telling the workflow to shut down after a specified task or cycle (see `cylc stop --help`).
