> For the complete documentation index, see [llms.txt](https://docs.baas.sh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.baas.sh/baas-console/automations/reference.md).

# Reference

The data a run exposes to your actions, including the trigger's payload, the run context, and the plugins object for Function code.

Every run carries data your actions can read, through `{{...}}` templates in action fields or directly in [Function](/baas-console/automations/actions/function.md) code. The guides cover the essentials; this section goes value by value: what each one holds, how it is encoded, and the limits that apply.

## Templates and code

Templates read `trigger.*` and `context.*` in any action field that accepts `{{...}}`; the **Insert a variable** panel lists them as you edit ([Dynamic values](/baas-console/automations/actions.md#dynamic-values) introduces it). Function code receives the same data as arguments, `trigger` and `context`, plus one that exists only there: `plugins`, the [plugin calls your code can make](/baas-console/automations/reference/plugins.md).

## How templates render

A `{{...}}` hole holds exactly one data path, such as `{{trigger.body.object}}`. Helpers, literals and logic are not supported. Write constants as plain text or JSON around the holes.

A hole has no value when the path is absent from the run data, or lands on `null`. The two cases behave the same way, and both fail the run. To allow a missing value, add a trailing `?`:

```
Hello {{trigger.body.firstName?}}
```

An optional hole renders empty text, or `null` in a JSON body. Where it may render empty depends on the field:

| Field                                                                          | Can `?` render it empty?                                                                              |
| ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| Query parameter, email line, subject                                           | Yes                                                                                                   |
| Recipient or sender address, URL, header value, contract address, native value | No — a template made only of optional holes is refused when you save, and a blank value fails the run |
| A transaction's arguments                                                      | No — an argument always needs a value                                                                 |

A path is written with dots, and an array index as `.[0]`: `{{trigger.event.args.recipients.[0]}}`. Writing `recipients[0]` is refused when you save.

In a text field, such as a URL, a subject, or an email body: a text, number or boolean value is inserted unchanged, and an object or array is inserted as JSON.

{% hint style="warning" %}
**Values are inserted as-is, HTML included.** A text field does not escape what a hole renders.
{% endhint %}

A JSON body ([API](/baas-console/automations/actions/api.md)) and a [transaction's](/baas-console/automations/actions/transaction.md) arguments render as JSON: the hole stands as a whole value, serialized with quotes escaped and objects intact. For example, a JSON body can include an event's arguments as a JSON object:

```
{"args": {{trigger.event.args}}}
```

## Next

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Trigger object</strong></td><td>The webhook body, the cron planned time, and the monitor event envelope.</td><td><a href="/baas-console/automations/reference/trigger.md">Trigger object</a></td></tr><tr><td><strong>Context object</strong></td><td>The previous result, the run's identifiers, and the time budget.</td><td><a href="/baas-console/automations/reference/context.md">Context object</a></td></tr><tr><td><strong>Plugins object</strong></td><td>Four awaitable calls, their gating, errors, and quotas.</td><td><a href="/baas-console/automations/reference/plugins.md">Plugins object</a></td></tr></tbody></table>
