Agent skill

n8n Multi-Instance Targeting

by czlonkowski in czlonkowski/n8n-skills

Keeps an n8n MCP session pointed at the right n8n instance, with rules for discovering, switching and verifying the target before credential writes and for recovering from misroutes.

MITAuto-check passedProductivity & Automation

Install n8n Multi-Instance Targeting

skills CLI
$ npx skills add czlonkowski/n8n-skills --skill n8n-multi-instance -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install czlonkowski/n8n-skills n8n-multi-instance --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/czlonkowski/n8n-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/n8n-multi-instance .claude/skills/n8n-multi-instance && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
n8n-multi-instance
GitHub stars
6.4k
Token cost
~3.2k tokens
SKILL.md length
1,468 words
Files
2
Skills in repo
15
Repo updated
First seen
Licence
MIT

At a glance

Keeps an n8n MCP session pointed at the right n8n instance, with rules for discovering, switching and verifying the target before credential writes and for recovering from misroutes.

  • Works in 6 steps: Discover first. Call… → Switch by name to your target before… → Switch in its own turn. Never put a… → …
  • Working with prod and staging n8n instances over one MCP connection
  • SKILL.md covers Golden rules, Core workflow, The n8n_instances tool and How targeting behaves (mental…, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

When the n8n_instances tool is present, one MCP connection can reach several n8n instances, such as prod and staging, and every other n8n tool acts on whichever instance the session currently targets. There is no per-call instance argument, so a wrong target usually returns wrong data or lands a write in the wrong place without any error. If the tool is absent, the account is single-instance and the skill does not apply.

Six rules govern the work. List the instances first. Switch by name, case-insensitively, before working on a non-default instance, and do the switch in its own turn rather than in the same parallel batch as a dependent call. Verify the current instance right before credential changes or destructive workflow edits. Treat an unexpected NOT_FOUND as a likely misroute, not a deletion, and do not recreate the object. On INSTANCE_AMBIGUOUS, switch on this session and retry, because the system refuses to write a secret when the session never chose a target.

When your agent uses it

  • Working with prod and staging n8n instances over one MCP connection
  • Switching which n8n instance the current session targets
  • Verifying the target before creating or deleting credentials
  • Recovering from an unexpected NOT_FOUND or an INSTANCE_AMBIGUOUS error

Example prompts

  • “List my n8n instances and switch to staging before you edit the order-sync workflow.”
  • “Creating the Slack credential failed with INSTANCE_AMBIGUOUS, so pick the client instance and retry.”
  • “Why does n8n_get_workflow return NOT_FOUND for a workflow I know exists? Check which instance we are on.”

Requirements

  • An n8n-mcp account with the n8n_instances tool available
  • Two or more n8n instances configured on the account

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Discover first. Call n8n_instances({mode:"list"}) before acting so you know the instance
  2. Switch by name to your target before doing work on a non-default instance
  3. Switch in its own turn. Never put a switch and a dependent operation in the **same
  4. Verify before high-stakes ops. Immediately before creating/updating/deleting credentials
  5. An unexpected NOT_FOUND is almost always a wrong-instance misroute, not a deletion. Don't
  6. On INSTANCE_AMBIGUOUS, switch on this session, then retry. The system is refusing to

What it can do on your machine

Read from SKILL.md and the folder at commit 19cd793. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

n8n Multi-Instance Targeting loads about 3.2k tokens when it runs. Until then it costs about 215 tokens; SKILL.md has 1,468 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~215
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from czlonkowski/n8n-skills at commit 19cd793, republished under its MIT licence (© czlonkowski). 1,468 words, ~3,188 tokens.

Download SKILL.mdSave it as .claude/skills/n8n-multi-instance/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
n8n-multi-instance
description
Use when an n8n-mcp account targets more than one n8n instance — i.e. the `n8n_instances` tool is available, the user mentions multiple n8n instances or environments (prod vs staging, several teams or clients), a workflow / datatable / credential / execution call returns an unexpected NOT_FOUND or reads data you don't recognize, or a credential create/update/delete is refused with an `INSTANCE_AMBIGUOUS` error. Covers choosing and switching which instance this MCP session targets, verifying the target before high-stakes work — credential writes above all — and recovering from misroutes and ambiguous-write fail-closes. Always consult this skill before operating on a specific instance, before any credential create/update/delete on a multi-instance account, or when a call hits the wrong/empty data or an `INSTANCE_AMBIGUOUS` error.

Working with multiple n8n instances over MCP

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). Every other n8n tool (n8n_get_workflow, n8n_list_workflows, n8n_update_partial_workflow, n8n_manage_datatable, n8n_manage_credentials, n8n_executions, n8n_test_workflow, …) runs against whichever instance this session is currently targeting. There is no per-call instance argument: you change the target only by switching. Target the wrong instance and a read returns the wrong data and a write lands in the wrong place — usually with no error (the one exception is an ambiguous credential write, which fails closed; see below). So target deliberately.

If the n8n_instances tool is not present, the account is single-instance: ignore this skill and use the n8n tools directly.

Golden rules

Six rules. Each prevents a class of silent misroute.

  1. Discover first. Call n8n_instances({mode:"list"}) before acting so you know the instance names and which one is current.
  2. Switch by name to your target before doing work on a non-default instance: n8n_instances({mode:"switch", name:"<instance name>"}). The match is case-insensitive.
  3. Switch in its own turn. Never put a switch and a dependent operation in the same parallel tool-call batch. Calls in one batch have no guaranteed order, so the dependent call can be resolved against the previous instance before the switch's session state is visible. Switch, let it return, then operate.
  4. Verify before high-stakes ops. Immediately before creating/updating/deleting credentials (and before destructive workflow edits), confirm current is the instance you intend — primary check is n8n_instances({mode:"list"}). The system fail-closes only the ambiguous credential case (rule 6); an explicit switch to the wrong instance still writes there silently, so this check is on you.
  5. An unexpected NOT_FOUND is almost always a wrong-instance misroute, not a deletion. Don't recreate the object. Re-check the current instance and retry (see Recovery).
  6. On INSTANCE_AMBIGUOUS, switch on this session, then retry. The system is refusing to write a secret because this session never picked a target itself. Comply — run switch here to confirm the instance, then retry the write. Don't work around it or retry blindly.

Core workflow

1. n8n_instances({mode:"list"})                      # see available[] + current + default
2. n8n_instances({mode:"switch", name:"prod"})       # bind THIS session to "prod"
   → returns { previous, current }; confirm current.name == "prod"
3. (do your work) n8n_list_workflows / n8n_get_workflow / n8n_manage_datatable / ...
4. Before a credential write or a delete:
   n8n_instances({mode:"list"})  → re-confirm current, THEN n8n_manage_credentials({action:"create", ...})

To move to another instance, just switch again. The whole session follows the switch.

The n8n_instances tool

Two modes (mode is required and enum-validated):

  • {mode:"list"} → { current, default, available }, 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 binds this session to the named instance. name is case-insensitive.
Error envelope (from the n8n_instances tool)

Every error returns { error: "<CODE>", message, … }. The ones you'll actually hit:

CodeWhenWhat to do
UNKNOWN_INSTANCEname matches no instancePick a name from the available list in the error payload and retry.
NAME_REQUIREDswitch with no nameRe-call with a name (the error lists the valid ones in available).
MULTI_INSTANCE_DISABLEDmulti-instance mode is offThere's nothing to switch; use the n8n tools directly. The user can enable it at the n8n-mcp dashboard.
NO_SESSIONthe request has neither an MCP session id nor a credential idA selection has nowhere to land. Reconnect / initialize a session, then switch.
UNKNOWN_MODEmode wasn't list/switchUse list or switch.
INVALID_CONTEXTserver-side metadata missingA server bug, not your input — report it.

Instance names can never be default, current, list, or switch (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)

A separate, higher-stakes error. It is not returned by n8n_instances — it's returned by the server when you call n8n_manage_credentials to create/update/delete a credential and the target instance is ambiguous: this session never switched on its own but inherited a switch made elsewhere (a fan-out / reconnect), 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:

json
{
  "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), run n8n_instances({mode:"switch", name:"…"}) on this session, then retry the write. See rule 6.

How targeting behaves (mental model)

  • A switch binds this session to the chosen instance. The binding persists for the rest of the session and survives reconnects, idle, and backend deploys (~24h, the MCP session lifetime) — you should not need to re-switch before every call.
  • Other sessions / terminals are independent: switching here does not move them.
  • One session targets one instance at a time. There is no per-call instance argument; you change the target only via switch.
  • Reads and non-credential writes route to the currently-selected instance, silently — a misroute produces wrong data or a NOT_FOUND, not an error.
  • Credential writes are the one guarded case. They route the same way, except the server fail-closes the ambiguous state (a session that never switched, recovered onto a non-default instance) with INSTANCE_AMBIGUOUS. This is a safety net, not a substitute for rule 4: an explicit switch to the wrong instance still writes there.
  • If your selected instance is deleted (the user removes it mid-session), the next call silently falls back to your default instance — no error. So default's data appearing where you expected another instance's can look like "my data vanished." Re-list to see where you are.
Show full SKILL.md (587 more words)Show less

Recovery playbook

SymptomWhat it usually meansDo this
INSTANCE_AMBIGUOUS on a credential create/update/deleteThis session never switched itself; the system won't guess which instance to write the secret toRun n8n_instances({mode:"switch", name:"<target>"}) on this session (the error names lastSelected and default — pick the one you want), then retry the write. Never retry blindly.
NOT_FOUND for a workflow/datatable/credential you know existsYou're pointed at the wrong instance — not that it was deletedn8n_instances({mode:"list"}) → check current. If it's not your target, switch and retry. Do not recreate the object.
A read returns empty or unfamiliar dataWrong-instance read, or a silent fallback to default after your instance was deletedn8n_instances({mode:"list"}), confirm current, switch if needed, re-read before drawing conclusions.
UNKNOWN_INSTANCE on switchThe name is wrong (typo, or you guessed)Read the available names in the error and switch to one of those. Names are case-insensitive.
n8n_health_check reports an instanceName you didn't expectThis session is on a different instance than you thinkswitch to the intended instance, then proceed.
Repeated misroutes within one turnYou batched a switch with dependent workSplit them: switch alone, await the result, then operate one logical step at a time.

After any recovery switch, sanity-check with n8n_instances({mode:"list"}) (read current) as the primary signal. 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.

Credential operations (highest stakes)

Credentials hold live secrets, and a misrouted credential write puts a secret on the wrong instance. The server protects the ambiguous case automatically — if this session never picked a target and inherited a switch to a non-default instance, the write fails closed with INSTANCE_AMBIGUOUS (rule 6) and never reaches n8n. But that net is narrow: a credential write on a session that did switch goes through to whatever instance it switched to, with no second guess. So:

  • Verify current immediately before n8n_manage_credentials create/update/delete — call n8n_instances({mode:"list"}) in the same short sequence, not 10 steps earlier where a later switch could have moved you.
  • On INSTANCE_AMBIGUOUS, switch on this session to confirm the target, then retry — don't work around it.
  • Credential reads (action:"list"/"get"/"getSchema") are not gated and don't write a secret, but a read off the wrong instance returns the wrong schema or list — so still verify current if the result looks wrong.
  • For the n8n_manage_credentials tool itself (CRUD shapes, getSchema discovery, never inlining secrets into text fields), see n8n-mcp-tools-expert.

Common multi-instance task: copy something between instances

To recreate a credential or workflow from instance A on instance B:

1. switch → A;  read the source (n8n_manage_credentials get / n8n_get_workflow)
2. switch → B   (its own call — never batched with the create below)
3. n8n_instances({mode:"list"})  → confirm current == B
4. create on B  (n8n_manage_credentials create / n8n_create_workflow)

Do each instance's steps in its own turn; never overlap switch → B with the create-on-B call (rule 3), and switch explicitly on this session before the credential write so it isn't ambiguous (rules 4 and 6).

Quick reference

  • See instances + where you are: n8n_instances({mode:"list"}) → { current, default, available }
  • Change target: n8n_instances({mode:"switch", name:"<name>"}) — its own turn, then operate
  • Confirm target: current from list (primary); details.instanceName from n8n_health_check (secondary, may be absent)
  • UNKNOWN_INSTANCE → switch to a name from the error's available list, then retry
  • INSTANCE_AMBIGUOUS (credential write) → switch on this session to confirm the target, then retry
  • Unexpected NOT_FOUND → verify the instance, switch, retry; do not recreate
  • Before credential writes → re-list, confirm current, then write (the fail-close only covers the ambiguous case)

Integration with other skills

  • n8n-mcp-tools-expert — owns n8n_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.
  • using-n8n-mcp-skills — the router; consult it for which skill owns a given build step.

© czlonkowski, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/n8n-multi-instance of czlonkowski/n8n-skills.

  • SKILL.md
  • README.md

Open the folder on GitHubat commit 19cd793

Compare with similar skills

n8n Multi-Instance Targeting next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

n8n Multi-Instance Targeting compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
n8n Multi-Instance Targeting this skillczlonkowski/n8n-skills6.4k—~3.2kAutomated safety check: PassMIT
Agents Onboardingfazer-ai/agents118—~4.4kAutomated safety check: PassApache-2.0
N8n MCP Tools Expertdavila7/claude-code-templates32k8 repos~3.2kAutomated safety check: PassMIT
Using N8n MCP Skillssickn33/agentic-awesome-skills47k1 repos~3.4kAutomated safety check: PassMIT
Makeericrisco/rsc-harness156—~3.1kAutomated safety check: NotesMIT
VectCutAPI Video Editingsun-guannan/VectCutAPI2.3k—~2.1kAutomated safety check: PassApache-2.0

Similar skills

  • Agents Onboarding

    fazer-ai/agents

    Conduz a jornada de onboarding 'do zero ao agente de atendimento' do fazer.ai agents num VPS, escolhendo o orquestrador de deploy (Tier A Coolify, B Portainer, C compose genérico para VM crua ou…

    118 GitHub stars~4.4k tokensUpdated today
    Productivity & AutomationAuto-check passed
  • N8n MCP Tools Expert

    davila7/claude-code-templates

    Expert guide for using n8n-mcp MCP tools effectively. An agent skill from davila7/claude-code-templates.

    32k GitHub starsUsed in 8 repos~3.2k tokens
    Productivity & AutomationAuto-check passed
  • Using N8n MCP Skills

    sickn33/agentic-awesome-skills

    Route n8n MCP workflow design, editing, validation, testing, deployment, credential, execution, and debugging tasks to specialist guidance.

    47k GitHub starsUsed in 1 repo~3.4k tokens
    Productivity & AutomationAuto-check passed
  • Make

    ericrisco/rsc-harness

    A skill your agent uses when operating Make.com (formerly Integromat) programmatically — driving its REST API v2 or the Make MCP server from code or an agent to create, read, update, activate, run…

    156 GitHub stars~3.1k tokensUpdated today
    Backend & APIsAuto-check: notes
  • VectCutAPI Video Editing

    sun-guannan/VectCutAPI

    Drives CapCut or JianYing through an HTTP and MCP API: create drafts, add video, audio, text, subtitles and effects, preview on the web and batch-produce videos.

    2.3k GitHub stars~2.1k tokensUpdated 4 days ago
    Media & CreativeAuto-check passed
  • Zapier Status

    zapier/zapier-mcp

    Official

    Check the health of your Zapier MCP setup. An agent skill from zapier/zapier-mcp.

    428 GitHub stars~1.8k tokensUpdated 2 mo ago
    Productivity & AutomationAuto-check passed

More from czlonkowski/n8n-skills

All 15 skills in this repo
  • n8n Binary Data Handling

    czlonkowski/n8n-skills

    Explains how n8n keeps file bytes in $binary apart from structured $json data, and how to read, write and preserve binary across nodes, agent tools and chat.

    6.4k GitHub stars~3.9k tokensUpdated 21 days ago
    Auto-check passed
  • n8n Code Node JavaScript

    czlonkowski/n8n-skills

    Guides writing JavaScript in n8n Code nodes: picking an execution mode, reading input data, returning items, using built-in helpers and avoiding common errors.

    6.4k GitHub stars~4.9k tokensUpdated 21 days ago
    Auto-check passed
  • Native Python in n8n Code Nodes

    czlonkowski/n8n-skills

    Explains how to write native Python in n8n Code nodes, including the two input variables, blocked imports and fixes for common errors.

    6.4k GitHub stars~2.8k tokensUpdated 21 days ago
    Auto-check passed
  • n8n Custom Code Tool Guide

    czlonkowski/n8n-skills

    Explains the n8n Custom Code Tool's actual runtime contract so an AI-agent-callable tool doesn't get written like a regular workflow Code node.

    6.4k GitHub stars~4k tokensUpdated 21 days ago
    Auto-check passed
  • n8n Error Handling

    czlonkowski/n8n-skills

    Wires n8n workflows so failures are visible and recoverable: per-node error outputs, retries, error workflows and correct 4xx and 5xx webhook responses.

    6.4k GitHub stars~5.1k tokensUpdated 21 days ago
    Auto-check passed
  • n8n Node Configuration

    czlonkowski/n8n-skills

    Explains how to configure n8n nodes correctly: which fields each operation requires, how property dependencies show or hide fields, and which get_node detail level to use.

    6.4k GitHub stars~4.5k tokensUpdated 21 days ago
    Auto-check passed

Questions about n8n Multi-Instance Targeting

What does n8n Multi-Instance Targeting do?

Keeps an n8n MCP session pointed at the right n8n instance, with rules for discovering, switching and verifying the target before credential writes and for recovering from misroutes. When the n8n_instances tool is present, one MCP connection can reach several n8n instances, such as prod and staging, and every other n8n tool acts on whichever instance the session currently targets. There is no per-call instance argument, so a wrong target usually returns wrong data or lands a write in the wrong place without any error.

When should I use n8n Multi-Instance Targeting?

n8n Multi-Instance Targeting fits situations like: working with prod and staging n8n instances over one MCP connection; switching which n8n instance the current session targets; verifying the target before creating or deleting credentials; recovering from an unexpected NOT_FOUND or an INSTANCE_AMBIGUOUS error.

How do I install n8n Multi-Instance Targeting in Claude Code?

Run `npx skills add czlonkowski/n8n-skills --skill n8n-multi-instance -a claude-code`. Or copy the skill folder (skills/n8n-multi-instance in czlonkowski/n8n-skills) into .claude/skills/n8n-multi-instance in your project. Claude Code loads it when a task matches its description.

How do I install n8n Multi-Instance Targeting in Codex?

Run `npx skills add czlonkowski/n8n-skills --skill n8n-multi-instance -a codex`. Or copy the skill folder (skills/n8n-multi-instance in czlonkowski/n8n-skills) into .agents/skills/n8n-multi-instance in your project. Codex loads it when a task matches its description.

Can I use n8n Multi-Instance Targeting in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add czlonkowski/n8n-skills --skill n8n-multi-instance -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/n8n-multi-instance, .gemini/skills/n8n-multi-instance, .github/skills/n8n-multi-instance and .opencode/skills/n8n-multi-instance in your project.

What does n8n Multi-Instance Targeting need to run?

SKILL.md names no scripts, command-line tools or credentials: n8n Multi-Instance Targeting is instructions for the agent only. Our summary lists: An n8n-mcp account with the n8n_instances tool available; Two or more n8n instances configured on the account.

Does n8n Multi-Instance Targeting access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is n8n Multi-Instance Targeting safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does n8n Multi-Instance Targeting use?

n8n Multi-Instance Targeting is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does n8n Multi-Instance Targeting use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to n8n Multi-Instance Targeting?

Skills that share tags, products or a category with n8n Multi-Instance Targeting: Agents Onboarding (fazer-ai/agents, 118 stars), N8n MCP Tools Expert (davila7/claude-code-templates, 32k stars), Using N8n MCP Skills (sickn33/agentic-awesome-skills, 47k stars) and Make (ericrisco/rsc-harness, 156 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains n8n Multi-Instance Targeting?

czlonkowski (a GitHub user) maintains it in czlonkowski/n8n-skills, which has 6,387 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on September 16, 2026.

Source: czlonkowski/n8n-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.