Resource globals

Values available to use in resources
Airplane supports JS templates for specifying various values in a resource. These fields are also marked by a {} symbol in the UI. These templates will be evaluated at runtime.

Globals reference

Here's a full list of the global variables that you can use in a resource template:
NameDescription
{{run.id}}The id of the task run that is using the resource.
{{run.url}}A URL to the task run page in the Airplane UI.
{{run.runner.id}}The id of the user who started the run.
{{run.runner.email}}The email of the user who started the run.
{{run.runner.name}}The name of the user who started the run.
{{run.requester.id}}The id of the user who requested the run.
{{run.requester.email}}The email of the user who requested the run.
{{run.requester.name}}The name of the user who requested the run.
{{task.id}}The id of the task.
{{task.revisionID}}The id of the task revision (i.e., version).
{{task.url}}A URL to the task page in the Airplane UI.
{{authn.idToken("...")}}A function that creates an OIDC token with the provided audience.
Note that not all globals are applicable in all cases; the run.requester values, for instance, won't be set if there was no run request. Certain values such as the task.id are not available in the "Test resource" run but will be available at runtime when a task uses the resource.