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.4.0.tar.gz (143.8 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.4.0-py3-none-win_amd64.whl (3.5 MB view details)

Uploaded Python 3Windows x86-64

n8nc-0.4.0-py3-none-manylinux_2_28_x86_64.whl (3.5 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

n8nc-0.4.0-py3-none-manylinux_2_28_aarch64.whl (3.3 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

n8nc-0.4.0-py3-none-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

n8nc-0.4.0-py3-none-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for n8nc-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a043d05256a39410850d8a96921185eb4b884bf15a321732f98587625c16c75d
MD5 05233b60f3e383df449fdb3af870e67e
BLAKE2b-256 af8898b42fe548581d7f2ae157b64076124af4dd59aab08199c8d9e915eb2099

See more details on using hashes here.

File details

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

File metadata

  • Download URL: n8nc-0.4.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.5 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.4.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 df03e04f614c0b6912a9fecd95f379e28bcced105280c21c52318ac95833bc9c
MD5 12e2324c8cfa3d9cfcf4ca77d49bc248
BLAKE2b-256 e84f25a20665494c0fafbe40af1c48e7ebc336e833c80cac97fce06d54ea9f90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for n8nc-0.4.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a76d2d4ef708f3d4e8fb744a8cb76ae3b7d57f59c005186bc1dacc45d861e058
MD5 c59f82e996cd805f5241bfd4536e7d56
BLAKE2b-256 99d7157fd1b1d6de3a42abd8c207cbe465b88542c5b17a510533b52717ae5e7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for n8nc-0.4.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 24ed803e93043c6fa216ee8bbd4f5e0c5a6177d993cf92d209f27e9836f3943e
MD5 9c7a327df741faed8761b3dd2c55c5d6
BLAKE2b-256 7e01d2e645f439181fea748b26a4f691436f49ba05c79ec795c1c46798df4618

See more details on using hashes here.

File details

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

File metadata

  • Download URL: n8nc-0.4.0-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.3 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.4.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9a5ef4fc0d88d55e7d39275ecd542bcd33530c390f0326265b59779cedacc4c2
MD5 d1e24989685fffe030b1f3bee5743ada
BLAKE2b-256 777df217d0c8d2e5d8b090d78b48af41703f5d07576d6b24b39fd6ea1b3209cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for n8nc-0.4.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8d1c69b04f1257230e5f8fd86b16b8f81427bb80cccb9775bd030ea8cf404dd4
MD5 28c393e7f8b4eaf10a420774428ec136
BLAKE2b-256 d6ba7cefbf6a4fb057303bb9fdfe0c115fe25e7d1c12f6030a5dd6a801cd4354

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