<p>I wasn't really sure how to label this question, because i'll be good with any of the solutions above (inheritance of containers or defining parameters for the entire workflow without explicitly setting them in each step template).</p>
<p>i am currently working with argo yaml's and i want to define certain values that will be inputted once (and also, be optional), and will be used by every pod in the yaml.</p>
<p>i'm sure there's a better way to do this than what i found by now, but i can't find anything in the docs.
currently the way i saw was defining that parameter as a workflow argument, and then for each container defined - defining it as an input parameter/env parameter.</p>
<p>my question is this - isn't there a way to define those 'env' variables at the top level? of the workflow? so that every pod will use them without me explicitly telling it to?</p>
<p>or - maybe even create one container that has those arguments defined, so that every other container i define inherits from that container and i wouldn't have to write those parameters as input/env for each one i add?</p>
<p>i wouldn't want to add these three values to each container i define. it makes the yaml very big and hard to read and maintain.</p>
<pre><code>    container:
      env:
      - name: env_config
        value: &quot;{{workflow.parameters.env_config}}&quot;
      - name: flow_config
        value: &quot;{{workflow.parameters.flow_config}}&quot;
      - name: flow_type_config
        value: &quot;{{workflow.parameters.flow_type_config}}&quot;
</code></pre>
<p>would love to get your input, even if it's pointing me at the direction of the right doc to read, as i haven't found anything close to it yet.</p>
<p>Thanks!</p>

<p>just realised i haven't updated, so for anyone interested, what i ended up doing is setting an anchor inside a container template:</p>
<pre><code>templates:
#this template is here to define what env parameters each container has using an anchor.
  - name: env-template
    container:
      env: &amp;env_parameters
      - name: env_config
        value: &quot;{{workflow.parameters.env_config}}&quot;
      - name: flow_config
        value: &quot;{{workflow.parameters.flow_config}}&quot;
      - name: run_config
        value: &quot;{{workflow.parameters.run_config}}&quot;
</code></pre>
<p>and than using that anchor in each container.</p>
<pre><code>    container:
      image: image
      imagePullPolicy: Always
      env: *env_parameters
</code></pre>
