#1351: What is the event-based or scheduled automation context?

Отредактирована: 102 дня назад

In event-based actions (triggers) and scheduled actions, you can expand the default context.

The context is the data and variables that are available to an automatic action (macro, outbound email, outbound webhook, or script) at the runtime.

The structure of the context

The context is a key-value storage that can hold any values serializable to JSON.
By default, an event trigger passes the event object that triggered this trigger in the event key.
If an action is initiated by a user, for example, through a web form, then the parameters of the web form and their values are also added to the context in the form of "variable": "value".
If necessary, you can add variables to the context to use them by default in the key-value format in JSON format:

{
  "my_custom_variable": {
    "foo": "bar"
  }
}

And then refer to these values in automation templates, for example, in a webhook or email:

<p>Hello, {{ my_custom_variable.foo }}</p>