Перейти к содержанию
НОВОЕПознакомьтесь с Alaaddin — вашим ИИ-джинном с голосом. trig8n запускается 1 января 2027. Что нового

Библиотека / Код, Git и инструменты разработчика

Код, Git и инструменты разработчика

Резервное копирование workflow n8n в GitHub как детерминированные коммиты JSON

Запускается по расписанию, экспортирует все workflow n8n, включая архивные, в отсортированном JSON и коммитит их в приватный репозиторий GitHub только при наличии изменений.

Что делает

## Back up n8n workflows to GitHub Keeps every workflow of your instance in a private GitHub repo, with one commit per run and nothing written when nothing changed. ### How it works The workflow pulls every workflow from the n8n API, archived ones included, and turns each into a JSON file. Volatile fields like updatedAt and versionId are stripped and keys are sorted, so a workflow you did not touch produces the same bytes as yesterday. The whole set goes to GitHub through the Git Data API as one tree, which becomes one commit. If that tree matches what the branch already points at, the run stops and nothing is written. ### Setup steps - Private repo, initialised with a README. An empty repo has no branch to read - GitHub fine-grained token scoped to that repo, Contents read and write - n8n API key from Settings, in an n8n API credential on List workflows - The GitHub credential on the six HTTP Request nodes - Fill owner, repo, branch and folder in Configuration - Run it twice. The second run should commit nothing ### Customization Switch to a six hour schedule if losing a day of changes is too much. Point it at a dedicated branch to review changes through pull requests. If a field keeps changing between runs, add it to the VOLATILE list in Normalise workflows.

Шаги

  1. Daily at 03:05
  2. Configuration
  3. List workflows
  4. Normalise workflows
  5. Read branch ref
  6. Read current commit
  7. Read repo tree
  8. Build new tree
  9. Push new tree
  10. Anything changed
  11. Create commit
  12. Move branch

Похожие автоматизации