Skip to main content

sidebar_key: n8n-gitops tags: [docker, devops, cli]

n8n-gitops

A GitOps CLI tool for n8n Community Edition that brings version control and collaborative workflow development to n8n.

Sponsor Opensource ByJG Build Status GitHub source GitHub license GitHub release

n8n is a fair-code workflow automation platform (like Zapier/Make.com but self-hosted) that connects 400+ services and apps. n8n-gitops adds the GitOps deployment pipeline that is missing from both the Community Edition and the official n8n-cli lightweight API client.

Features

  • 🔄 Mirror Mode Export: Always keeps local repository in perfect sync with n8n
  • 📦 Code Externalization: Store Python/JavaScript code in separate files
  • 🔑 Credential Documentation: Auto-generate documentation of workflow credential dependencies
  • 🏷️ Git-Based Deployment: Deploy specific tags/branches/commits
  • ✅ Validation: Validate workflows and manifests before deployment
  • 🔌 Active State Management: Control workflow activation via API endpoints
  • 🧹 Clean Deployments: Replace workflows with clean state

Logo

Quick Start

# Install with uv (recommended — isolated, no sudo)
uv tool install n8n-gitops

# Or with pipx (Ubuntu/Debian/Fedora/macOS)
pipx install n8n-gitops

# Or with pip (user install, no sudo)
pip install --user n8n-gitops

# Create project
n8n-gitops create-project my-n8n-project
cd my-n8n-project

# Configure authentication
n8n-gitops configure --config dev \
  --api-url https://your-n8n-instance.com \
  --api-key your-api-key-here

# Export workflows
n8n-gitops export

# Commit to Git
git init
git add .
git commit -m "Initial export"
git tag v1.0.0

# Deploy
n8n-gitops deploy --git-ref v1.0.0

Core Guides

Key Concepts

Mirror Mode

Export always mirrors your n8n instance:

n8n-gitops export
  • ✅ Exports ALL workflows
  • 🗑️ Deletes local workflows not in n8n
  • 🗑️ Deletes orphaned script files
  • 📝 Updates manifest to match remote

Code Externalization

Store code in separate files instead of inline JSON (controlled by externalize_code in n8n/manifests/workflows.yaml, default: true):

Workflow JSON:

{
  "parameters": {
    "pythonCode": "@@n8n-gitops:include scripts/my-workflow/process.py"
  }
}

Script File:

def process(data):
    return data.upper()

result = process(input)

Git-Based Deployment

Deploy from any Git reference:

# Deploy from tag
n8n-gitops deploy --git-ref v1.0.0

# Deploy from branch
n8n-gitops deploy --git-ref main

# Deploy from commit
n8n-gitops deploy --git-ref abc123

Commands

# Create project structure
n8n-gitops create-project <path>

# Install git hooks (export on commit, deploy on pull)
n8n-gitops install-hooks [--config NAME] [--api-url URL] [--api-key KEY]

# Export workflows (mirror mode)
n8n-gitops export

# Validate workflows
n8n-gitops validate [--strict]

# Deploy workflows
n8n-gitops deploy [--git-ref REF] [--dry-run] [--prune]

# Rollback to previous version
n8n-gitops rollback --git-ref <ref>

See Commands Reference for complete documentation.

Example Workflow

# 1. Export from n8n
n8n-gitops export

# 2. Edit scripts
vim n8n/scripts/payment-processing/validate.py

# 3. Validate changes
n8n-gitops validate --strict

# 4. Commit to Git
git add .
git commit -m "Improve payment validation"
git tag v1.1.0

# 5. Deploy
n8n-gitops deploy --git-ref v1.1.0

Project Structure

my-n8n-project/
├── n8n/
│   ├── workflows/           # Workflow JSON files
│   ├── scripts/             # Externalized code
│   │   └── my-workflow/
│   │       ├── process.py
│   │       └── transform.js
│   ├── credentials.yaml     # Credential documentation (auto-generated)
│   └── manifests/
│       ├── workflows.yaml   # Workflow manifest
│       └── env.schema.json  # Environment schema
└── .gitignore

Development

# Clone the repository
git clone https://github.com/n8n-gitops/n8n-gitops.git
cd n8n-gitops

# Install with uv (recommended)
uv sync --dev

# Or with pip
pip install -e ".[dev]"

# Run tests
uv run pytest -v  # with uv
# or
pytest -v  # with pip

Requirements

  • Python 3.10+
  • Git
  • n8n instance with API access

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Metadata

Release files for n8n-gitops 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for n8n-gitops 0.4.1
File Size Uploaded
n8n_gitops-0.4.1.tar.gz 2.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for n8n-gitops 0.4.1
File Interpreter ABI Platform
n8n_gitops-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 2.8 MB

Release files / n8n_gitops-0.4.1.tar.gz

Download URL n8n_gitops-0.4.1.tar.gz
Size 2.8 MB
Tags Source
SHA-256 checksum
How to use checksums
3d1a439dbcf4d2975504ccc320a9d7505b6941b9f96afb9c159d7eb2b5563021
BLAKE2b-256 checksum
How to use checksums
ccbb16069292d0bf4301c226fdf6b57ccf53c71aff83f80c3733e9671719a136
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release files / n8n_gitops-0.4.1-py3-none-any.whl

Download URL n8n_gitops-0.4.1-py3-none-any.whl
Size 41.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0fc8feadaef668a91bf489675f93b6e85c4ac289a197e78c8a412b938d26b511
BLAKE2b-256 checksum
How to use checksums
ec7de24893bf07ab5f0b3e5c0b5d621a41a77b33a596bba9f2a3d4e7afa4e937
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page