
n8n CLI
FreeManage n8n workflows and credentials from the command line.
Free · Opens the source repo
What n8n CLI does
The n8n CLI is a command-line tool designed to facilitate the management of n8n instances through its REST API. It allows users to interact with workflows, credentials, executions, and projects directly from the terminal, making it an essential tool for developers and automation engineers who prefer command-line interfaces. The CLI is particularly useful for automating tasks and integrating n8n with other systems or scripts, as it can auto-detect piped output and switch to JSON format seamlessly.
Setting up the n8n CLI is straightforward. Users can log in interactively, configure settings directly, or use environment variables to set up their instance URL and API key. The CLI supports various global flags for overriding configurations, specifying output formats, and filtering results, making it highly flexible for different use cases.
The tool provides comprehensive commands for managing workflows, including listing, creating, updating, and deleting workflows. Users can also activate or deactivate workflows as needed. Additionally, it allows for detailed execution management, enabling users to list, get details, retry, or stop executions. Credential management is also simplified, with commands to list, create, and delete credentials, ensuring secure handling of sensitive data.
For teams working on n8n projects, the CLI offers project management capabilities, including adding or removing team members and managing project-specific tags and variables. The composability of the CLI commands allows for powerful scripting and automation, enabling users to chain commands together for complex operations. Overall, the n8n CLI is a robust tool for developers looking to streamline their workflow management and automation processes.
When to use it
Use the n8n CLI when you need to manage n8n workflows, credentials, or executions directly from the terminal, especially in automated scripts or CI/CD pipelines.
When not to use it
The n8n CLI may not be suitable for users who prefer graphical interfaces or those who do not require command-line automation for their n8n instances.
What you can build with it
Automating Workflow Management
Use the n8n CLI to automate the creation and management of workflows in a CI/CD pipeline.
Credential Management
Quickly create and manage API credentials for various services used within n8n.
Execution Monitoring
List and monitor recent executions of workflows to troubleshoot issues directly from the command line.
How to install n8n CLI
View source1. Install with the skills CLI
npx skills add n8n-io/n8n/n8n-cli --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by n8n-ion8n CLI
The n8n-cli command-line tool manages an n8n instance via its REST API.
It auto-detects piped output and switches to JSON, making it composable for scripts and LLM tool use.
Setup
# Interactive login (saves to ~/.n8n-cli/config.json)
n8n-cli login
# Or configure directly
n8n-cli config set-url https://my-instance.n8n.cloud
n8n-cli config set-api-key n8n_api_...
# Or use environment variables (no config file needed)
export N8N_URL=https://my-instance.n8n.cloud
export N8N_API_KEY=n8n_api_...
Global Flags
Every command supports these flags:
| Flag | Short | Description |
|---|---|---|
--url | -u | Instance URL (overrides config/env) |
--apiKey | -k | API key (overrides config/env) |
--format | -f | Output format: table, json, id-only |
--json | Shorthand for --format=json | |
--jq | jq-style filter (implies --json), e.g. '.[0].id', '.[].name' | |
--quiet | -q | Suppress output |
--no-header | Hide table headers (for awk/cut parsing) | |
--debug | Print HTTP details to stderr |
Auto-JSON: When stdout is piped (not a TTY), output defaults to JSON automatically.
Workflows
# List all workflows
n8n-cli workflow list
# Filter workflows
n8n-cli workflow list --active
n8n-cli workflow list --tag=production
n8n-cli workflow list --name="My Workflow"
n8n-cli workflow list --limit=5
# Get a single workflow (full JSON with nodes and connections)
n8n-cli workflow get <id>
# Extract just node names from a workflow
n8n-cli workflow get <id> --jq '.nodes[].name'
# Create a workflow from JSON
n8n-cli workflow create --file=workflow.json
cat workflow.json | n8n-cli workflow create --stdin
# Update a workflow
n8n-cli workflow update <id> --file=updated.json
cat updated.json | n8n-cli workflow update <id> --stdin
# Activate / deactivate
n8n-cli workflow activate <id>
n8n-cli workflow deactivate <id>
# Delete a workflow
n8n-cli workflow delete <id>
# Transfer to another project
n8n-cli workflow transfer <id> --project=<projectId>
# List tags on a workflow
n8n-cli workflow tags <id>
Executions
# List recent executions
n8n-cli execution list
n8n-cli execution list --workflow=<id> --status=error --limit=10
# status options: canceled, error, running, success, waiting
# Get execution details
n8n-cli execution get <id>
n8n-cli execution get <id> --include-data # includes full node I/O
# Retry a failed execution
n8n-cli execution retry <id>
# Stop a running execution
n8n-cli execution stop <id>
# Delete an execution
n8n-cli execution delete <id>
Credentials
# List credentials
n8n-cli credential list
# Get credential metadata (not secrets)
n8n-cli credential get <id>
# Get the schema for a credential type (shows required fields)
n8n-cli credential schema notionApi
n8n-cli credential schema slackOAuth2Api
# Create a credential
n8n-cli credential create --type=notionApi --name='My Notion' --data='{"apiKey":"..."}'
n8n-cli credential create --type=notionApi --name='My Notion' --file=cred.json
cat cred.json | n8n-cli credential create --type=notionApi --name='My Notion' --stdin
# Delete / transfer
n8n-cli credential delete <id>
n8n-cli credential transfer <id> --project=<projectId>
Tip: Use credential schema <type> to discover required fields before creating.
Projects
n8n-cli project list
n8n-cli project get <id>
n8n-cli project create --name="My Project"
n8n-cli project update <id> --name="New Name"
n8n-cli project delete <id>
# Team management
n8n-cli project members <id>
n8n-cli project add-member <id> --user=<userId> --role=<role>
n8n-cli project remove-member <id> --user=<userId>
Tags
n8n-cli tag list
n8n-cli tag create --name=production
n8n-cli tag update <id> --name=staging
n8n-cli tag delete <id>
Variables
n8n-cli variable list
n8n-cli variable create --key=API_ENDPOINT --value=https://api.example.com
n8n-cli variable update <id> --key=API_ENDPOINT --value=https://new-api.example.com
n8n-cli variable delete <id>
Data Tables
# CRUD
n8n-cli data-table list
n8n-cli data-table get <id>
n8n-cli data-table create --name=Inventory --columns='[{"name":"item","type":"string"},{"name":"qty","type":"number"}]'
n8n-cli data-table delete <id>
# Row operations
n8n-cli data-table rows <id>
n8n-cli data-table add-rows <id> --file=rows.json
n8n-cli data-table update-rows <id> --file=rows.json
n8n-cli data-table upsert-rows <id> --file=rows.json
n8n-cli data-table delete-rows <id> --ids=row1,row2,row3
# All row commands support --stdin
cat rows.json | n8n-cli data-table add-rows <id> --stdin
Users
n8n-cli user list
n8n-cli user get <id>
Other
# Security audit
n8n-cli audit
n8n-cli audit --categories=credentials,nodes
# Source control
n8n-cli source-control pull
# View config
n8n-cli config show
Composability Patterns
The CLI is designed to be piped and composed:
# Get all workflow IDs
n8n-cli workflow list --jq '.[].id'
# Get the name of the first workflow
n8n-cli workflow list --jq '.[0].name'
# Export a workflow to a file
n8n-cli workflow get 1234 --json > workflow-backup.json
# Find failing executions for a workflow
n8n-cli execution list --workflow=1234 --status=error --json
# Pipe workflow JSON for modification
n8n-cli workflow get 1234 --json | jq '.name = "Updated Name"' | n8n-cli workflow update 1234 --stdin
# Table output without headers for shell parsing
n8n-cli workflow list --no-header | awk '{print $1}'
# Debug API calls
n8n-cli workflow list --debug 2>debug.log
Workflow JSON Structure
When creating or updating workflows, the JSON follows this structure:
{
"name": "My Workflow",
"nodes": [
{
"name": "Start",
"type": "n8n-nodes-base.manualTrigger",
"position": [250, 300],
"parameters": {}
},
{
"name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"position": [450, 300],
"parameters": {
"url": "https://api.example.com/data",
"method": "GET"
}
}
],
"connections": {
"Start": {
"main": [[{ "node": "HTTP Request", "type": "main", "index": 0 }]]
}
}
}
Key points:
nodes[].typefollows the patternn8n-nodes-base.<nodeName>for built-in nodesconnectionsis keyed by source node name, withmainoutput arrays- Each connection specifies target
node,type(usuallymain), and outputindex - Use
workflow get <id> --jsonto see real examples from the instance
Frequently asked questions about n8n CLI
Similar skills
Spring Boot Testing
Master testing techniques for Spring Boot 4 applications.
GitHub Issues
Manage GitHub issues efficiently with MCP tools.
Geofeed Tuner
Optimize your IP geolocation feeds in CSV format.
Batch Files
Master Windows batch scripting for automation and task management.
Adobe Illustrator Scripting
Automate your Illustrator workflows with ExtendScript.
Plugin Structure
Create and organize Claude Code plugins effectively.
