<p>I've one workflow in which I'm using <code>jsonpath</code> function for a output parameter to extract a specific value from json string, but it is failing with this error <code>Error (exit code 255)</code></p>
<p>Here is my workflow</p>
<pre><code>apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: wf-dev-
spec:
  entrypoint: main
  templates:
    - name: main

      dag:
        tasks:
          - name: dev-create
            templateRef:
              name: dev-create-wft
              template: main
            arguments:
              parameters:
                - name: param1
                  value: &quot;val1&quot;

          - name: dev-outputs
            depends: dev-create.Succeeded
            templateRef:
              name: dev-outputs-wft
              template: main
            arguments:
              parameters:
                - name: devoutputs
                  value: &quot;{{=jsonpath(tasks.dev-create.outputs.parameters.devoutputs, '$.alias.value')}}&quot;
</code></pre>
<p>In the above workflow task <code>dev-create</code> invokes another workflowTemplate <code>dev-create-wft</code> which returns the output of another workflowTemplate</p>
<p>Here is my workflowTemplate</p>
<pre><code>apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: dev-create-wft

spec:
  entrypoint: main
  templates:
    - name: main
      outputs:
        parameters:
          - name: devoutputs
            valueFrom:
               expression: &quot;tasks['dev1'].outputs.parameters.devoutputs&quot;
      inputs:
        parameters:
          - name: param1
      dag:
        tasks:
          - name: dev1
            templateRef:
              name: fnl-dev
              template: main
            arguments:
              parameters:
                - name: param1
                  value: &quot;{{inputs.parameters.param1}}&quot;
</code></pre>
<p>The returned json output looks like this</p>
<pre><code>{
    &quot;alias&quot;: {
        &quot;value&quot;: &quot;testing:dev1infra&quot;,
        &quot;type&quot;: &quot;string&quot;,
        &quot;sensitive&quot;: false
    },
    &quot;match&quot;: {
        &quot;value&quot;: &quot;dev1infra-testing&quot;,
        &quot;type&quot;: &quot;string&quot;,
        &quot;sensitive&quot;: false
    }
}
</code></pre>
<p>Does <code>jsonpath</code> function supported in workflow? The reason why am asking is, it's working when I used the same function in another workflowTemplate <code>dev-outputs-wft</code></p>
<p>What could be the issue?</p>

<p>When an expression fails to evaluate, Argo Workflows simply does not substitute the expression with its evaluated value. Argo Workflows passes the expression <em>as if it were the parameter</em>.</p>
<p><code>{{=}}</code> &quot;expression tag templates&quot; in Argo Workflows must be written according to the <a href="https://github.com/antonmedv/expr/blob/master/docs/Language-Definition.md" rel="noreferrer">expr language spec</a>.</p>
<p>In simple tag templates, Argo Workflows itself does the interpreting. So hyphens in parameter names are allowed. For example, <code>value: &quot;{{inputs.parameters.what-it-is}}&quot;</code> is evaluated by Argo Workflows to be <code>value: &quot;over 9000!&quot;</code>.</p>
<p>But in expression tag templates, expr interprets hyphens as minus operators. So <code>value: &quot;{{=inputs.parameters.what-it-is}}&quot;</code> looks like a really weird mathematical expression, fails, and isn't substituted. The workaround is to use <code>['what-it-is']</code> to access the appropriate map item.</p>
<p>My guess is that your expression is failing, Argo Workflows is passing the expression to <code>dev-outputs-wft</code> un-replaced, and whatever shell script is receiving that parameter is breaking.</p>
<p>If I'm right, the fix is easy:</p>
<pre><code>           - name: dev-outputs
             depends: dev-create.Succeeded
             templateRef:
               name: dev-outputs-wft
               template: main
             arguments:
               parameters:
                 - name: devoutputs
-                   value: &quot;{{=jsonpath(tasks.dev-create.outputs.parameters.devoutputs, '$.alias.value')}}&quot;
+                   value: &quot;{{=jsonpath(tasks['dev-create'].outputs.parameters.devoutputs, '$.alias.value')}}&quot;
</code></pre>
