Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I Lost a Working n8n Workflow to a Bad Edit — Now Git Versions Every Deploy

说明与用途

作者创建了一个 nightly 导出器,将每个 n8n 工作流快照到 git 仓库,去除噪声字段,仅在真正更改时提交。这样可以快速回滚,恢复时间从 40 分钟降至每月 20 分钟。

问题

A bad edit of an n8n workflow caused a client to receive 200 un‑triaged emails, and the author had no reliable way to revert the change.

结果

The exporter provides reliable rollback, reduces recovery time from 40 minutes to 20 minutes per month, and prevents accidental loss of workflow logic.

工作流

  • 1. Cron trigger at 23:00 daily
  • 2. HTTP node GET /api/v1/workflows to fetch all workflows
  • 3. Code node removes updatedAt, createdAt, versionId, webhookId from JSON
  • 4. Write each workflow to workflows/<slug>.json and a manifest.json
  • 5. Execute node runs git diff --quiet; if changed, commit with descriptive message and push

证据

I added it myself — a nightly exporter that snapshots every workflow into a git repo, so a bad edit is a git checkout instead of a 40-minute guessing game.

来源

The exporter backs itself up too; I've seen enough backup scripts that exclude themselves.

来源

Without this step, every nightly export shows "changes" that are just timestamps, and the git history becomes unreadable.

来源

The drill takes 20 minutes a month. The Friday-night incident took 40 minutes and a client's trust.

来源

  • 记录日期: 2026-10-17T22:41:28.611Z