Skip to content

Is jinja template syntax still supported? #6295

Answered by nzlosh
fjpalacios-ust asked this question in Q&A
Discussion options

You must be logged in to vote

With items only allows for a result list to be produced by the action/workflow. The jinja block you showed as an example is not supported by stackstorm and is not how a workflow is parsed and evaluated so it won't work. Jinja blocks {% %} aren't supported either, only jinja statements {{ }}.

A workaround would be to write your own loop logic into multiple actions. The pseudo code:

var_list=[1,2,3]
var_iter = 0

step1_iter:
  action: core.noop
  next:
    - do: step1
      when: <% var_iter < len(var_list) %>
    - do: step2
      when: <% var_iter >= len(var_list) %>

step1:
   action: core.local
   input:
     cmd: echo <% var_list[var_iter] %>
   next:
    - do: step1_iter
      publish…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@fjpalacios-ust
Comment options

@nzlosh
Comment options

Answer selected by fjpalacios-ust
@fjpalacios-ust
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants