Skip to content

jchandler187/n8n-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

n8n-sync

CLI tool to sync n8n workflows between environments (staging → production) without paying for n8n Enterprise source control (€667/month).

Uses the n8n REST API (available in self-hosted n8n 0.214+).

Install

npm install -g github:jchandler187/n8n-sync

Commands

Pull — export workflows from an n8n instance

n8n-sync pull \
  --host http://staging.example.com \
  --api-key n8n_api_... \
  --output ./staging-workflows

Downloads all workflows as JSON files to ./staging-workflows/.

Push — import workflows to an n8n instance

n8n-sync push \
  --input ./staging-workflows \
  --host http://prod.example.com \
  --api-key n8n_api_... \
  --cred-map staging-postgres:prod-postgres,staging-redis:prod-redis

Creates new workflows or updates existing ones by name match.
--cred-map remaps credential names between environments (comma-separated src:dest pairs).

Diff — compare workflows between two instances

n8n-sync diff \
  --src http://staging.example.com --src-key n8n_api_... \
  --dest http://prod.example.com  --dest-key n8n_api_...

Shows:

  • Workflows only in staging (not yet deployed)
  • Workflows only in production (deleted from staging)
  • Workflows with node-level changes

Typical workflow

# On deploy day: see what's different
n8n-sync diff --src http://staging:5678 --src-key $STAGING_KEY \
              --dest http://prod:5678   --dest-key $PROD_KEY

# Deploy staging → prod
n8n-sync pull --host http://staging:5678 --api-key $STAGING_KEY --output /tmp/release
n8n-sync push --input /tmp/release \
              --host http://prod:5678 --api-key $PROD_KEY \
              --cred-map staging-postgres:prod-postgres

Get your API key

In n8n: Settings → n8n API → Create an API key

Requires n8n 0.214+ (self-hosted). Works with any version of n8n that exposes /api/v1/.

Why this exists

n8n Enterprise (€667/month) is the only first-party way to sync workflows between environments.
This tool uses the public n8n REST API to do the same thing for free.

About

CLI to sync n8n workflows between environments — no Enterprise plan required

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors