# Extending a workflow

**URL:** <https://cylc.discourse.group/t/extending-a-workflow/623>\
**Category:** Cylc 8 Migration\
**Created:** [April 4, 2023, 3:42am UTC](https://cylc.discourse.group/t/extending-a-workflow/623 "2023-04-04T03:42:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonnyhtw](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtw/32/232_2.png) [@jonnyhtw](https://cylc.discourse.group/u/jonnyhtw)\
**Post date:** [April 4, 2023, 3:42am UTC](https://cylc.discourse.group/t/extending-a-workflow/623/1 "2023-04-04T03:42:47Z")

</div>

hey there,

i have successfully run a 1 month coupled atmosphere-ocean-sea ice model with `cylc` 8 (yay!) and want to extend it. I’ve changed the `RUNLEN` variable in the `rose-suite.conf` file and run `cylc reload u-cu431` and…

`cylc play u-cu431 --start-cycle-point=19781001T0000Z`

… but i get this error…

`2023-04-04T03:40:57Z ERROR - Workflow shutting down - InputError: option --startcp is not valid for restart`

is this the right way of going about it from a conceptual point of view?

in `cylc` 7 i would have just done `rose suite-run --restart` after changing the `RUNLEN`.

thanks!

ps - i looked through the docs but couldn’t work it out! 😄

---

<div class="post-metadata">

**Author:** ![hilary.j.oliver](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/hilary.j.oliver/32/4_2.png) [@hilary.j.oliver](https://cylc.discourse.group/u/hilary.j.oliver)\
**Post date:** [April 4, 2023, 5:21am UTC](https://cylc.discourse.group/t/extending-a-workflow/623/2 "2023-04-04T05:21:17Z")

</div>

> [@jonnyhtw](#):
>
> i have successfully run a 1 month coupled atmosphere-ocean-sea ice model with `cylc` 8 (yay!)

🎉

> [@jonnyhtw](#):
>
> want to extend it. I’ve changed the `RUNLEN` variable in the `rose-suite.conf` file and run `cylc reload u-cu431` and…
> 
> `cylc play u-cu431 --start-cycle-point=19781001T0000Z`

For others reading this, note `RUNLEN` is not a Cylc thing, so we might need to know what it does in the context of this workflow.

Note `cylc reload` tells an already-running scheduler to reload a changed `flow.cylc`, which you have presumably reinstalled from the source directory (with `cylc reinstall` or `cylc vr` - validate + reinstall).

`cylc play` starts a scheduler for a workflow that is not currently running. If the workflow has never run before, it will start it from scratch (the beginning of the graph). If it had run before, it will restart from where it got to before.

Did the scheduler shut down as finished prior to this, or did you tell it to shut down before it finished?

If it shut down as finished, it will just shut down as finished again if you try to restart it. (However, you can pause it on start-up and trigger a new flow in it, if you want).

---

<div class="post-metadata">

**Author:** ![jonnyhtw](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtw/32/232_2.png) [@jonnyhtw](https://cylc.discourse.group/u/jonnyhtw)\
**Post date:** [April 4, 2023, 9:43pm UTC](https://cylc.discourse.group/t/extending-a-workflow/623/3 "2023-04-04T21:43:09Z")

</div>

thanks for this.

good point re `RUNLEN`, it’s the standard variable name for the total run length of a climate model, e.g. 85 years from 2015-2100.

the workflow was set to run for 1 month (i.e. `RUNLEN`=1 month) and then stopped as expected (see screenshot) and i now want to continue the run from where it got to and continue the run.

> Did the scheduler shut down as finished prior to this, or did you tell it to shut down before it finished?

it shut down correctly after running for 1 month.

> … you can pause it on start-up and trigger a new flow in it, if you want

this sounds like what i want! 😄

i tried this and it didn’t work, that is, the output is printed as below but the run doesn’t restart or anything…

```auto
cylc reinstall u-cu431/run1
cylc play u-cu431/run1

2023-04-04T21:37:28Z INFO - Extracting job.sh to /scale_wlg_persistent/filesets/home/williamsjh/cylc-run/u-cu431/run1/.service/etc/job.sh
u-cu431/run1: w-clim01.maui.niwa.co.nz PID=2622

```

in case it’s of interest, this is an _extremely_ common and important workflow requirement for climate modelling which is why i’m trying to make this query detailed for future reference! 😃

 ![image](https://global.discourse-cdn.com/free1/uploads/cylc1/original/1X/06fd700e8c4844341631487acffdcaf05129971b.png)

---

<div class="post-metadata">

**Author:** ![hilary.j.oliver](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/hilary.j.oliver/32/4_2.png) [@hilary.j.oliver](https://cylc.discourse.group/u/hilary.j.oliver)\
**Post date:** [April 4, 2023, 11:38pm UTC](https://cylc.discourse.group/t/extending-a-workflow/623/4 "2023-04-04T23:38:30Z")

</div>

> [@hilary.j.oliver](#):
>
> or `cylc vr` - validate + reinstall).

Correction/expansion:

```console

$ cylc vr --help         
Usage: cylc validate-reinstall [OPTIONS] WORKFLOW        
                                                                             
Validate, reinstall and apply changes to a workflow.              
                                                           
Validate and reinstall a workflow then either:    
                                                
* "Reload" the workflow (if it is running),     
* or "play" it (if it is stopped).       

This command is equivalent to:        
  $ cylc validate myworkflow --against-source              
  $ cylc reinstall myworkflow                          
  # if myworkflow is running:                               
  $ cylc reload myworkflow         
  # else:                                    
  $ cylc play myworkflow           
                 
Note:                            
  "cylc validate --against-source" checks the code in the workflow source               
  directory against any options (e.g. template variables) which have been set  
  in the installed workflow to ensure the change can be safely applied.     
...

```

---

<div class="post-metadata">

**Author:** ![hilary.j.oliver](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/hilary.j.oliver/32/4_2.png) [@hilary.j.oliver](https://cylc.discourse.group/u/hilary.j.oliver)\
**Post date:** [April 4, 2023, 11:48pm UTC](https://cylc.discourse.group/t/extending-a-workflow/623/5 "2023-04-04T23:48:23Z")

</div>

> [@jonnyhtw](#):
>
> in case it’s of interest, this is an _extremely_ common and important workflow requirement for climate modelling which is why i’m trying to make this query detailed for future reference

Absolutely.

At the moment (but, see below ) if you `cylc play` an already-finished workflow the scheduler will detect that it already finished and just shut down immediately, with no time for you to tell it to pause before shutdown. So if you want to trigger more action, you have to tell it to pause straight off via the `play` command line:

```auto
cylc play --pause

```

we have several developments in the works already to make this kind of thing easier, e.g. (soon) if you restart a finished workflow, the scheduler will stall on a timeout to allow time for intervention, rather than shutting down immediately

---

<div class="post-metadata">

**Author:** ![jonnyhtw](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtw/32/232_2.png) [@jonnyhtw](https://cylc.discourse.group/u/jonnyhtw)\
**Post date:** [April 5, 2023, 12:26am UTC](https://cylc.discourse.group/t/extending-a-workflow/623/6 "2023-04-05T00:26:44Z")

</div>

ah ok i see, got it. i hadn’t tried `cylc play --pause` so will give that a go next time i need to do something similar.

thanks
