Skip to content

vars#

Feature availability

  • Available on Self-hosted Enterprise and Pro and Enterprise Cloud plans.
  • You need access to the n8n instance owner account to create variables.

vars 包含当前环境的所有 变量。它是只读的:你可以使用 vars 访问变量,但必须通过 UI 设置它们。

=== “JavaScript”

1
2
3
4
```js
// Access a variable
$vars.<variable-name>
```
1
2
# Access a variable
_vars.<variable-name>

varsenv

vars 提供对用户创建变量的访问。这是 Environments 功能的一部分。env 提供对你的 n8n 实例的 配置环境变量 的访问。