<p>I have an Argo workflow with dynamic fan-out tasks that do some map operation (in a Map-Reduce meaning context). I want to create a reducer that aggregates their results. It's possible to do that when the outputs of each mapper are small and can be put as an output parameter. See <a href="https://stackoverflow.com/questions/60569353/dynamic-fan-in-in-argo-workflows">this SO question-answer</a> for the description of how to do it.</p>
<p>But how to aggregate output <strong>artifacts</strong> with Argo without writing custom logic of writing them to some storage in each mapper and read from it in reducer?</p>

<p>Artifacts are more difficult to aggregate than parameters.</p>
<p>Parameters are always text and are generally small. This makes it easy for Argo Workflows to aggregate them into a single JSON object which can then be consumed by a &quot;reduce&quot; step.</p>
<p>Artifacts, on the other hand, may be any type or size. So Argo Workflows is limited in how much it can help with aggregation.</p>
<p>The main relevant feature it provides is declarative repository write/read operations. You can specify, for example, an S3 prefix to write each parameter to. Then, in the reduce step, you can load everything from that prefix and perform your aggregation logic.</p>
<p>Argo Workflows provides a <a href="https://github.com/argoproj/argo-workflows/blob/master/examples/map-reduce.yaml" rel="nofollow noreferrer">generic map/reduce example</a>. But besides artifact writing/reading, you pretty much have to do the aggregation logic yourself.</p>
