<p>I've stumbled upon a problem when using some more complex argo workflows with initialization and clean-up logic. We are running some initialization in one of the initial steps of the workflow (e.g. creation of some resources) and we'd like to perform a clean-up regardless of the status of the workflow. <code>onExit</code> template seems to be an ideal solution (I think that clean-up is even mentioned in argo documentation as predestined for tasks of the <code>onExit</code> template).</p>
<p>However, I haven't found a way yet to pass some values to it. For example - let's say that in the initialization phase we created some resource with id <code>some-random-unique-id</code> and we'd like to let the <code>onExit</code> container know what resources it needs to clean up.</p>
<p>We tried the <code>outputs</code> of some steps, but it seems that <code>steps</code> are unknown in the <code>onExit</code> template.</p>
<p>Is there a built-in argo mechanism to pass this kind of data? We'd like to avoid some external services (like key-value storage service that would hold the context).</p>

Andrzej Igielski
<p>You can mark output parameters as global using the <code>globalName</code> field. A global output parameter, assuming it has been set, can be accessed from anywhere in the Workflow, including in an exit handler.</p>
<p>The example file for writing and consuming global output parameters should contain all the information you need to use global output parameters in an exit handler.</p>
<p><a href="https://github.com/argoproj/argo-workflows/blob/master/examples/global-outputs.yaml" rel="nofollow noreferrer">https://github.com/argoproj/argo-workflows/blob/master/examples/global-outputs.yaml</a></p>
