Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Serverless Integrations
    • Overview
      • Workflow
      • Starting workflow
      • Templating
    • Quotas and limits
  • Pricing policy
  • Terraform reference
  • Release notes

In this article:

  • Input data for the templater
  • Templater usage examples
  • Templater extensions
  • $global variable
  • $counter variable
  • Yandex Lockbox
  1. Concepts
  2. Workflows
  3. Templating

Templating

Written by
Yandex Cloud
Updated at April 24, 2025
  • Input data for the templater
    • Templater usage examples
  • Templater extensions
    • $global variable
    • $counter variable
    • Yandex Lockbox

For the YaWL specification fields that support templating, values can be generated dynamically using the data obtained from the workflow state. The templating language is jq. For more information, see the jq documentation.

By default, templating is not used for string values of fields; use string interpolation instead.

Input data for the templaterInput data for the templater

The templater input data will be different depending on the field.

Field Payload
input Workflow state before starting the step. For example, if the step is a high-level one, it retains the full workflow state. In contrast, if it is inside a Parallel execution branch, the workflow state is filtered using the input parameter of the Parallel step and updated by prior steps in the branch.
output Step output data
Other fields that do not support templating JSON object filtered by input

Templater usage examplesTemplater usage examples

Full workflow state example:

{
  "data": [
    {
      "some_property_0": "value_0"
    },
    {
      "some_property_1": "value_1"
    }
  ],
  "a": {
    "b": {
      "c": "value_2"
    }
  }
}
Field value Templater interpretation
this is just a string Non-templated string
this is a value from workflow state \(.data[1].some_property_1) this is a value from workflow state value_1
\({x: 1, y: .a.b.c}) {“x”: 1, “y”: “value_2”}

Templater extensionsTemplater extensions

Templater extensions allow you to call jq functions implementing non-standard logic.

$global variable$global variable

The $global variable returns the top-level state of the workflow before starting the current top-level step. For example, in the Foreach step, input data filtering is a required attribute, and the $global variable can be used within the sequence of steps in do to retrieve the workflow state as it was before Foreach started (top-level state).

$counter variable$counter variable

The $counter variable returns the current operation index (indexing starts from zero). You can use the variable inside the input and condition fields of the While step.

Yandex LockboxYandex Lockbox

A special lockboxPayload jq function allows you to get the value of the Yandex Lockbox secret by its ID, key and (optionally) version. For the extension to work correctly, the workflow settings must specify a service account that has permissions to view the secret contents, e.g., the one with the lockbox.payloadViewer role.

Description of the lockboxPayload jq function arguments:

Argument order Type Required Description
1 string Yes Secret ID.
2 string Yes Secret key.
3 string No Secret version ID.

Examples of using the jq functionExamples of using the lockboxPayloadjq function

  • Getting the latest secret version:

    \(lockboxPayload("<secret_ID>"; "<secret_key>"))
    
  • Getting the specified secret version:

    \(lockboxPayload("<secret_ID>"; "<secret_key>"; "<secret_version_ID>"))
    

Was the article helpful?

Previous
While
Next
Bus
© 2025 Direct Cursus Technology L.L.C.