Back to Library
Stage 02 / Setup

n8n CLI Toolkit.

Full command-line control of your n8n instance, for you and your agents. Create, edit, debug, and monitor workflows without clicking through the UI. 80+ commands, a built-in catalog of 543 nodes you can search and inspect, multi-instance profiles, and zero external dependencies. Python stdlib only.

What you'll have
  • n8n that you can grep and script list, diff, and bulk-activate workflows from the terminal instead of clicking through the editor.
  • An agent that debugs your runs ask Claude which workflows failed in the last day and why, and it pulls the executions and groups the errors.
  • One toolkit, every instance named profiles switch between n8n Cloud and self-hosted with a flag, so your environments stay separate.
4D Setup
Build time ~5 min
Track 4D required, 8D extensible
Touches n8n-cli, Workflows, Executions, Credentials, 543-node catalog
Source blueprints/n8n-cli-toolkit/
One-click start

Connect it with Claude.

Paste this into Claude Code. Claude reads the local blueprint, installs the CLI, and walks you through pointing it at your n8n instance, then confirms the connection before doing anything else.

How this fits in the OS.

Depends on

Python, an n8n instance (Cloud or self-hosted), an n8n API key, and the blueprints/n8n-cli-toolkit/ files in your local workshop repo.

Uses

A zero-dependency Python CLI, n8n-cli, that talks to the n8n REST API. This is a CLI path, not an MCP path. The agent calls it through Bash.

Unlocks

Your agent can create workflows from a description, debug failed executions, audit credentials, and back up an instance, all from the terminal.

What changes for you.

n8n's visual editor is great for building, but slow for managing at scale. When you have dozens of workflows, you want to treat them like code.

  • You stop hunting through tabs. Grep your workflows, diff them, and bulk-activate them from one place.
  • Your agent debugs for you. "Which workflows failed in the last 24 hours?" returns grouped errors and likely causes.
  • Your environments stay separate. Named profiles keep Cloud and self-hosted instances from getting crossed.

Before you start.

Three things specific to this build

  • An n8n instance you can reach, either n8n Cloud or a self-hosted instance.
  • Python 3.9 or newer. The toolkit has zero external dependencies, just stdlib.
  • 1Password or Infisical ready for your n8n API key. You will never paste it into Claude chat.
Zero dependencies on purpose

The CLI is Python stdlib only. No requests, no click, no rich. That keeps it portable and easy for an agent to call from Bash on any machine.

The build.

Four checkpoints. It is plug and play. The agent runs the commands, but you create the API key and type it in yourself.

Step 01

Get your n8n API key

2 min

In your n8n instance, create an API key and note your instance URL:

Do in n8n

Settings, then n8n API, then Create an API key. Copy the key and your instance URL, for example https://yourname.app.n8n.cloud.

Step 02

Install the CLI

1 min

Let Claude install the toolkit:

Paste into Claude Code

Read blueprints/n8n-cli-toolkit/ and install the n8n-cli for me. It is Python stdlib only, so there are no extra dependencies to manage.

Step 03

Configure a profile

2 min

Point the CLI at your instance with a named profile:

Run in terminal n8n-cli config set-profile main --url YOUR_INSTANCE_URL --key YOUR_API_KEY --default
Claude offers to enter your key? Say no. Type the API key yourself. The config file should be readable only by you.
Step 04

Confirm the connection

2 min

Check the connection, then do one safe read:

Run in terminal n8n-cli health

Then ask Claude: "List my workflows and tell me which ones failed in the last 24 hours."

If health shows your instance and a list command returns your real workflows, your n8n CLI Toolkit is connected.

When it works.

You know the connection is real when four things happen in order:

  1. n8n-cli health reports your instance. Health and active workflow count come back.
  2. A list command returns your workflows. The CLI can read your instance.
  3. The node catalog searches. You can inspect any of the 543 nodes without opening a browser.
  4. Claude can act on a plain-English request. "Create a workflow that posts new Typeform responses to Slack" turns into a real workflow.

If you get stuck.

Common failure modes, ranked by how often they waste time:

  • Health check fails with an auth error. Recheck the API key and instance URL in your profile.
  • Wrong instance. If you manage more than one, confirm you are using the right --profile.
  • Self-hosted URL refused. Make sure the instance is reachable from your machine and the API is enabled.
  • Key in git. Stop. Move it to 1Password/Infisical or an env var, then re-run git status --short.

Where to go next.

Once n8n is connected, these are the natural next moves.

Back to the Library