# Advice on how to parametrize the environment

**URL:** <https://cylc.discourse.group/t/advice-on-how-to-parametrize-the-environment/1313>\
**Category:** Cylc Support\
**Created:** [April 29, 2026, 8:24am UTC](https://cylc.discourse.group/t/advice-on-how-to-parametrize-the-environment/1313 "2026-04-29T08:24:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sparonuz](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/sparonuz/32/495_2.png) [@sparonuz](https://cylc.discourse.group/u/sparonuz)\
**Post date:** [April 29, 2026, 8:24am UTC](https://cylc.discourse.group/t/advice-on-how-to-parametrize-the-environment/1313/1 "2026-04-29T08:24:27Z")

</div>

Hi everyone,

I am using cylc 8.6.0.

I created a simple cylc workflow that runs a model on a given HPC, let’s call it Platform1.

Now: half of our users have an account on Platform1, but the other half uses another HPC, let’s call it Platform2. All of them would like to run the exact same workflow.

Of course, on Platform2, SLURM queue, partition, module names, etc. are all different. So I started asking myself how to deal with this, without creating a completely new cylc workflow.

What I came up with is the following: I put all the platform-related variables in a separate git project, and I istall it with rose in the rose-suite.conf (as I do with the configurations, to deal with the different releases of the model).

```auto
[env]
ENV_TAG=Platform1/2
[file:env]
source=git:git@gitlab[...]my_suite_env::./::${ENV_TAG}

```

Now, I can install and validate without any problem. It also runs, but when I try to reaload: `cylc vr my_workflow_ID` fails, since in flow.cylc I have:

```auto
[[root]]
        # these env vars will be available to all tasks:
        [[[environment]]]
            %include 'env/environment.cylc'

```

And cylc looks for them in the cycl-src/workflow\_ID, while they are present just in the cylc-run/workflow\_ID folder.

At this point, I am wondering if I am doint it all wrong, and are there simpler and more “cylc/rose” way of doing this?

Thanks in advance for your help!  
Stella

---

<div class="post-metadata">

**Author:** ![MetRonnie](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/metronnie/32/125_2.png) [@MetRonnie](https://cylc.discourse.group/u/MetRonnie)\
**Post date:** [April 29, 2026, 11:43am UTC](https://cylc.discourse.group/t/advice-on-how-to-parametrize-the-environment/1313/2 "2026-04-29T11:43:25Z")

</div>

From a quick look, I think the short answer to your question is to use a Jinja2 `include` instead of Cylc’s baked in `include`

```cylc
        [[[environment]]]
           {% if CYLC_WORKFLOW_RUN_DIR is defined %}
           {% include CYLC_WORKFLOW_RUN_DIR ~ 'env/environment.cylc' %}
           {% endif %}

```

Note `CYLC_WORKFLOW_RUN_DIR` will not be defined when running e.g. `cylc validate` on the source workflow before it has been installed - see [Jinja2 — Cylc 8.6.3 documentation](https://cylc.github.io/cylc-doc/latest/html/user-guide/writing-workflows/jinja2.html#workflow-context-variables)

---

<div class="post-metadata">

**Author:** ![dpmatthews](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/dpmatthews/32/26_2.png) [@dpmatthews](https://cylc.discourse.group/u/dpmatthews)\
**Post date:** [April 29, 2026, 1:30pm UTC](https://cylc.discourse.group/t/advice-on-how-to-parametrize-the-environment/1313/3 "2026-04-29T13:30:54Z")

</div>

Is there a reason you want to keep the platform-related variables in separate git projects? It would be simpler if you stored them with the workflow and used Jinja2 to load the correct include file. This would allow validation of the source workflow to work which means that the `cylc vip` command would work (as would`cylc vr`).

---

<div class="post-metadata">

**Author:** ![sparonuz](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/sparonuz/32/495_2.png) [@sparonuz](https://cylc.discourse.group/u/sparonuz)\
**Post date:** [April 29, 2026, 2:24pm UTC](https://cylc.discourse.group/t/advice-on-how-to-parametrize-the-environment/1313/4 "2026-04-29T14:24:29Z")

</div>

Thanks both!

@MetRonnie I was not aware that you can include files with jija2! This is the way to go

@dpmatthews No, I don’t. In fact my first attempt was to have two subfolders in env:

```auto
-env/
  -platform1
  -platoform2

```

But I could not work out how to parametrize the include, and I was looking for a different method. But now with jinja2 I do:

```auto
{% set PLATFORM = 'platform2' %}
{% set env_file = 'env/' ~ PLATFORM ~ '/environment.cylc' %}
[...]
[[[environment]]]
{% include env_file %}

```

And it works very well!

Thanks a lot for your help,  
Stella
