Skip to main content

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

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 --url accordingly.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

npmove-0.0.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

npmove-0.0.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file npmove-0.0.1.tar.gz.

File metadata

  • Download URL: npmove-0.0.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for npmove-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9c3050d250bd99a244ca4e9f9b825a74f2c4f44f8c1b21026ce27b2d6868586d
MD5 2c67cf3a48dbbec49f5df55ad404b119
BLAKE2b-256 0bff756cbde8be4d7cf1fe316f1687f4df94d1470fd7bdfdf7aaf4897d655cb8

See more details on using hashes here.

File details

Details for the file npmove-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: npmove-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for npmove-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55dcec8d75b715e6758cffb450c79668b44f05f06724cbb9932e3e6b5522e1db
MD5 d7943d2db3711d2cf8976f744405f7a0
BLAKE2b-256 4b66bebf6bacc0d9c56d270976cff21ccf349f9b190acc43114fcbd8e3c400bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page