<p>If desperate, one can consider Argo Workflows as a programming language implemented in YAML and using Kubernetes as a back-end.</p>
<ul>
<li>A procedure can be defined using <code>steps:</code></li>
<li>Functions are Templates with arguments coming in two flavours:
<ul>
<li>Parameters, which are strings</li>
<li>Artifacts, which are files shared by some tool, such as S3 or NFS</li>
</ul>
</li>
<li>There is flow control
<ul>
<li>Conditionals are implemented by <code>when:</code></li>
<li>Iterators are implemented by <code>withSequence:</code> and <code>withItems:</code></li>
<li>Recursion is possible by Templates calling themselves</li>
</ul>
</li>
</ul>
<p>The templates map somewhat directly onto Kubernetes YAML specs. Parameters appear to be shared via annotations and artifacts are shared via native Kubernetes functionality.</p>
<p>How is the flow-control implemented? What features of Kubernetes does Argo use to accomplish this? Does it have something to do with the Kubernetes Control Plane?</p>

Seanny123
<p>Argo Workflows is implemented with custom <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/" rel="nofollow noreferrer">Kubernetes Custom Resources</a>, e.g. its own yaml manifest types. For every <em>custom resource</em> there is an associated custom pod that acts as a <a href="https://kubernetes.io/docs/concepts/architecture/controller/" rel="nofollow noreferrer">Kubernetes Controller</a> with the logic.</p>
<p>The custom controller may create other resources or Pods, and watch the result of their execution status in the status-fields and then implement its workflow logics accordingly, e.g. watch results and follow the declared <code>when:</code> expressions depending on the results.</p>
<p><em>I have more experience using <a href="https://github.com/tektoncd/pipeline" rel="nofollow noreferrer">Tekton Pipelines</a> but it works the same way as Argo Workflows. If you are interested in implementing similar things, I recommend to start with <a href="https://github.com/kubernetes-sigs/kubebuilder" rel="nofollow noreferrer">Kubebuilder</a> and read <a href="https://book.kubebuilder.io/" rel="nofollow noreferrer">The Kubebuilder book</a>.</em></p>
