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 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

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.0.2.tar.gz (109.2 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.0.2-py3-none-win_amd64.whl (3.2 MB view details)

Uploaded Python 3Windows x86-64

n8nc-0.0.2-py3-none-manylinux_2_28_x86_64.whl (3.2 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

n8nc-0.0.2-py3-none-manylinux_2_28_aarch64.whl (3.1 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

n8nc-0.0.2-py3-none-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

n8nc-0.0.2-py3-none-macosx_10_12_x86_64.whl (3.1 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for n8nc-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3886e15ae861dbc5db5e80e65686eb20ea641e1e0cec3f55fc21fd088c0828b6
MD5 3bce5c77f5b50ac24e3c7f6c83644e22
BLAKE2b-256 49fb930ba6f4b6e93bd4300a7a4ae343c9b4adcd792a4db83f765c948741eb52

See more details on using hashes here.

File details

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

File metadata

  • Download URL: n8nc-0.0.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.2 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.0.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 bc75dabb8bdbd6e9dd487d0fcbe5065f895c94d69db74c95bab8ac1a8cd270df
MD5 4d7f194e5b347cf4246a70dae25afe66
BLAKE2b-256 f295e6ee2f36279313f16b6ac301eee3d4241a6369f13039657f6e8cde277601

See more details on using hashes here.

File details

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

File metadata

  • Download URL: n8nc-0.0.2-py3-none-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 3.2 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.0.2-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e0478176088fd6b5d90c078aa4f1c9c0c05e1ef11667f95701ee6c8214ca4104
MD5 51a19ffed621fee171e6c39c145234b8
BLAKE2b-256 43ea5e96d6915335e1555397cacfb20c743ced73f20d7fcf63a46a8ad2bdac8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for n8nc-0.0.2-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4ed645042b91d1ec1f8cdecb0d72b1fbaec4803070e49929e34ab52de33c8c0a
MD5 9ee36020069c090435089ef2645cf339
BLAKE2b-256 303e3fd8162cc2cbf0ae8d8abf74ad024ab21880ec1d04d70f6ccdbe4806d5e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: n8nc-0.0.2-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.0 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.0.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cf12ca9599839a74ece18770a8ba1bc480ce783341b8e01c0b829fbcc054d3e0
MD5 1be6149a0d47eb86c507eed653c240d0
BLAKE2b-256 eaaff307bb214369592183f3a5689f05fc89b41d8208874b41a39e9f7314bfde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for n8nc-0.0.2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7b328b78f6545fb2b3d9e583c7068acf11d81bb058c964a40b905fe73a72526d
MD5 159218b7e873dd3c36536ced7b923327
BLAKE2b-256 b7c10b68f4e12b490a7ce5d672791ba7019f153f0375ec26bd84884c1369c55a

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