Small CLI to move, back up, and diff n8n workflows between instances.
Project description
npmove
Small command-line tool to move, back up, and diff n8n workflows between instances.
npmove talks to the n8n REST API. It is useful when you have more than one n8n instance (typical setup: dev / staging / prod) and you want to keep workflows in sync without clicking through the UI or hand-editing exported JSON.
Install
pip install npmove
Python 3.9+ required.
Quick start
Save credentials for an instance (do this once per server):
npmove auth dev https://dev.n8n.example.com --token <api-token>
npmove auth prod https://n8n.example.com --token <api-token> --default
List workflows on the default instance:
npmove list
npmove list --active
Test string for example Export a single workflow to stdout:
npmove export 42
Export a single workflow to a file:
npmove export 42 -o workflows/my-flow.json
Export every workflow to a directory (one JSON per workflow, named <slug>.<id>.json):
npmove export --all -o ./backups/
Import a workflow onto another instance:
npmove import workflows/my-flow.json --instance prod
Optionally rename on import:
npmove import workflows/my-flow.json --instance prod --name "My Flow (prod)"
Compare a local file with the remote version (auto-match by workflow name, or pass --id):
npmove diff workflows/my-flow.json --instance prod
diff exits with status 1 if there are differences — handy for CI checks.
Commands
| Command | Purpose |
|---|---|
npmove auth <name> <url> --token <token> |
Save instance credentials |
npmove instances |
List configured instances |
npmove forget <name> |
Remove an instance |
npmove list |
List workflows on the configured instance |
npmove export <id> |
Export one workflow |
npmove export --all -o <dir> |
Export every workflow |
npmove import <file> |
Create a new workflow on the instance |
npmove diff <file> |
Compare local file with the remote workflow |
Run npmove <command> --help to see all flags.
Where credentials are stored
Default location: ~/.npmove/config.json (the file is chmod-600 on POSIX).
You can override the directory with the NPMOVE_HOME environment variable.
The file holds plain text tokens — treat it like any other dotfile that contains secrets.
What npmove import does (and does not)
It creates a new workflow on the target instance. It does not overwrite an existing one by name or id. If you need to overwrite, delete the target workflow first (DELETE in the n8n UI or via the API), then import.
Server-managed fields (id, versionId, createdAt, updatedAt, meta.instanceId, ...) are stripped before the create call — n8n assigns them.
Limitations
- Credentials inside workflows are not transferred — n8n does not expose secrets via the workflow API, by design. After import, re-link credentials in the n8n UI.
- The tool currently supports the standard self-hosted n8n REST API (
/api/v1/...). n8n Cloud uses the same shape, set the--urlaccordingly.
License
MIT
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 npmove-0.0.2.tar.gz.
File metadata
- Download URL: npmove-0.0.2.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52d4cfab6ba46b044081e631c1adc6c392c2b0f787a6da97d20ab363f74f85b0
|
|
| MD5 |
23ad7f1e5852d27609a22aa774f62a07
|
|
| BLAKE2b-256 |
212f1047ffce6fe39aaa73642f24fc26934db4c64f4a2d3571c7675568e8fe8d
|
File details
Details for the file npmove-0.0.2-py3-none-any.whl.
File metadata
- Download URL: npmove-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ff019510e8850fc05aeb3e1f336e2646b91ee56d4e02445eb8376543f3d5ca7
|
|
| MD5 |
b9a4635a2a5711670942298c2ff25a7d
|
|
| BLAKE2b-256 |
db5ade9622447b5ec43de9eaa9216d4678c878c0d4db91020b1a96030934e484
|