自定义执行数据(Custom executions data)#
你可以使用代码节点或执行数据节点在你的工作流上设置自定义数据。n8n 会在每次执行时记录这些数据。然后,你可以在筛选执行列表时使用这些数据,或者在工作流中使用代码节点获取这些数据。
🌐 You can set custom data on your workflow using the Code node or the Execution Data node. n8n records this with each execution. You can then use this data when filtering the executions list, or fetch it in your workflows using the Code node.
Feature availability
Custom executions data is available on:
- Cloud: Pro, Enterprise
- Self-Hosted: Enterprise, registered Community
使用代码节点设置和访问自定义数据(Set and access custom data using the Code node)#
本节说明如何使用代码节点设置和访问数据。有关使用执行数据节点设置数据的信息,请参阅执行数据节点。你无法使用执行数据节点检索自定义数据。
🌐 This section describes how to set and access data using the Code node. Refer to Execution Data node for information on using the Execution Data node to set data. You can't retrieve custom data using the Execution Data node.
设置自定义执行数据(Set custom executions data)#
设置一条额外数据:
🌐 Set a single piece of extra data:
=== “JavaScript”
1 2 3 | |
1 | |
设置所有额外数据。这将覆盖此执行的整个自定义数据对象:
🌐 Set all extra data. This overwrites the whole custom data object for this execution:
=== “JavaScript”
1 2 3 | |
1 | |
存在一些限制:
🌐 There are limitations:
- 它们必须是字符串
key的最大长度为 50 个字符value的最大长度为 255 个字符- n8n 最多支持 10 项自定义数据。
执行期间访问自定义数据对象(Access the custom data object during execution)#
你可以在执行期间检索自定义数据对象或其中的特定值:
🌐 You can retrieve the custom data object, or a specific value in it, during an execution:
1 2 3 4 5 | |
1 2 3 4 5 | |