title: Dynamic "Fan In" in Argo Workflows
body: <p>Argo permits the dynamic generation of parallel workflow steps based on outputs from previous steps.</p>
  <p>An example of this dynamic workflow generation is provided here: <a href="https://github.com/argoproj/argo-workflows/blob/master/examples/loops-param-result.yaml" rel="nofollow noreferrer">https://github.com/argoproj/argo-workflows/blob/master/examples/loops-param-result.yaml</a></p>
  <p>I'm trying to create a similar workflow with a final 'fan-in' step that will read outputs from the dynamically created parallel steps. Here's a stab at it:</p>
  <pre><code>apiVersion: argoproj.io/v1alpha1
  kind: Workflow
  metadata:
    generateName: loops-param-result-
  spec:
    entrypoint: loop-param-result-example
    templates:
    - name: loop-param-result-example
      steps:
      - - name: generate
          template: gen-number-list
      - - name: write
          template: output-number
          arguments:
            parameters:
            - name: number
              value: &quot;{{item}}&quot;
          withParam: &quot;{{steps.generate.outputs.result}}&quot;
      - - name: fan-in
          template: fan-in
          arguments:
            parameters:
            - name: numbers
              value: &quot;{{steps.write.outputs.parameters.number}}&quot;
  
    - name: gen-number-list
      script:
        image: python:alpine3.6
        command: [python]
        source: |
          import json
          import sys
          json.dump([i for i in range(20, 31)], sys.stdout)
  
    - name: output-number
      inputs:
        parameters:
        - name: number
      container:
        image: alpine:latest
        command: [sh, -c]
        args: [&quot;echo {{inputs.parameters.number}} &gt; /tmp/number.txt&quot;]
      outputs:
        parameters:
          - name: number
            valueFrom:
              path: /tmp/number.txt
  
    - name: fan-in
      inputs:
        parameters:
          - name: numbers
      container:
        image: alpine:latest
        command: [sh, -c]
        args: [&quot;echo received {{inputs.parameters.numbers}}&quot;]
  </code></pre>
  <p>I'm able to submit this workflow, and it runs successfully. Unfortunately, the output of the final <code>fan-in</code> step looks like this:</p>
  <pre><code>fan-in: received {{steps.write.outputs.parameters.number}}
  </code></pre>
  <p>The value for the input <code>numbers</code> parameter is not being interpolated. Any ideas about how to get this working?</p>