<p>I have written a argo dag to trigger spark job in recursion until the condition satisfies. I have a counter parameter which needs to be incremented by 1 after every successful completion of spark job. But this isnt happening. Here is the snippet of my workflow.</p>
<pre><code>  templates:
    - name: test-dag
      dag:
        tasks:
        - name: test-spark-job
          template: test-spark-job
        - name: loop-it
          template: backfill-dag
          dependencies: [backfill-spark-job]
          when: &quot;{{=asInt(workflow.parameters.counter)}} &lt;= {{=asInt(workflow.parameters.batchsize)}}&quot;
          arguments:
            parameters:
              - name: counter
                value: {{=asInt(workflow.parameters.counter)}}+1
</code></pre>

Sujeeth Shetty
<p>It <code>+1</code> should be part of the expression. Try:</p>
<pre><code>arguments:
  parameters:
    - name: value
      value: &quot;{{=asInt(workflow.parameters.counter) + 1}}&quot;
</code></pre>
