GitOps CLI for n8n Community Edition
Project description
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.
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 Git integration that's missing from the Community Edition.
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
Quick Start
# Install from PyPI
pip install n8n-gitops
# Or install with uv (faster)
uv pip install 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
- Getting Started - Installation and quick start
- Authentication - Configure API credentials
- Export - Mirror workflows from n8n
- Deployment - Deploy workflows to n8n
- Code Externalization - Store code in separate files
- Manifest File - Workflow configuration format
- n8n Enterprise Git Comparison - Decide between n8n-gitops and Enterprise Git
- Commands Reference - All CLI commands
- GitOps Principles - How n8n-gitops aligns with GitOps principles
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>
# Export workflows (mirror mode)
n8n-gitops export
# Validate workflows
n8n-gitops validate [--strict]
# Deploy workflows
n8n-gitops deploy [--git-ref REF] [--dry-run] [--backup] [--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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file n8n_gitops-0.3.3.tar.gz.
File metadata
- Download URL: n8n_gitops-0.3.3.tar.gz
- Upload date:
- Size: 39.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d47536120c959f5022c9b736bfa0c9bb15412e850a0a7b21dbac92bcccbdda0
|
|
| MD5 |
76c25a09765bd1afaf65b92693680e10
|
|
| BLAKE2b-256 |
3613e8057b81ef11df3fa9d4f9794e60d47861a8edc6046e392999b790e993ec
|
Provenance
The following attestation bundles were made for n8n_gitops-0.3.3.tar.gz:
Publisher:
build.yml on n8n-gitops/n8n-gitops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
n8n_gitops-0.3.3.tar.gz -
Subject digest:
8d47536120c959f5022c9b736bfa0c9bb15412e850a0a7b21dbac92bcccbdda0 - Sigstore transparency entry: 1155357040
- Sigstore integration time:
-
Permalink:
n8n-gitops/n8n-gitops@22213de81a56c844bc65053b7ba064836b61a942 -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/n8n-gitops
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@22213de81a56c844bc65053b7ba064836b61a942 -
Trigger Event:
push
-
Statement type:
File details
Details for the file n8n_gitops-0.3.3-py3-none-any.whl.
File metadata
- Download URL: n8n_gitops-0.3.3-py3-none-any.whl
- Upload date:
- Size: 38.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c623afc14ba5d4e285a7bf37096ce2e3123010017fe3dee2540f40c0d4f1abf
|
|
| MD5 |
1f3b27e54707ecd7ea6f0cd35b9f23eb
|
|
| BLAKE2b-256 |
8115bb59241815faeee6dbb5c6d44a1aa9464487122814ad0ddf4e6ade536e15
|
Provenance
The following attestation bundles were made for n8n_gitops-0.3.3-py3-none-any.whl:
Publisher:
build.yml on n8n-gitops/n8n-gitops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
n8n_gitops-0.3.3-py3-none-any.whl -
Subject digest:
4c623afc14ba5d4e285a7bf37096ce2e3123010017fe3dee2540f40c0d4f1abf - Sigstore transparency entry: 1155357042
- Sigstore integration time:
-
Permalink:
n8n-gitops/n8n-gitops@22213de81a56c844bc65053b7ba064836b61a942 -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/n8n-gitops
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@22213de81a56c844bc65053b7ba064836b61a942 -
Trigger Event:
push
-
Statement type: