手动、部分和生产环境执行#
¥Manual, partial, and production executions
n8n 手动执行工作流(点击“执行工作流”按钮)和自动执行工作流(工作流处于活动状态并由事件或计划触发)的方式存在一些重要区别。
¥There are some important differences in how n8n executes workflows manually (by clicking the Execute Workflow button) and automatically (when the workflow is Active and triggered by an event or schedule).
手动执行#
¥Manual executions
手动执行允许你直接从 canvas 运行工作流,以测试你的工作流逻辑。这些执行是 "ad-hoc":它们仅在你手动选择“执行工作流”按钮时运行。
¥Manual executions allow you to run workflows directly from the canvas to test your workflow logic. These executions are "ad-hoc": they run only when you manually select the Execute workflow button.
手动执行使你能够边执行边迭代测试,跟踪流程逻辑并查看数据转换,从而简化工作流的构建。你可以通过提供不同的输入项和修改节点选项来测试条件分支、数据格式更改和循环行为。
¥Manual executions make building workflows easier by allowing you to iteratively test as you go, following the flow logic and seeing data transformations. You can test conditional branching, data formatting changes, and loop behavior by providing different input items and modifying node options.
Pinning execution data
手动执行操作时,你可以使用 数据固定 来获取节点的输出数据,例如 "pin" 或 "freeze"。你还可以选择使用 编辑已固定数据。
¥When performing manual executions, you can use data pinning to "pin" or "freeze" the output data of a node. You can optionally edit the pinned data as well.
在后续运行中,n8n 不会执行已固定的节点,而是会替换已固定的数据并继续执行流程逻辑。此功能允许你在不操作可变数据或重复查询外部服务的情况下进行迭代。生产执行会忽略所有已固定的数据。
¥On future runs, instead of executing the pinned node, n8n will substitute the pinned data and continue following the flow logic. This allows you to iterate without operating on variable data or repeating queries to external services. Production executions ignore all pinned data.
部分执行#
¥Partial executions
在“编辑器”选项卡中,单击工作流底部的“执行工作流”按钮,即可手动运行整个工作流。你还可以执行部分执行,以运行工作流中的特定步骤。部分执行是指仅运行部分工作流节点的手动执行。
¥Clicking the Execute workflow button at the bottom of the workflow in the Editor tab manually runs the entire workflow. You can also perform partial executions to run specific steps in your workflow. Partial executions are manual executions that only run a subset of your workflow nodes.
要执行部分执行,请选择一个节点,打开其详细信息视图,然后选择“执行步骤”。此操作会执行特定节点以及填充其输入数据所需的任何前置节点。你还可以暂时禁用工作流链中的特定节点,以避免在构建过程中与这些服务交互。
¥To perform a partial execution, select a node, open its detail view, and select Execute step. This executes the specific node and any preceding nodes required to fill in its input data. You can also temporarily disable specific nodes in the workflow chain to avoid interacting with those services while building.
尤其是在更新特定节点的逻辑时,部分执行非常有用,因为它允许你使用相同的输入数据重新执行该节点。
¥In particular, partial executions are useful when updating the logic of a specific node since they allow you to re-execute the node with the same input data.
部分执行故障排除#
¥Troubleshooting partial executions
运行部分执行时可能会遇到的一些常见问题包括:
¥Some common issues you might come across when running partial executions include the following:
目标节点未连接到任何触发器。部分执行需要触发器。
¥The destination node is not connected to any trigger. Partial executions need a trigger.
当你尝试在未将工作流连接到触发器的情况下执行部分操作时,会出现此错误消息。手动执行(包括部分执行)会尽可能地模拟生产环境中的执行。这包括需要一个触发节点来描述工作流逻辑的执行时机。
¥This error message appears when you try to perform a partial execution without connecting the workflow to a trigger. Manual executions, including partial executions, attempt to mimic production executions when possible. Part of this includes requiring a trigger node to describe when the workflow logic should execute.
要解决此问题,请将触发节点连接到包含你要执行的节点的工作流。通常情况下,手动触发 是最简单的选择。
¥To work around this, connect a trigger node to the workflow with the node you're trying to execute. Most often, a manual trigger is the simplest option.
请执行整个工作流,而不仅仅是节点。(现有执行数据过大。)
¥Please execute the whole workflow, rather than just the node. (Existing execution data is too large.)
在对具有大量分支的工作流执行部分执行时,可能会出现此错误。部分执行涉及以完整执行不需要的方式将数据和工作流逻辑发送到 n8n 后端。当你的工作流超过这些消息允许的最大大小时,会发生此错误。
¥This error can appear when performing partial executions on workflows with large numbers of branches. Partial executions involve sending data and workflow logic to the n8n backend in a way that isn't required for full executions. This error occurs when your workflow exceeds the maximum size allowed for these messages.
要解决此问题,请考虑在运行部分执行时使用 限制节点 来限制节点输出。工作流按预期运行后,你可以在启用生产环境执行之前禁用或删除限制节点。
¥To work around this, consider using the limit node to limit node output while running partial executions. Once the workflow is running as intended, you can disable or delete the limit node before enabling production execution.
生产执行#
¥Production executions
当触发事件或计划自动运行工作流时,就会发生生产执行。
¥Production executions occur when a triggering event or schedule automatically runs a workflow.
要配置生产环境执行,你必须附加一个 触发节点(除 手动触发 之外的任何触发器均可),并将工作流的切换开关切换到“活动”状态。激活后,工作流会在触发条件出现时自动执行。
¥To configure production executions, you must attach a trigger node (any trigger other than the manual trigger works) and switch workflow's toggle to Active. Once activated, the workflow automatically executes whenever the trigger condition occurs.
生产环境执行的流程不会像手动执行那样显示在工作流的“编辑器”选项卡中。你可以根据 工作流设置 在工作流的“执行”选项卡中查看执行情况。从这里,你可以使用 编辑器调试功能 来探索和排查问题。
¥The execution flow for production executions doesn't display in the Editor tab of the workflow as with manual executions. Instead, you can see executions in the workflow's Executions tab according to your workflow settings. From there, you can explore and troubleshoot problems using the debug in editor feature.