数据绑定(Data pinning)#
在工作流开发过程中,你可以“固定”数据。数据固定意味着保存某个节点的输出数据,并在将来的工作流执行中使用已保存的数据,而不是获取新的数据。
🌐 You can 'pin' data during workflow development. Data pinning means saving the output data of a node, and using the saved data instead of fetching fresh data in future workflow executions.
当处理来自外部来源的数据时,您可以使用此方法,以避免重复向外部系统发送请求。这可以节省时间和资源:
🌐 You can use this when working with data from external sources to avoid having to repeat requests to the external system. This can save time and resources:
- 如果你的工作流依赖外部系统(例如 Webhook 调用)来触发,则能够固定数据意味着你无需在每次测试工作流时都使用该外部系统。
- 如果外部资源有数据或使用量限制,在测试期间锁定数据可以避免占用你的资源限制。
- 你可以获取并锁定要测试的数据,从而确保所有工作流测试中的数据一致。
您只能为具有单个主要输出的节点固定数据(“错误”输出不计入此目的)。
🌐 You can only pin data for nodes that have a single main output ("error" outputs don't count for this purpose).
仅用于开发
数据固定功能在生产工作流执行中不可用。它是一个用于在开发过程中测试工作流的功能。
Pin 数据(Pin data)#
To pin data in a node:
- Run the node to load data.
- In the OUTPUT view, select Pin data
. When data pinning is active, the button is disabled and a "This data is pinned" banner is displayed in the OUTPUT view.
Nodes that output binary data
You can't pin data if the output data includes binary data.
取消置顶数据(Unpin data)#
当数据固定功能处于激活状态时,节点输出面板顶部会出现一个横幅,提示 n8n 已固定数据。要取消数据固定并在下一次执行时获取最新数据,请在横幅中选择 取消固定 链接。
🌐 When data pinning is active, a banner appears at the top of the node's output panel indicating that n8n has pinned the data. To unpin data and fetch fresh data on the next execution, select the Unpin link in the banner.