Skip to main content

CLI for managing n8n Cloud workflows

Project description

n8n CLI

A command-line tool for managing n8n Cloud workflows.

Installation

Global Installation (Recommended)

uv tool install .

Configuration

Create a credentials file with your n8n API credentials. The file can be placed in:

  • Your current working directory as .env (project-specific)
  • ~/.config/n8n-cli/config (global configuration)

Project-specific (.env in current directory):

N8N_API_KEY=your-api-key
N8N_INSTANCE_URL=https://your-instance.app.n8n.cloud/api/v1

Global (~/.config/n8n-cli/config):

N8N_API_KEY=your-api-key
N8N_INSTANCE_URL=https://your-instance.app.n8n.cloud/api/v1

Alternatively, set environment variables:

export N8N_API_KEY="your-api-key"
export N8N_BASE_URL="https://your-instance.app.n8n.cloud/api/v1"

Development Installation

For local development:

uv sync

Development

# Install with dev dependencies
uv sync

# Install pre-commit hooks
uv run pre-commit install

# Clean install tool globally (clears cache for fresh build)
uv run poe install

# Quick reinstall without cache clean (faster)
uv run poe reinstall

# Run tests
uv run poe test

# Run code quality checks
uv run poe check        # lint + typecheck + test
uv run poe lint         # just linting
uv run poe typecheck    # just type checking
uv run poe format       # format code

# Run pre-commit hooks manually
uv run pre-commit run --all-files

Usage

n8n --help

Examples

Workflow Management

List all workflows:

n8n workflow list
n8n workflow list -v  # verbose output with more details

View workflow details:

n8n workflow view "My Workflow"

Activate/deactivate workflows:

n8n workflow activate "My Workflow"
n8n workflow deactivate "My Workflow"

Pull workflows to local files:

n8n workflow pull                    # Pull all workflows
n8n workflow pull "My Workflow"      # Pull specific workflow
n8n workflow pull --project "Sales"  # Pull all workflows from a project

Push local workflow to cloud:

n8n workflow push workflow.json
n8n workflow push workflow.json --update  # Update existing workflow

Create new workflow:

n8n workflow create new_workflow.json

Compare local and cloud versions:

n8n workflow diff workflow.json

Move workflow to different project:

n8n workflow move "My Workflow" --project "Marketing"

Open workflow in browser:

n8n workflow open "My Workflow"

Delete workflow:

n8n workflow delete "My Workflow"

Execution Management

List recent executions:

n8n execution list
n8n execution list --workflow "My Workflow"  # Filter by workflow
n8n execution list --limit 50                # Show more results

View execution details:

n8n execution view <execution-id>

Download execution data:

n8n execution download <execution-id>
n8n execution download <execution-id> -o execution.json

Retry failed execution:

n8n execution retry <execution-id>

Project Management

List all projects:

n8n project list

View project details:

n8n project view "Sales"

User & Member Management

List users:

n8n user list

Invite user:

n8n user invite user@example.com --role member
n8n user invite admin@example.com --role admin

Remove user:

n8n user remove user@example.com

List project members:

n8n member list --project "Sales"

Add member to project:

n8n member add user@example.com --project "Sales" --role editor

Remove member from project:

n8n member remove user@example.com --project "Sales"

Shell Completion

Enable tab completion for workflows, projects, and file paths:

Installation

Automatic (recommended):

n8n --install-completion

Follow the shell-specific instructions. You may need to restart your shell.

Manual setup:

Bash:

eval "$(n8n --show-completion bash)"
# Add to ~/.bashrc for persistence

Zsh:

eval "$(n8n --show-completion zsh)"
# Add to ~/.zshrc for persistence

Fish:

n8n --show-completion fish > ~/.config/fish/completions/n8n.fish

What Gets Completed

  • Workflow names: n8n workflow view <TAB> shows your workflows
  • Project names: n8n project view <TAB> shows your projects
  • File paths: n8n workflow diff <TAB> shows .json files

Note: The n8n command must be available in your PATH for completion to work. Either activate the virtual environment (source .venv/bin/activate) or install globally.

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

n8nctl-0.1.0.tar.gz (151.3 kB view details)

Uploaded Source

Built Distribution

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

n8nctl-0.1.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file n8nctl-0.1.0.tar.gz.

File metadata

  • Download URL: n8nctl-0.1.0.tar.gz
  • Upload date:
  • Size: 151.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for n8nctl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ce1fa35229c6d0ae64d62458cf1bebdb8ec33386f6d326d2916f64e1520e109a
MD5 4e286c03d45a71dea248cd0d965f224d
BLAKE2b-256 ab2e92a7e6ebf692af64b3a39e18bc01aa69a5a9eacf86ad4cefbcc6f7d1945d

See more details on using hashes here.

File details

Details for the file n8nctl-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: n8nctl-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for n8nctl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9741fddcef0ab8dd57643f19db22436cd1da155c9e044ab9f567bcfb0f7e9c76
MD5 a88de4dce57504e1693f923b9132e2e2
BLAKE2b-256 1d5ea0e0d7ad3ff473f721dcb7e52c6d7af18b5e73d91d71efba5d1726100f3e

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