-
Notifications
You must be signed in to change notification settings - Fork 0
Command References
These options are available for all commands:
| Option | Description |
|---|---|
--format [json|table] |
Output format (default: json) |
--no-color |
Disable colored output |
--debug |
Show full stack traces on errors |
--version |
Show version and exit |
--help |
Show help message |
Examples:
# JSON output (default)
n8n-cli workflows
# Table output
n8n-cli workflows --format table
# Disable colors (useful for logging)
n8n-cli workflows --no-color
# Debug mode for troubleshooting
n8n-cli workflows --debugConfigure n8n-cli with your n8n instance credentials.
n8n-cli configure [OPTIONS]Options:
| Option | Description |
|---|---|
--url URL |
n8n instance URL (e.g., http://localhost:5678) |
--api-key KEY |
n8n API key for authentication |
Examples:
# Interactive setup
n8n-cli configure
# Non-interactive (CI/CD)
n8n-cli configure --url http://localhost:5678 --api-key your-keyList all workflows in the n8n instance.
n8n-cli workflows [OPTIONS]Options:
| Option | Description |
|---|---|
--active |
Filter to only active workflows |
--inactive |
Filter to only inactive workflows |
--tag TAG |
Filter by tag name (can be repeated) |
Examples:
# List all workflows
n8n-cli workflows
# List only active workflows
n8n-cli workflows --active
# Filter by tag
n8n-cli workflows --tag production
# Filter by multiple tags
n8n-cli workflows --tag production --tag critical
# Table format
n8n-cli workflows --format tableOutput (JSON):
[
{
"id": "123",
"name": "My Workflow",
"active": true,
"updatedAt": "2024-01-15T10:30:00.000Z"
}
]Get detailed information about a specific workflow.
n8n-cli workflow WORKFLOW_IDExamples:
n8n-cli workflow 123Output includes: id, name, active status, nodes, connections, timestamps.
Create a new workflow from a JSON definition.
n8n-cli create [OPTIONS]Options:
| Option | Short | Description |
|---|---|---|
--file PATH |
-f |
Path to workflow JSON file |
--stdin |
Read workflow JSON from stdin | |
--name NAME |
-n |
Override the workflow name |
--activate |
-a |
Activate immediately after creation |
Examples:
# Create from file
n8n-cli create --file workflow.json
# Create and activate
n8n-cli create --file workflow.json --activate
# Create with custom name
n8n-cli create --file workflow.json --name "Production Workflow"
# Create from stdin
cat workflow.json | n8n-cli create --stdin
# Create from stdin with name
echo '{"nodes": [], "connections": {}}' | n8n-cli create --stdin --name "Empty Workflow"Update an existing workflow.
n8n-cli update WORKFLOW_ID [OPTIONS]Options:
| Option | Short | Description |
|---|---|---|
--file PATH |
-f |
Path to workflow JSON file |
--stdin |
Read workflow JSON from stdin | |
--name NAME |
-n |
Update the workflow name |
--activate |
Activate the workflow | |
--deactivate |
Deactivate the workflow |
Examples:
# Replace entire workflow definition
n8n-cli update 123 --file workflow.json
# Just rename a workflow
n8n-cli update 123 --name "New Name"
# Activate a workflow
n8n-cli update 123 --activate
# Combined: update definition, rename, and activate
n8n-cli update 123 --file workflow.json --name "My Workflow" --activateUpdate a specific parameter on a node within a workflow. This is useful for making targeted changes without handling the full workflow JSON.
n8n-cli update-node WORKFLOW_ID [OPTIONS]Options:
| Option | Short | Description |
|---|---|---|
--node-name NAME |
-n |
Name of the node to update |
--node-id ID |
-i |
ID of the node to update |
--param PATH |
-p |
Parameter path (supports dot notation) |
--value VALUE |
-v |
New value (JSON auto-detected) |
Note: Either --node-name or --node-id is required (but not both).
Examples:
# Update URL on an HTTP Request node by name
n8n-cli update-node abc123 --node-name "HTTP Request" --param "url" --value "https://api.example.com"
# Update by node ID
n8n-cli update-node abc123 --node-id "xyz789" --param "method" --value "POST"
# Update nested parameter using dot notation
n8n-cli update-node abc123 -n "HTTP Request" -p "options.timeout" -v "30000"
# Update with boolean value (auto-detected as JSON)
n8n-cli update-node abc123 -n "IF" -p "conditions.boolean[0].value1" -v "true"
# Update with JSON object
n8n-cli update-node abc123 -n "Set" -p "values" -v '{"key": "value"}'Value type detection:
- Numbers (
123,3.14) → parsed as numbers - Booleans (
true,false) → parsed as booleans - JSON objects/arrays (
{"key": "value"},[1,2,3]) → parsed as JSON - Everything else → treated as strings
Delete a workflow by ID.
n8n-cli delete WORKFLOW_ID [OPTIONS]Options:
| Option | Description |
|---|---|
--confirm |
Confirm deletion (required unless using --force) |
--force |
Force deletion without confirmation |
Examples:
# Delete with confirmation
n8n-cli delete 123 --confirm
# Force delete (for scripting)
n8n-cli delete 123 --force
# Force required for active workflows
n8n-cli delete 123 --force # if workflow is activeEnable (activate) a workflow by ID.
n8n-cli enable WORKFLOW_IDExamples:
n8n-cli enable 123Activates the workflow so it can be triggered via webhooks or schedules. This operation is idempotent.
Disable (deactivate) a workflow by ID.
n8n-cli disable WORKFLOW_IDExamples:
n8n-cli disable 123Deactivates the workflow. This operation is idempotent.
List workflow executions.
n8n-cli executions [OPTIONS]Options:
| Option | Description |
|---|---|
--workflow ID |
Filter by workflow ID |
--status STATUS |
Filter by status: success, error, running, waiting, canceled |
--limit N |
Number of results (default: 20, max: 250) |
Examples:
# List recent executions
n8n-cli executions
# Filter by workflow
n8n-cli executions --workflow 123
# Filter by status
n8n-cli executions --status error
# Combine filters
n8n-cli executions --workflow 123 --status success --limit 50Get detailed information about a specific execution.
n8n-cli execution EXECUTION_IDExamples:
n8n-cli execution 456Output includes: id, workflowId, status, timestamps, and execution data with node outputs.
Trigger workflow execution.
n8n-cli trigger WORKFLOW_ID [OPTIONS]Options:
| Option | Short | Description |
|---|---|---|
--data JSON |
-d |
JSON input data to pass to the workflow |
--file PATH |
-f |
Path to JSON file containing input data |
--wait |
-w |
Wait for execution to complete |
--timeout SECS |
-t |
Timeout in seconds when using --wait (default: 300) |
Examples:
# Simple trigger (returns immediately)
n8n-cli trigger 123
# Trigger with inline data
n8n-cli trigger 123 --data '{"email": "user@example.com"}'
# Trigger with data from file
n8n-cli trigger 123 --file input.json
# Wait for completion
n8n-cli trigger 123 --wait
# Wait with custom timeout
n8n-cli trigger 123 --wait --timeout 60
# Full example: data + wait
n8n-cli trigger 123 --data '{"key": "value"}' --wait --timeout 120Immediate output:
{
"executionId": "456"
}Output with --wait:
{
"id": "456",
"workflowId": "123",
"status": "success",
"startedAt": "2024-01-15T10:30:00.000Z",
"stoppedAt": "2024-01-15T10:30:05.000Z",
"data": { ... }
}