<p>I'm working with Kubeflow pipelines. I would like to access the &quot;Run name&quot; from inside the a task component. For example in the below image the run name is &quot;My first XGBoost run&quot; - as seen in the title.</p>
<p><a href="https://i.stack.imgur.com/RELO4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RELO4.png" alt="enter image description here" /></a></p>
<p>I know for example it's possible to <a href="https://stackoverflow.com/a/57047661/1110328">obtain the workflow ID</a> by passing the parameter <code>{{workflow.uid}}</code> as a command line argument. I have also tried the <a href="https://github.com/argoproj/argo/blob/master/docs/variables.md#global" rel="nofollow noreferrer">Argo variable</a> <code>{{ workflow.name }}</code> but this doesn't give the correct string.</p>

<p>You can use <code>{{workflow.annotations.pipelines.kubeflow.org/run_name}}</code> argo variable to get the run_name</p>
<p>For example,</p>
<pre class="lang-py prettyprint-override"><code>@func_to_container_op
def dummy(run_id, run_name) -&gt; str:
    return run_id, run_name

@dsl.pipeline(
    name='test_pipeline',
)
def test_pipeline():
  dummy('{{workflow.labels.pipeline/runid}}', '{{workflow.annotations.pipelines.kubeflow.org/run_name}}')

</code></pre>
<p>You will find that the placeholders will be replaced with the correct run_id and run_name.</p>
