Templating
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
Input data for the templater
The templater input data will be different depending on the field.
Field | Payload |
---|---|
input |
Overall state of the workflow |
output |
Step output data |
Other fields that do not support templating | JSON object filtered by input |
Templater usage examples
Field value | Templater interpretation |
---|---|
this is just a string |
Non-templated string |
this is a value from workflow state \(.data[1].some_property) |
this is a value from workflow state <workflow_state_data> |
\({x: 1, y: .a.b.c}) |
{“x”: 1, “y”: “<workflow_state_data>”} |
Templater extensions
Templater extensions allow you to call jq functions implementing non-standard logic.
Yandex 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. |
lockboxPayload
jq function
Examples of using the -
Getting the latest secret version:
\(lockboxPayload("<secret_ID>"; "<secret_key>"))
-
Getting the specified secret version:
\(lockboxPayload("<secret_ID>"; "<secret_key>"; "<secret_version_ID>"))