Git backup of workflows and credentials — n8n Workflow

Medium complexity Trigger7 nodes💎 Other👁 13,433 viewsby Allan Daemon

Overview

This creates a git backup of the workflows and credentials.

It uses the n8n export command with git diff, so you can run as many times as you want, but only when there are changes they will create a commit.

Setup You need some access to the server.

Create a repository in some remote place to host your project, like Github, Gitlab, or your favorite private repo.

Clone the repository in the server in a place that the n8n has access. In the example, it's the ., and the repository name is repo.

Nodes used

On clicking 'execute'git pushCron

Workflow Preview

O
On clicking 'execute'
E
Export Workflows
E
Export Credentials
G
git add
G
git commit
G
git push
C
Cron
7 nodes6 edges

How it Works

  1. 1

    Trigger

    The workflow starts with a trigger trigger.

  2. 2

    Process

    Data flows through 7 nodes, connecting cron, executecommand, manualtrigger.

  3. 3

    Output

    The workflow completes its automation and delivers the result to the configured destination.

Node Details (7)

ON

On clicking 'execute'

manualTrigger

#1
GI

git push

executeCommand

#2
CR

Cron

cron

#3

How to Import This Workflow

  1. 1Click Download JSON button on the right to save the workflow file.
  2. 2Open your n8n instance. Go to Workflows → New → Import from file.
  3. 3Select the downloaded git-backup-of-workflows-and-credentials file and click Import.
  4. 4Set up credentials for each service node (API keys, OAuth, etc.).
  5. 5Click Test Workflow to verify everything works, then activate it.

Or paste directly in n8n → Import from JSON:

{ "name": "Git backup of workflows and credentials", "nodes": [...], ...}

Integrations

cronexecutecommandmanualtrigger

Get This Workflow

Download and import in one click

Download JSONView on n8n.io
Nodes7
Complexitymedium
Triggertrigger
Views13,433
CategoryOther

Created by

Allan Daemon

Allan Daemon

@allandaemon

Tags

cronexecutecommandmanualtrigger

New to n8n?

n8n is a free, open-source workflow automation tool. Self-host it or use the cloud version.

Get n8n Free →