快来看,n8n更新了!自动保存功能及更多更新现已上线!

内容来源:https://blog.n8n.io/announcing-autosave/
内容总结:
n8n推出工作流开发全周期安全防护新机制:自动保存、版本化发布与并发保护功能正式上线
长期以来,用户社区呼声最高的“自动保存”功能现已实现。但实现这一功能并非简单地移除“保存”按钮——在旧版n8n中,“保存”操作即等同于“部署”操作,若直接启用自动保存,任何未完成的节点配置或临时逻辑调整都可能被瞬间推送到生产环境。
为此,n8n团队对工作流状态处理机制进行了根本性重构,将“保存编辑内容”与“部署上线”完全解耦。全新推出的自动保存、版本化发布与并发保护三项核心功能,共同构建起关键自动化流程的安全防护网。
核心功能亮点:
- 自动保存:编辑器中每2秒自动检测并保存更改,无需手动保存,有效避免因浏览器崩溃、误关标签页或遗忘保存导致的数据丢失。
- 版本化发布:用户可明确控制生产环境中运行的工作流版本。在已发布版本持续稳定运行的同时,可继续多日编辑迭代新版本,待测试完成后再行发布更新。
- 版本历史控制中心:历史记录面板升级为工作流“指挥中心”,支持追踪变更、即时回滚至任意历史版本,并可重新发布旧版本。
- 并发保护:当团队成员编辑同一工作流时,系统将自动为其他协作者开启画布“只读模式”,避免编辑冲突,确保工作内容不会被意外覆盖。
典型应用场景示例:
- 新建工作流:编辑即自动保存,历史图标实时反馈保存状态。
- 首次发布:点击发布按钮并填写版本信息后,工作流正式上线运行。
- 安全更新:修改已发布工作流时,发布按钮显示黄色标识,提示当前版本与生产版本存在差异,编辑操作不影响线上运行。
- 发布新版本:完成修改后发布新版本,新逻辑立即生效。
- 快速回滚:通过版本历史面板选择任意历史版本重新发布,可瞬间将生产环境恢复至稳定状态。
协作体验升级:
- 实时同步预览:只读模式下可实时查看协作者的编辑动态。
- 多标签页防护:同一工作流在不同标签页中同时打开时,系统会检测冲突并提示用户选择处理方式,杜绝代码意外丢失。
近期更新预告:
即将推出的优化包括:支持为未发布版本自定义命名、优化版本历史面板的视觉区分度、开放历史版本重命名功能等。
目前,自动保存、版本化发布与并发保护功能已作为Beta版本(v2.4.0)全面开放,涵盖免费自托管版、云端版及企业版。现有用户无需迁移即可直接使用。团队提醒,Beta功能暂不建议用于核心生产环境,稳定版将在后续发布。
中文翻译:
随着自动保存、版本化发布和并发保护功能的到来,我们为您带来了一种更安全、更可靠的工作流开发周期管理方式。
长久以来,自动保存一直是社区呼声最高的功能。但实现它并非简单地移除"保存"按钮那么简单。在n8n的旧版本中,"保存"活跃工作流等同于"部署"工作流。如果当时直接启用自动保存,每个未完成的节点配置或临时的逻辑中断都会立即被推送到生产环境。
为了实现自动保存,我们首先必须从根本上改变n8n处理工作流状态的方式——将保存操作与实时部署操作彻底分离。
本文将阐述自动保存与发布功能如何协同工作,为关键业务自动化构建安全网。
• 自动保存功能随2.4.0版本以测试版形式推出
• 面向所有用户开放——免费自托管版、云端版和企业版均可使用
• 无需迁移或额外操作即可开始使用
• 保存按钮已成为历史
运作原理:
让我们深入了解驱动新工作流生命周期的核心机制。
自动保存
这是最显著的改变。您不再需要保存按钮。编辑器每两秒检测一次变更并自动保存。从此不必担心浏览器崩溃、意外关闭标签页,或是简单的"忘记保存"情况。
版本化发布
过去,保存已激活的工作流意味着实时环境立即变更。现在,您可以明确控制哪个版本的工作流处于运行状态。您可以在已发布版本继续运行稳定旧逻辑的同时,持续数天对工作流进行修改和迭代。
注:发布功能于v2.0.0版本引入
版本历史(您的新控制中心)
历史面板现已升级为工作流的微型"指挥中心"。您可以追踪变更、执行即时回滚,或发布任意历史版本。
并发保护
当同事正在编辑某个工作流时,n8n会立即检测到该状态,并为其他用户临时锁定画布为只读模式,确保不会意外覆盖他人正在编辑的内容。
实战中的工作流生命周期
理解这个新生命周期的最佳方式就是观察实际应用场景。
让我们逐步演示以下场景:
- 创建新工作流
- 发布工作流(使其生效)
- 安全更新(修改已发布的工作流)
- 发布新版本
- 回滚至历史版本
1. 创建新工作流
从开始编辑的那一刻起,自动保存就已启动。
当您对工作流进行修改时,屏幕右上角的历史图标(时钟)会不时旋转,确认内容正在后台持续保存。您的工作始终安全。
在此阶段,如果查看发布按钮,会发现它没有状态图标。这意味着工作流尚未发布——没有任何内容处于生效状态。
2. 首次发布部署
当您完成初始流程构建并测试成功后,即可使其生效(此前称为"激活")。
点击右上角的发布按钮时,系统会提示您输入版本名称和可选描述。此时,该工作流中的所有Webhook或其他触发器都将激活并开始监听。
按钮现在显示为[已发布]并带有绿色状态图标,表示当前视图中的版本已成为活跃的生产版本。太棒了!
3. 安全更新
工作流发布后,我们可能需要进行改进,同时不影响已发布的实时版本。
您可以直接修改工作流,这些改动只会影响编辑器中的版本,不会波及已发布版本。
当您进行首次修改时,发布按钮旁的图标会变为黄色。这表示当前版本已与生产版本产生差异。
4. 发布新版本
当您准备将新更改推送到生产环境时,点击[发布]按钮,系统会提示您命名版本(例如"版本2")。状态图标将再次变为绿色。当前版本现已发布,新逻辑开始生效。
5. 回滚至历史版本
五分钟后,您发现版本2引入了严重错误,需要立即修复生产环境。
现在您无需慌乱地撤销更改,而是可以直接通过版本历史面板回滚并发布(或重新发布)任意版本:
- 找到之前的版本(版本1.0——之前正常运行的版本)
- 点击该版本旁的三点菜单
- 选择"发布此版本"
生产环境即刻恢复至安全版本,为我们争取了修复错误的时间。危机解除!
协作与并发保护
自动保存也带来了新挑战:在协作环境中,如何确保团队成员不会意外覆盖彼此的工作?
为此,我们推出了并发保护功能。
1. 团队协作(只读模式)
当您打开同事正在编辑的工作流时,n8n会检测到编辑活动,并自动以只读模式(斜线纹路)加载编辑器,同时显示提示消息告知当前编辑者的身份。
实时更新
在只读模式下,您看到的不是静态快照。当同事添加节点或修改参数时,您的屏幕会近乎实时地更新。这使您可以实时观看他们的构建过程。
当同事离开工作流或短暂未操作后,编辑锁将释放,画布从只读模式转为编辑模式。由于您的屏幕一直在实时更新,您可以立即接替工作,从他们离开的位置开始编辑。
2. 自我保护(多标签页安全)
我们还为那些意外(或有意)在多个标签页甚至不同浏览器中打开同一工作流的情况提供了保护机制。
假设您在标签页A中进行编辑,然后切换回过时的标签页B尝试修改,n8n仍会检测到冲突。
系统不会静默保存(导致可能丢失在标签页A中的工作),而是会弹出提示告知工作流已在其他地方被修改。随后您将获得选择权:
这确保即使标签页使用混乱,您也绝不会在非主动决定的情况下意外丢失代码。
即将推出——版本命名与增强历史功能
自动保存测试版(v2.4.0)提供了自动保存、发布和并发保护的核心功能。未来几周内,我们将推出"快速跟进"更新,新增以下关键功能:
- 自定义版本名称:您很快就能为任意版本命名而无需发布。这非常适合在迭代复杂逻辑时标记进度或识别特定状态。
- 可视化历史改进:我们将优化版本历史面板,让已发布版本和未发布版本的区别一目了然。
- 重命名功能:您还可以重命名历史版本,保持历史记录井井有条。
这些更新即将到来。
我们非常兴奋能最终为您提供自动保存功能,通过这次更新打造一个可靠安全的环境,让您能充满信心地构建复杂自动化流程。
自动保存、增强的版本化发布和并发保护功能现已以测试版形式提供(版本2.4.0)。
与所有测试版功能一样,在稳定版发布前,请避免在关键业务生产实例中使用此功能。
有问题或建议?
欢迎加入社区论坛参与讨论。
英文来源:
We're introducing a safer and more reliable way to manage your workflow development lifecycle with the arrival of Autosave, Versioned Publishing, and Concurrency Protection.
For a long time, Autosave has been the most requested feature from the community. But implementing it wasn't as simple as just removing the "Save" button. In previous versions of n8n, "Saving" an active workflow was synonymous with "Deploying" it. If we had simply enabled Autosave in that environment, every half-finished node configuration or temporary break in logic would have been pushed live to production instantly.
To give you Autosave, we first had to fundamentally change how n8n handles workflow states. We had to decouple the act of saving your work from the act of deploying it live.
This post explains how Autosave and Publishing work together to provide a safety net for mission-critical automations.
• Autosave launched in Beta with version 2.4.0
• Available for everyone - free self hosted, cloud, and Enterprise.
• No migration or actions required to start using.
• The save button is no more.
How It Works:
Let’s look at the key mechanics that power the new workflow lifecycle.
Autosave
This is the headline change. You no longer have a save button. The editor now checks for changes every two seconds and saves them automatically. No need to worry about browser crashes, accidental tab closures, or plain simple “I forgot to save this” situations.
Versioned Publishing
In the past, Saving an activated workflow meant instant changes to live. Now, you have explicit control over which version of your workflow is live. You can continue to make changes and iterate on your workflow for days while the Published version continues to run the old, stable logic.
Note: Publishing was added in v2.0.0
Version History (your new control center)
The History panel is now a mini "Command Center" for your workflow. Track changes, perform instant rollbacks, or publish any previous version.
Concurrency Protection
n8n now detects when a colleague is editing a workflow and temporarily locks the canvas in Read-Only mode for everyone else, ensuring you never accidentally overwrite each other’s active work.
The Workflow Lifecycle in Action
The best way to understand this new lifecycle is to see it in practice.
Let’s walk through the following scenario:
- Creating a new workflow
- Publishing it (making it live)
- Safe updates (updating an already published workflow)
- Publishing a new version
- Rolling back to a previous version
- Creating a new workflow
From the moment you start editing, Autosave is active.
As you make changes to your workflow, the History Icon (the clock) in the top right of the screen occasionally spins to confirm it's constantly being saved in the background. Your work is safe.
At this stage, if we look at the Publish button, it has no status icon. This means the workflow is not currently published - nothing is live yet. - Publishing it - the first deploy
Once you've finished building the initial flow and tested it successfully, it’s time to make it live (previously called Activate).
When you click the Publish button in the top right, you'll be asked for a version name and optional description. Now, any webhooks or other triggers in this workflow are active and listening.
The button now says [Published] and we have a green status icon, meaning your current view is now the active, production version. Yay! - Safe updates
Now that it's published, we want to make improvements, but without impacting the live published version.
We can simply go ahead and make changes to the workflow. It will only impact the version in the editor, not the published version.
The icon next to the Publish button turns Yellow when you make your first change. This signals that the current version has diverged from Production. - Publishing a new version
Once you are ready to push the new changes to production, click the [Publish] button, you’ll be asked for a name (lets call it “Version 2”). The status icon turns Green again. The current version is now Published and the new logic is live. - Rolling back to a previous version
Five minutes later, you realize Version 2 introduced a nasty bug and need to fix production immediately.
Instead of frantically undoing changes, you can now roll back and publish (or re-publish) any version from the Version History panel:
- Creating a new workflow
- Find the previous version (version 1.0 - the one that was working previously).
- Click the Three Dots menu next to that version.
- Select Publish this version.
Production is instantly reverted to the safe version, buying us time to fix the bugs. Crisis averted!
Collaboration and Concurrency Protection
Finally, Autosave introduces a new challenge: in a collaborative environment, how do we ensure teammates don't accidentally overwrite each other's work?
To solve this, we are introducing Concurrency Protection.- Working with Teammates (Read-Only Mode)
When you open a workflow that a teammate is currently editing, n8n will detect the activity and automatically load the editor in Read-Only Mode (the diagonal lines) and you'll get a message letting you know exactly who is currently working on the workflow.
Real-Time Updates
In Read-Only mode, you aren't just looking at a static snapshot. As your teammate adds nodes or changes parameters, your screen will update in near real-time. This allows you to watch their progress live as they build.
Once your teammate leaves the workflow or goes inactive for a short period, the edit lock releases and the canvas changes from read-only to edit mode. Because your screen has been updating live, you can simply take over and start editing exactly where they left off. - Protecting You From Yourself (Multi-Tab Safety)
We also added safeguards for those times when you accidentally (or not) have the same workflow open in multiple tabs, or even different browsers.
Let’s say you make edits in Tab A, and then switch back to the outdated Tab B to try and make a change, n8n will still catch the conflict.
Instead of silently saving (and potentially losing the work you did in Tab A), you will see a popup alerting you that the workflow has been modified elsewhere. You are then given a choice:
This ensures that even if you get your tabs crossed, you never accidentally lose code without making a conscious decision to do so.
Coming Very Soon - Naming Versions & Enhanced History
Autosave Beta (v2.4.0) delivers the core functionality for Autosave, Publishing and Concurrency Protection and we have a "fast-follow" update coming in the next couple of weeks that adds a few key capabilities:
- Working with Teammates (Read-Only Mode)
- Custom Version Names: Soon, you will be able to assign a name to any version without publishing it. This is perfect for marking your progress or identifying a specific state while you iterate on complex logic.
- Visual History Improvements: We are refining the Version History panel to make it even easier to distinguish at a glance which versions have been published versus those that haven't.
- Renaming: You will also gain the ability to rename past versions to keep your history organized.
These updates are right around the corner.
We’re super excited to finally provide you with Autosave as part of the updates to provide a reliable and safe environment where you can build complex automations with confidence.
Autosave, improved Versioned Publishing, and Concurrency Protection are now available in Beta (version 2.4.0).
As with all Beta features, please avoid using this on mission-critical production instances until the Stable version is released.
Questions or comments?
Join the discussion in the community forum
文章标题:快来看,n8n更新了!自动保存功能及更多更新现已上线!
文章链接:https://blog.qimuai.cn/?post=2858
本站文章均为原创,未经授权请勿用于任何商业用途