title: Reuse templates/steps in different argo workflows
body: <p>Assume having two different argo workflows using the same template <code>whalesay</code>:</p>
  <pre class="lang-yaml prettyprint-override"><code>apiVersion: argoproj.io/v1alpha1
  kind: Workflow
  metadata:
    name: workflow1
  spec:
    # invoke the whalesay template with
    # &quot;hello world&quot; as the argument
    # to the message parameter
    entrypoint: whalesay
    arguments:
      parameters:
      - name: message
        value: hello world
  
    templates:
    - name: whalesay
      inputs:
        parameters:
        - name: message       
      container:
        # run cowsay with that message input parameter as args
        image: docker/whalesay
        command: [cowsay]
        args: [&quot;{{inputs.parameters.message}}&quot;]
  </code></pre>
  <pre class="lang-yaml prettyprint-override"><code>apiVersion: argoproj.io/v1alpha1
  kind: Workflow
  metadata:
    name: workflow2
  spec:
    entrypoint: hello-hello-hello
  
    templates:
    - name: hello-hello-hello
      # Instead of just running a container
      # This template has a sequence of steps
      steps:
      - - name: hello1            
          template: whalesay
          arguments:
            parameters:
            - name: message
              value: &quot;hello1&quot;
      - - name: hello2a           
          template: whalesay
          arguments:
            parameters:
            - name: message
              value: &quot;hello2a&quot;
  
    - name: whalesay
      inputs:
        parameters:
        - name: message
      container:
        image: docker/whalesay
        command: [cowsay]
        args: [&quot;{{inputs.parameters.message}}&quot;]
  
  </code></pre>
  <p>Is there a way to avoid repeating (and maintaining) the same template in the two different workflows? Maybe something similar to WorklowTemplate, like:</p>
  <pre class="lang-yaml prettyprint-override"><code>apiVersion: ...
  kind: TemplateTemplate
  name: whalesay
  inputs:
     parameters:
     - name: message
  container:
     image: docker/whalesay
     command: [cowsay]
     args: [&quot;{{inputs.parameters.message}}&quot;]
  </code></pre>
  <pre class="lang-yaml prettyprint-override"><code>
  apiVersion: argoproj.io/v1alpha1
  kind: Workflow
  metadata:
    name: workflow1
  metadata:
    name:
  spec:
    entrypoint: whalesay
    arguments:
      parameters:
      - name: message
        value: hello world
    templates:
    - templateRef: whalesay
  </code></pre>
  <pre class="lang-yaml prettyprint-override"><code>apiVersion: argoproj.io/v1alpha1
  kind: Workflow
  metadata:
    name: workflow2
  spec:
    entrypoint: hello-hello-hello
  
    templates:
    - name: hello-hello-hello
      # Instead of just running a container
      # This template has a sequence of steps
      steps:
      - - name: hello1            
          templateRef: whalesay
          arguments:
            parameters:
            - name: message
              value: &quot;hello1&quot;
      - - name: hello2a           
          templateRef: whalesay
          arguments:
            parameters:
            - name: message
              value: &quot;hello2a&quot;
  </code></pre>