/n8n-mcp-skills:n8n-multi-instancefrom n8n-mcp-skills
Guides working with multiple n8n instances via MCP. Covers naming instances on calls, switching defaults, and recovering from misroutes. Essential when n8n_instances tool is available or you see INSTANCE_AMBIGUOUS errors.
Ships in n8n-mcp-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
When the n8n_instances tool is available, the user has multi-instance mode on: one MCP
connection can reach several n8n instances (e.g. prod, staging, or one per client/team).
There are two ways to say which instance a call should hit:
n8n_get_workflow, n8n_list_workflows,
n8n_update_partial_workflow, n8n_manage_datatable, n8n_manage_credentials,
n8n_executions, n8n_test_workflow, n8n_health_check, …) takes an optional
instance: "<name>". It routes that one call and changes nothing else. Prefer this.switch — n8n_instances({mode:"switch", name}) sets the instance used
by calls that don't name one.The default is shared more widely than it looks. On claude.ai (and other hosted connectors) one
connection serves every chat and agent using it, so a switch in one chat moves all the
others too — and their next unnamed call silently lands on your instance. A wrong target is
usually silent: a read returns the wrong data and a write lands in the wrong place. So name the
instance.
If the n8n_instances tool is not present, the account is single-instance: ignore this skill
and use the n8n tools directly.
Availability. The
instanceargument needs hosted n8n-mcp backend 0.1.120+ / n8n-mcp 2.94.0+. It is there when the n8n tools' input schemas list aninstanceproperty (and then8n_instanceslist output carries ahintabout it). If it isn't listed, the server predates it: fall back toswitch, in its own turn, as described under Switching.
n8n_instances({mode:"list"}) so you know the exact instance names and
which one is current. Never guess a name.current, or alongside other agents/chats on the same
account: n8n_list_workflows({instance:"prod"}). Names are case-insensitive. Pass the name the
same way on every call of the task; there is nothing to "set up" first.instance you name is never silently replaced. An unknown name fails with
INSTANCE_NOT_FOUND and lists the available names — pick one from that list and retry. It
never falls back to another instance.switch only to change the default, and only when you're the sole user of the
connection. Switch in its own turn — never in the same parallel batch as a call that depends
on it (batch order isn't guaranteed).n8n_manage_credentials({action:"create", …, instance:"prod"}). A named write is explicit, so it is never INSTANCE_AMBIGUOUS. Check the name
against list first — naming the wrong instance writes the secret there.NOT_FOUND is almost always a wrong-instance misroute, not a deletion. Don't
recreate the object. Retry with instance set to where it lives (see Recovery).1. n8n_instances({mode:"list"}) # names, current, default
2. n8n_list_workflows({instance:"client-a"}) # read on client-a
3. n8n_get_workflow({id:"…", instance:"client-b"}) # read on client-b — no switch needed
4. n8n_update_partial_workflow({id:"…", operations:[…], instance:"client-b"})
5. Credential write:
n8n_manage_credentials({action:"create", name:"…", type:"…", data:{…}, instance:"client-a"})
Every call names its target, so it doesn't matter what any other chat switched to in between, and calls can safely run in the same parallel batch even when they target different instances.
instance argumentn8n_instances list (available[].name), matched
case-insensitively. Not the id, not the URL — the same URL can be registered under several names.current or the default
for anyone.switch on this connection, or the
account default.INSTANCE_NOT_FOUND (the call never reaches n8n, no quota charged) when:
available;{
"error": "INSTANCE_NOT_FOUND",
"message": "No n8n instance named \"clinet-a\". Pass one of the available names as `instance`, …",
"available": ["client-a", "client-b"]
}
n8n_instances itself doesn't take instance — it has its own name argument for switch.
n8n_instances toolTwo modes (mode is required and enum-validated):
{mode:"list"} → { current, default, available, hint }, no side effects.
current and default are each one instance { id, name, url, isDefault } (or null).available is every instance, each with an extra isCurrent boolean. Match by name;
never hard-code id.{mode:"switch", name:"<name>"} → { previous, current }, and sets the default for calls that
don't name an instance. name is case-insensitive.n8n_instances tool)Every error returns { error: "<CODE>", message, … }. The ones you'll actually hit:
| Code | When | What to do |
|---|---|---|
UNKNOWN_INSTANCE | switch name matches no instance | Pick a name from the available list in the error payload and retry. |
NAME_REQUIRED | switch with no name | Re-call with a name (the error lists the valid ones in available). |
MULTI_INSTANCE_DISABLED | multi-instance mode is off | There's nothing to switch; use the n8n tools directly. The user can enable it at the n8n-mcp dashboard. |
NO_SESSION | the request has neither an MCP session id nor a credential id | A selection has nowhere to land. Reconnect / initialize a session, then switch — or just name the instance on each call. |
UNKNOWN_MODE | mode wasn't list/switch | Use list or switch. |
INVALID_CONTEXT | server-side metadata missing | A server bug, not your input — report it. |
Instance names can never be
default,current,list, orswitch(reserved), so you'll never see an instance literally named after a mode or field.
INSTANCE_AMBIGUOUS (from the credential-write path, not the tool)Returned when you call n8n_manage_credentials (or an n8n_manage_agents write) without
instance, and the default this call inherited is ambiguous: this session never switched on its own
but picked up a switch made elsewhere, pointing at a non-default instance. Rather than risk
writing a secret to the wrong instance, the server blocks the write (it never reaches n8n, no
quota is charged) and returns:
{
"error": "INSTANCE_AMBIGUOUS",
"message": "… the session issuing this request never switched there itself … Re-run n8n_instances({mode:\"switch\", name:\"…\"}) on this session to confirm the target …",
"lastSelected": { "id": "…", "name": "…" },
"default": { "id": "…", "name": "…" }
}
Fix: decide which instance you actually want (lastSelected is the inherited switch, default
is the account default) and retry the write with instance:"<that name>". (On a server without
the instance argument, run n8n_instances({mode:"switch", name:"…"}) on this session, then retry.)
switch on this connection, else the account
default.switch persists across reconnects, idle and backend deploys (~24h, the MCP session lifetime).instance route to the default silently — a misroute
produces wrong data or a NOT_FOUND, not an error.INSTANCE_NOT_FOUND.Use switch when the user asks to change "the" instance, or on an older server without the
instance argument.
1. n8n_instances({mode:"switch", name:"prod"}) # its own turn
→ returns { previous, current }; confirm current.name == "prod"
2. (then, in a later turn) the unnamed calls
3. Before a credential write: n8n_instances({mode:"list"}) → re-confirm current, then write
Never batch the switch with the work that depends on it, and remember it moves every chat sharing the connection.
| Symptom | What it usually means | Do this |
|---|---|---|
INSTANCE_NOT_FOUND | The instance name is wrong (typo, guess, or the instance was removed) | Pick a name from the error's available list and retry. Never drop instance to "make it work" — that silently runs it on the default. |
INSTANCE_AMBIGUOUS on a credential create/update/delete | An unnamed secret write on a session that never chose a target | Retry the write with instance:"<target>" (the error names lastSelected and default — pick the one you want). Never retry blindly. |
NOT_FOUND for a workflow/datatable/credential you know exists | You're pointed at the wrong instance — not that it was deleted | Retry with instance set to where it lives (check names with list). Do not recreate the object. |
| A read returns empty or unfamiliar data | An unnamed call went to a default someone else moved, or fell back after your instance was deleted | Re-run the read with instance:"<name>" before drawing conclusions. |
UNKNOWN_INSTANCE on switch | The name is wrong | Read the available names in the error and switch to one of those. |
n8n_health_check reports an instanceName you didn't expect | Your unnamed calls are going somewhere else | Name the instance on your calls (or switch if you own the connection). n8n_health_check({instance:"…"}) confirms a name resolves. |
To confirm where unnamed calls go, read current from n8n_instances({mode:"list"}) (primary).
n8n_health_check also returns the resolved instance under details.instanceName, but it can be
absent on some paths (legacy/chat), so treat it as a secondary confirmation.
Credentials hold live secrets, and a misrouted credential write puts a secret on the wrong instance. So:
n8n_manage_credentials({action:"create", …, instance:"client-a"}). Take the name from list —
a named write to the wrong instance still writes there.instance, the write goes to the default, which other chats may have moved. The server
only catches the ambiguous case (INSTANCE_AMBIGUOUS); an unnamed write after someone else's
explicit switch goes through to their instance.action:"list"/"get"/"getSchema") don't write a secret, but a read off
the wrong instance returns the wrong schema or list — name the instance there too.n8n_manage_credentials tool itself (CRUD shapes, getSchema discovery, never inlining
secrets into text fields), see n8n-mcp-tools-expert.To recreate a credential or workflow from instance A on instance B:
1. read the source on A: n8n_get_workflow({id:"…", instance:"A"})
(credentials: n8n_manage_credentials({action:"get", id:"…", instance:"A"}))
2. create it on B: n8n_create_workflow({…, instance:"B"})
(credentials: n8n_manage_credentials({action:"create", …, instance:"B"}))
3. verify on B: n8n_get_workflow({id:"<new id>", instance:"B"})
No switching, so nothing can move the target between the read and the write. n8n doesn't return credential secret values, so for a credential the user supplies them again for the create on B.
n8n_instances({mode:"list"}) → { current, default, available, hint }instance:"<name>" to any n8n tool call — preferredn8n_instances({mode:"switch", name:"<name>"}), its own turn; shared by every chat on a hosted connectionINSTANCE_NOT_FOUND → use a name from the error's available listINSTANCE_AMBIGUOUS (unnamed credential write) → retry with instance:"<target>"NOT_FOUND → retry with the right instance; do not recreateinstance property in the tool schemas → older server: switch in its own turn, verify current before credential writesn8n_manage_credentials (CRUD + getSchema) and the rule that
secrets go through the credential system, never text fields. This skill adds the "which instance?"
layer on top.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
15 skills in this plugin
/n8n-agentsDesign n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain, Text Classifier, or Information Extractor — and whenever the user mentions AI agents, LLM with tools, tool calling, $fromAI, system prompts, agent memory, sessionId, structured/JSON output, output parser, RAG, vector store, a chat assistant/bot, or human-in-the-loop review. Covers Agent-vs-chain-vs-classifier choice, the model/memory/tools/outputParser slots, tool names/descriptions as prompt, structured output with autoFix, memory, RAG, human review, and chat topologies./n8n-binary-and-dataHandle files and binary data in n8n correctly. Use when working with files, images, PDFs, attachments, uploads or downloads, base64, vision/multimodal input, or when an AI agent needs a file as tool input or output — and whenever the user mentions $binary, binaryPropertyName, "read the PDF", "attach the file", "send the image", Merge losing binary, or a CDN for chat images. Covers the $binary vs $json split, reading/writing binary, keeping binary alive across transforms with Merge, the agent-tool binary boundary, and the CDN/URL requirement for chat surfaces./n8n-code-javascriptWrite, review, or debug JavaScript in an n8n Code node. Use when a Code node is already in the workflow (editing it, fixing an error, choosing its mode, making it faster), or when a new one is justified: no native node fits (check the job-to-node table in using-n8n-mcp-skills first) and the job is on the closed list — loops or recursion no node expresses, state across runs, parsing no node handles, an allowlisted library, heavy all-items work, or one short node replacing 4+ glue nodes. Covers $input/$json/$node in code, this.helpers, Luxon, SplitInBatches loops, cross-iteration data, pairedItem, per-item performance, and the "Why Code:" note. Filtering, totals, dedupe, sorting, joins, file formats and API paging have native nodes (Filter, Summarize, Remove Duplicates, Sort, Merge, Extract From File, HTTP Request): see n8n-node-configuration. EXCEPTION — for the AI-agent-callable Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode), use n8n-code-tool; it has a different runtime contract./n8n-code-pythonWrite Python in n8n Code nodes (native Python, `language` pythonNative, n8n 2.x). Use when the user explicitly wants Python in a Code node, when migrating old Pyodide/"Python (Beta)" code that used _input/_json/_node/_now, or when a Python Code node fails with NameError, "Security violations detected", "Import of standard library module … is disallowed", "__build_class__ not found", "A 'json' property isn't a dictionary", or "Python runner unavailable". Covers the only two variables (_items/_item), dict-only access, imports blocked by default, the sandbox's denied builtins, accepted return shapes, and how errors interact with onError. JavaScript is the default for Code nodes — native Python has no n8n helpers and, by default, no imports. EXCEPTION — for Python in the AI-agent-callable Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode), use the n8n-code-tool skill instead (input is _query, return must be a string)./n8n-code-toolWrite JavaScript or Python for the n8n Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode) — the AI-agent-callable tool, NOT the workflow Code node. Use when building a Code Tool attached to an AI Agent, writing code that an LLM will invoke, parsing the `query` input, returning a string result, defining an input schema for structured arguments (specifyInputSchema, jsonSchemaExample, DynamicStructuredTool), or troubleshooting errors like "Wrong output type returned", "No execution data available", "The response property should be a string, but it is an object", "Cannot assign to read only property 'name'", or an AI agent that refuses to call the tool. Covers the critical differences between Code node and Code Tool: return format (string vs `[{json:{...}}]`), unavailability of `$fromAI`/`$input`/`$helpers` in the Code Tool sandbox, naming rules for AI invocation, and when to use `toolWorkflow`/HTTP Request Tool instead./n8n-error-handlingWire n8n error handling so failures are loud, structured, and recoverable. Use when building any webhook/API workflow, a scheduled or unattended workflow, or any path where a silent failure would drop user-visible work — and whenever the user mentions error handling, onError, continueErrorOutput, error branches/outputs, retries, retryOnFail, Respond to Webhook status codes, 4xx/5xx, Error Trigger, or "my workflow fails silently". Covers per-node error outputs and wiring, retry/self-healing, error-trigger workflows, and 4xx/5xx response shapes.npx claudepluginhub czlonkowski/n8n-skills --plugin n8n-mcp-skillsOther plugins' skills for the same job