<p>I'm trying out Argo workflow and would like to understand how to freeze a step. Let's say that I have 3 step workflow and a workflow failed at step 2. So I'd like to resubmit the workflow from step 2 using successful step 1's artifact. How can I achieve this? I couldn't find the guidance anywhere on the document. </p>

user3368526
<p>I think you should consider using <a href="https://argoproj.github.io/docs/argo/examples/README.html#conditionals" rel="nofollow noreferrer">Conditions</a> and <a href="https://github.com/argoproj/argo-workflows/blob/master/examples/artifact-passing.yaml" rel="nofollow noreferrer">Artifact passing</a> in your steps.</p>
<blockquote>
<p>Conditionals provide a way to affect the control flow of a
workflow at runtime, depending on parameters. In this example
the 'print-hello' template may or may not be executed depending
on the input parameter, 'should-print'. When submitted with</p>
</blockquote>
<blockquote>
<p><code>$ argo submit examples/conditionals.yaml</code></p>
</blockquote>
<blockquote>
<p>the step will be skipped since 'should-print' will evaluate false.
When submitted with:</p>
</blockquote>
<blockquote>
<p><code>$ argo submit examples/conditionals.yaml -p should-print=true</code></p>
</blockquote>
<blockquote>
<p>the step will be executed since 'should-print' will evaluate true.</p>
</blockquote>
<pre><code>apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: conditional-
spec:
  entrypoint: conditional-example
  arguments:
    parameters:
    - name: should-print
      value: &quot;false&quot;

  templates:
  - name: conditional-example
    inputs:
      parameters:
      - name: should-print
    steps:
    - - name: print-hello
        template: whalesay
        when: &quot;{{inputs.parameters.should-print}} == true&quot;

  - name: whalesay
    container:
      image: docker/whalesay:latest
      command: [sh, -c]
      args: [&quot;cowsay hello&quot;]
</code></pre>
<p>If you use conditions in each step you will be able to start from a step you like with appropriate condition.</p>
<p>Also have a loot at this article <a href="https://itnext.io/argo-workflow-engine-for-kubernetes-7ae81eda1cc5" rel="nofollow noreferrer">Argo: Workflow Engine for Kubernetes</a> as author explains the use of conditions on <a href="https://raw.githubusercontent.com/argoproj/argo-workflows/master/examples/coinflip.yaml" rel="nofollow noreferrer">coinflip example</a>.
You can see many examples on their <a href="https://github.com/argoproj/argo-workflows/tree/master/examples" rel="nofollow noreferrer">GitHub page</a>.</p>
