Kütüphane / Kod, Git ve Geliştirici Araçları
Kod, Git ve Geliştirici Araçları
n8n iş akışlarını deterministik JSON commit'leri olarak GitHub'a yedekle
Bir şey değiştiğinde yalnızca özel bir GitHub deposuna commit atmak üzere, arşivlenmiş olanlar dahil her n8n iş akışını sıralı JSON olarak dışa aktarır ve bir zamanlamaya göre çalışır.
Ne yapar
## 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.
Adımlar
- Daily at 03:05
- Configuration
- List workflows
- Normalise workflows
- Read branch ref
- Read current commit
- Read repo tree
- Build new tree
- Push new tree
- Anything changed
- Create commit
- Move branch
Benzer otomasyonlar
Kod, Git ve Geliştirici AraçlarıBirden Fazla Dosyayı Tek Commit'te GitHub'a Gönder9 adımKod, Git ve Geliştirici AraçlarıGitHub REST API ile birden fazla dosyayı GitHub'a gönderme35 adımKod, Git ve Geliştirici AraçlarıOpenAI ile GitHub commit'lerinden Jenkins derlemelerini tetikleme11 adımKod, Git ve Geliştirici AraçlarıBirleştirilmiş GitHub Pull Request'lerinden n8n İş Akışlarını Geri Yükleme13 adım