# Access to name of run from within flow.cylc

**URL:** <https://cylc.discourse.group/t/access-to-name-of-run-from-within-flow-cylc/458>\
**Category:** Cylc Support\
**Created:** [April 4, 2022, 6:08pm UTC](https://cylc.discourse.group/t/access-to-name-of-run-from-within-flow-cylc/458 "2022-04-04T18:08:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bencash](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@bencash](https://cylc.discourse.group/u/bencash)\
**Post date:** [April 4, 2022, 6:08pm UTC](https://cylc.discourse.group/t/access-to-name-of-run-from-within-flow-cylc/458/1 "2022-04-04T18:08:35Z")

</div>

Is there a way to access the name of a workflow from within flow.cylc? E.g., if I cylc install and get foo/run1, is there any way to access foo/run1 or just run1 as an environment variable in flow.cylc to use for something like directory names?

---

<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 4, 2022, 6:30pm UTC](https://cylc.discourse.group/t/access-to-name-of-run-from-within-flow-cylc/458/2 "2022-04-04T18:30:26Z")

</div>

In a task you can use `${CYLC_WORKFLOW_ID}`  
[https://cylc.github.io/cylc-doc/8.0rc2/html/reference/job-script-vars/index.html](https://cylc.github.io/cylc-doc/8.0rc2/html/reference/job-script-vars/index.html)

---

<div class="post-metadata">

**Author:** ![bencash](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@bencash](https://cylc.discourse.group/u/bencash)\
**Post date:** [May 4, 2022, 3:48pm UTC](https://cylc.discourse.group/t/access-to-name-of-run-from-within-flow-cylc/458/3 "2022-05-04T15:48:10Z")

</div>

Is this variable only available in recent version of cylc8? I tried this in an older install (8.0b2) and it doesn’t seem to be picking up $CYLC\_WORKFLOW\_ID as a defined quantity.

---

<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:** [May 4, 2022, 4:06pm UTC](https://cylc.discourse.group/t/access-to-name-of-run-from-within-flow-cylc/458/4 "2022-05-04T16:06:06Z")

</div>

Yes, that’s right. For 8.0b2 you might be able to use `$CYLC_WORKFLOW_NAME`. I can’t remember if that included the `run1` etc or not.

List of available env vars in the 8.0b2 docs: [Runtime - Task Configuration — Cylc 8.0b2 documentation](https://cylc.github.io/cylc-doc/8.0b2/html/user-guide/writing-workflows/runtime.html#task-job-script-variables)
