Skip to main content

CLI for n8n workflow automation

Project description

n8nc

CLI for n8n workflow automation. Sync workflows with Git, author them locally, and manage remote instances from the terminal.

Quick start

# Install (pick one)
cargo install n8nc              # From source
pip install n8nc                # Via pip
uvx n8nc --help                 # Run without installing

# Set up a repo
n8nc init --instance prod --url https://your-instance.app.n8n.cloud
n8nc auth add prod --token <api_key>

# Pull and track workflows
n8nc pull --all --instance prod
n8nc status

Installation

From crates.io

cargo install n8nc

From PyPI

pip install n8nc
# or run without installing:
uvx n8nc ls --instance prod

From GitHub releases

Pre-built binaries for Linux (x64, arm64), macOS (x64, arm64), and Windows (x64) on the releases page.

What it does

n8nc is three things:

  • Git sync for n8n workflows you want to track locally
  • Local authoring for draft workflows and structured node edits
  • Development CLI for listing, pulling, pushing, triggering, and inspecting executions

Every command supports --json for agent and script integration.

Commands

n8nc init                          Set up a workflow repo
n8nc doctor                        Check repo, auth, and API health

n8nc auth add|test|list|remove     Manage API tokens
n8nc auth session add|test|remove  Manage browser-session auth

n8nc ls                            List remote workflows
n8nc get <id-or-name>              Fetch and print a workflow
n8nc pull <id-or-name>             Pull a workflow into the repo
n8nc pull --all [--active]         Pull all workflows
n8nc push <file>                   Push a tracked workflow back
n8nc push --all                    Push all modified tracked workflows
n8nc activate <id-or-name>         Activate a workflow
n8nc deactivate <id-or-name>       Deactivate a workflow

n8nc runs ls                       List recent executions
n8nc runs get <id> [--details]     Inspect one execution
n8nc runs watch                    Watch executions live

n8nc workflow new <name>           Create a local draft
n8nc workflow create <file>        Publish a draft to n8n
n8nc workflow execute <id-or-name> Execute via configured backend
n8nc workflow show <file>          Inspect a local workflow
n8nc workflow rm <target>          Remove a workflow

n8nc node ls|add|set|rename|rm     Edit nodes in local workflows
n8nc conn add|rm                   Edit connections
n8nc expr set                      Set expressions on nodes
n8nc credential ls|schema|set      Discover and assign credentials

n8nc status [--refresh]            Show local sync state
n8nc diff <file> [--refresh]       Show local changes
n8nc trigger <url>                 Call a webhook URL
n8nc fmt [--check]                 Format workflow files
n8nc validate                      Validate workflow files
n8nc completions <shell>           Generate shell completions

Repo model

n8nc init creates:

.
├── n8n.toml           # Instance config
├── workflows/         # Tracked and draft workflow files
└── .n8n/cache/        # Base snapshots for local diff

Tracked workflows are stored as canonical JSON with a metadata sidecar:

workflows/<slug>--<id>.workflow.json
workflows/<slug>--<id>.meta.json

The sidecar binds each file to the instance it came from and records a hash used for safe push (lease check).

Auth

Tokens are resolved in order:

  1. N8NC_TOKEN_<ALIAS> env var
  2. OS keychain entry from n8nc auth add

Optional browser-session auth (for credential inventory fallback):

  1. N8NC_SESSION_COOKIE_<ALIAS> + N8NC_BROWSER_ID_<ALIAS> env vars
  2. OS keychain entries from n8nc auth session add

Workflow execution

trigger calls webhook URLs directly. For non-webhook workflows, configure an external backend in n8n.toml:

[instances.prod.execute]
backend = "command"
program = "uvx"
args = ["your-runner", "execute_workflow", "{workflow_id}", "{instance_alias}"]
stdin_json = true

Then run:

n8nc workflow execute "Nightly Digest" --instance prod --input '{"dryRun":true}'

Design

  • Same-instance first -- tracked files are bound to the instance they were pulled from
  • Agent-safe -- every command supports --json with structured envelopes
  • Deterministic -- workflows are canonicalized before storage and hashing
  • Safe push -- refuses to overwrite remote changes since the last pull
  • Sensitive-data aware -- scans for inline secrets on pull, push, and validate
  • Honest execution -- trigger is for webhooks; workflow execute delegates to a configured backend

Spec

Implementation notes and roadmap live in docs/cli-spec.md.

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

n8nc-0.2.1.tar.gz (127.7 kB view details)

Uploaded Source

Built Distributions

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

n8nc-0.2.1-py3-none-win_amd64.whl (3.4 MB view details)

Uploaded Python 3Windows x86-64

n8nc-0.2.1-py3-none-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

n8nc-0.2.1-py3-none-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

n8nc-0.2.1-py3-none-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

n8nc-0.2.1-py3-none-macosx_10_12_x86_64.whl (3.3 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file n8nc-0.2.1.tar.gz.

File metadata

  • Download URL: n8nc-0.2.1.tar.gz
  • Upload date:
  • Size: 127.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for n8nc-0.2.1.tar.gz
Algorithm Hash digest
SHA256 890f168f09218e144991c82ccca267399fa90f1f12bd88e89038fa5e73eba0c5
MD5 e270ffd7c2073990adbf93124ec0d153
BLAKE2b-256 7362649b62b73bc6dad7ede89b72180611c1829b0f241574d9282b24aad6f1d1

See more details on using hashes here.

File details

Details for the file n8nc-0.2.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: n8nc-0.2.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for n8nc-0.2.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f642f49c3197ab776db9e2140c1f991c207cc2f48c3bd18882d9de89ff4af234
MD5 50a736463730adba63b9ab158499c188
BLAKE2b-256 ade4ef16c44df8a42652cfd5a3deda2d41e9fc767b4f68378ca97e52390552e9

See more details on using hashes here.

File details

Details for the file n8nc-0.2.1-py3-none-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: n8nc-0.2.1-py3-none-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: Python 3, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for n8nc-0.2.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a5109337023f0b70b5a5e76cb0d92e9a10f3d45b1cf468802967b530cb9db64d
MD5 484ef487dcc401c671679090195f422a
BLAKE2b-256 2e34e8b667818c2736daacdf412bcc80aafddad3029f77867eafce82c53513b6

See more details on using hashes here.

File details

Details for the file n8nc-0.2.1-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for n8nc-0.2.1-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1dde66d3733304dd0e190ac466a4de64094efe78d0561209267ea42dbc670855
MD5 a3f42cffa42f4c5be0afb13ef5e58395
BLAKE2b-256 3e6b5568950fc92be2c084a35254d6a254bad9bdbbef545a5c6dd95ac051e674

See more details on using hashes here.

File details

Details for the file n8nc-0.2.1-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: n8nc-0.2.1-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for n8nc-0.2.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 88fb895620e1c6e0cd62bdd11ec28326beac719e8517dbfd6046da009365bc30
MD5 66a80c0b266eb8377cbd1ab52d1d0102
BLAKE2b-256 c6c68a54ab986a009fbc19b094dc5188b34a3550091d6af3e0e22ef438e73150

See more details on using hashes here.

File details

Details for the file n8nc-0.2.1-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for n8nc-0.2.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c412501bef455118f12a6e0a805702b0903a34ff90f322555fd2492e0593bb4f
MD5 381c439431d0990852f5eae7f376df62
BLAKE2b-256 29dc2b6156403a972c60b56c6d4c52a4ad4a260aa26f0894a94bbbd7a72ae6b9

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