Access to name of run from within flow.cylc

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?

In a task you can use ${CYLC_WORKFLOW_ID}

1 Like

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.

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