n8n 中文文档

自定义数据

$execution.customData.get() 获取()

Description: 返回存储在指定键下的自定义执行数据。更多信息

Syntax: 语法: $execution.customData.get(key)

Returns: 返回: 字符串

Source: 来源: 自定义 n8n 功能

Parameters: 参数:

  • key (String) - 存储数据的键(标识符)

Examples: 示例:

javascript // Get the user's email (which was previously stored) $execution.customData.get("user_email") //=> "[email protected]"

$execution.customData.getAll() 获取全部()

Description: 返回当前执行中已设置的所有自定义数据键值对。更多信息

Syntax: 语法: $execution.customData.getAll()

Returns: 返回: 对象

Source: 来源: 自定义 n8n 功能

Examples: 示例:

javascript $execution.customData.getAll() //=> {"user_email": "[email protected]", "id": 1234}

$execution.customData.set() 设置()

Description: 将自定义执行数据存储在指定的键下。使用此方法可以方便地按数据筛选执行记录。更多信息

Syntax: 语法: $execution.customData.set(键,值)

Source: 来源: 自定义 n8n 功能

Parameters: 参数:

  • key (String) - 存储数据的键(标识符)
  • value (String) - 要存储的数据

Examples: 示例:

javascript // Store the user's email, to easily retrieve all execs related to that user later $execution.customData.set("user_email", "[email protected]")

$execution.customData.setAll()

Description: 为执行设置多个自定义数据键值对。使用此方法可以方便地按数据筛选执行记录。更多信息

Syntax: 语法: $execution.customData.setAll(obj)

Source: 来源: 自定义 n8n 功能

Parameters: 参数:

  • obj (Object) - 包含要设置的数据键值对的 JavaScript 对象

Examples: 示例:

javascript $execution.customData.setAll({"user_email": "[email protected]", "id": 1234})

相关资源

不想自己部署和维护 n8n?n8ncn 托管 n8n 云服务:开通账号即可使用,不用买服务器;也可以在 n8ncn 工作流库 找现成的中文工作流。