🚀 New! Kestra raises $3 million to grow Learn more

json Convert an object to json

Convert an object to is JSON representation

handlebars
{{json output['task-id']}}

Example, if the current context is:

json
{
  "outputs": {
    "task1": {
      "value": 1,
      "text": "awesome1"
    },
    "task2": {
      "value": 2,
      "text": "awesome2"
    }
  }
}

the output of {{ json outputs.task2}} will be {"value":2,"text":"awesome2"}.

jq Transform vars with JQ

Apply the JQ expression to a variables.

handlebars
{{jq vars jqExpr [first=false]}}

first mean to always fetch the first element, by default jq return an array of results

Example, if the current context is:

json
{
  "outputs": {
    "task1": {
      "value": 1,
      "text": "awesome1"
    },
    "task2": {
      "value": 2,
      "text": "awesome2"
    }
  }
}
handlebars
{{jq outputs .task1.value true}}

the output will be 1.