# Make task run before any other task can run

**URL:** <https://cylc.discourse.group/t/make-task-run-before-any-other-task-can-run/1315>\
**Category:** Cylc Support\
**Created:** [May 1, 2026, 12:40pm UTC](https://cylc.discourse.group/t/make-task-run-before-any-other-task-can-run/1315 "2026-05-01T12:40:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonnyhtwilliams](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtwilliams/32/567_2.png) [@jonnyhtwilliams](https://cylc.discourse.group/u/jonnyhtwilliams)\
**Post date:** [May 1, 2026, 12:40pm UTC](https://cylc.discourse.group/t/make-task-run-before-any-other-task-can-run/1315/1 "2026-05-01T12:40:00Z")

</div>

Hiya

What’s the best way to force a workflow to run a particular task (in this case a dummy one, `remote_setup`) before _any_ others?

Currently I’m achieving this by manually graphing the `remote_setup` before each task which starts the workflow. This works but isn’t trivially portable. I’m sure there’s a really simple answer to this but I can’t figure it out from the docs.

Thanks in advance.

Jonny

 ![image](https://global.discourse-cdn.com/free1/uploads/cylc1/original/1X/8bdfba6d241107f73e72b358d6428de84be01b02.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:** [May 4, 2026, 12:16am UTC](https://cylc.discourse.group/t/make-task-run-before-any-other-task-can-run/1315/2 "2026-05-04T00:16:46Z")

</div>

Hi @jonnyhtwilliams

Generally yes, dependencies are what make tasks wait for other tasks, so you need your start-up task to be first in the graph, and all other tasks must be downstream of it (but not necessarily directly downstream, of course).

I suspect you might be asking how to make _parentless_ tasks in every cycle of _cycling_ workflow wait for start-up tasks though? The same principle holds, but there are a couple of ways to achieve the result. (Either way, I’ll explain it here as most users run into this question).

```ini
[scheduling]
    [[graph]]
        R1 = "prep => get-data"
       # ERROR: get-data is only forced to wait on prep in the first cycle!
        P1 = """
              get-data => model => post
              model[-P1] => model
        """

```

The problem here is that `1/prep, 2/get-data, 3/get-data, ...`can all run immediately at startup, because Cylc runs multiple cycles at once as far as dependencies allow.(out to the runahead limit)

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

So you need to make all the parentless `get-data` tasks wait on `prep` in every cycle:

```ini
[scheduling]
    cycling mode = integer
    [[graph]]
        R1 = "prep => get-data"
        P1 = """
              prep[^] => get-data => model => post
              model[-P1] => model
        """

```

Result:

 ![foo2](https://global.discourse-cdn.com/free1/uploads/cylc1/original/1X/8bc3426947f7eceea0b42af655dce03ab27b68ff.png)

This does reflect the true dependencies of the system, and it works fine, but in more complex workflows with a bunch of startup tasks it can make graph visualization very messy.

A workaround that achieves the result less messily is to put a dummy task (`prepped`, say) in every cycle, and connect that back to the initial `prep` task like this:

```ini
[scheduling]
    cycling mode = integer
    [[graph]]
        R1 = "prep => prepped"
        P1 = """
              prepped[-P1] => prepped => get-data => model => post
              model[-P1] => model
        """
[runtime]
    [[prepped]]
         run mode = skip # dummy task

```

 ![foo3](https://global.discourse-cdn.com/free1/uploads/cylc1/original/1X/2eb9b143f9f9b9e3d17c494992f6a0f21a408ae5.png)

(We are also considering adding an isolated start-up graph to Cylc, which will complete before the main cycling graph begins so users won’t have to manage true start-up processes with dependencies like this - but the team hasn’t finished with that discussion yet).

---

<div class="post-metadata">

**Author:** ![jonnyhtwilliams](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtwilliams/32/567_2.png) [@jonnyhtwilliams](https://cylc.discourse.group/u/jonnyhtwilliams)\
**Post date:** [May 6, 2026, 4:36pm UTC](https://cylc.discourse.group/t/make-task-run-before-any-other-task-can-run/1315/3 "2026-05-06T16:36:54Z")

</div>

Thanks so much @hilary.j.oliver for the in depth explanation, very useful indeed.

If I only want to run this `prep` task in the very first cycle, I guess I can just use your combination of `R1` and `P1` in the first example.

I must admit I had overlooked the subtleties involved and the differences between `R1` and `P1`! 😁
