Skip to content

n8n Code Tool skill

Write agent-callable n8n Custom Code Tools with query input and string output.

Community · Romuald Członkowski
AuthorRomuald Członkowski
LicenceMIT
Sourceczlonkowski/n8n-skills · SKILL.md on GitHub
Project websitedocs.n8n.io
Works inClaude Code · Codex, Gemini CLI, Cursor, Copilot
Read from the source on

n8n Code Tool skill: Write agent-callable n8n Custom Code Tools with query input and string output.

Distinguish the agent tool sandbox from workflow Code nodes and design structured tool arguments.

From the skill's SKILL.md: # n8n Custom Code Tool

This is a community skill by Romuald Członkowski, not checked by us or by Anthropic. Skills can tell the agent to run code, read files or call the network. Before installing, read its SKILL.md and every script in the folder, and look for anything that does not match what it says it does.

What it does

  1. Distinguish the agent tool sandbox from workflow Code nodes and design structured tool arguments.

What you get

  • Code Tool snippets, input-schema plans and fixes for wrong output types.

When to use it

  • Fix this Code Tool that returns an array instead of a string.

When not to use it

  • Treating instructions as a guarantee that a remote service, validation or deployment has succeeded.

What it needs

  • A compatible n8n-mcp server and actual workflow data. Live management needs an authorized n8n instance; connected services and hosting can have separate costs.

Files in the skill

File or folderWhat it is for
SKILL.mdEntry instructions and task-specific workflow.
INPUT_SCHEMA.mdCompanion reference used by this workflow.
ERROR_PATTERNS.mdCompanion reference used by this workflow.

Licence as found in the repository on 2026-11-17: MIT.

Example prompts

Type one of these after installing; naming the skill makes sure it is used.

  • Fix this Code Tool that returns an array instead of a string.
  • Define structured arguments for this agent-callable calculation.
  • Replace unavailable $fromAI or $input access in this tool.

How to install n8n-code-tool

Prepare the workflow

The website link is n8n product documentation, not the community MCP server installer. Install n8n-mcp separately; hosting and connected services may cost money. Review plugin hooks before installation.

Claude Code plugin hooks are not installed by copying a skill folder to another agent. Check the live tool schema and review writes before execution.

A skill is a folder with a SKILL.md file. You install it once; the agent reads its short description at the start of each session and loads the full instructions only when a request matches. Pick the place you use:

Claude Code: from the plugin marketplace

  1. Start Claude Code in a terminal with claude.
  2. Add the marketplace (once per computer):
    /plugin marketplace add czlonkowski/n8n-skills
  3. Install the plugin. Claude Code opens its details first: check what it will add (skills, hooks, MCP servers), then choose whether it is for you, for everyone on this repository, or for you in this repository only.
    /plugin install n8n-mcp-skills@n8n-mcp-skills
  4. Type / and look for /n8n-mcp-skills:n8n-code-tool, or simply ask for the task.

From your shell instead of a session:

claude plugin marketplace add czlonkowski/n8n-skills
claude plugin install n8n-mcp-skills@n8n-mcp-skills

The plugin installs as a whole, so other skills come with it, including n8n-subworkflows, n8n-multi-instance, n8n-self-hosting, n8n-binary-and-data, n8n-node-configuration, n8n-code-javascript, n8n-workflow-patterns, using-n8n-mcp-skills, n8n-code-python, n8n-agents, n8n-expression-syntax, n8n-error-handling, n8n-validation-expert, n8n-mcp-tools-expert.

Claude Code: copy the folder into your skills folder

Put the skill's folder in ~/.claude/skills/ to use it in every project on this computer, or in .claude/skills/ inside a repository to share it with everyone who works there (commit it).

git clone --depth 1 https://github.com/czlonkowski/n8n-skills.git
mkdir -p ~/.claude/skills
cp -R n8n-skills/skills/n8n-code-tool ~/.claude/skills/

Claude Code notices new or changed skills in these folders during the session. If the skills folder did not exist when the session started, run /reload-skills once. Then type /n8n-code-tool or just describe the task.

On Windows, run the commands in Git Bash or WSL, or copy the folder into the same place with File Explorer.

Codex, Gemini CLI, Cursor and GitHub Copilot

These agents read the same SKILL.md folders. The one folder all four accept inside a project is .agents/skills/, so this copies the skill there:

git clone --depth 1 https://github.com/czlonkowski/n8n-skills.git
mkdir -p .agents/skills
cp -R n8n-skills/skills/n8n-code-tool .agents/skills/
AgentProject folderYour user folderNotes
OpenAI Codex
.agents/skills/
~/.agents/skills/
Type $ or run /skills to pick a skill; Codex also chooses one when your task matches.
Gemini CLI
.agents/skills/
.gemini/skills/
~/.agents/skills/
~/.gemini/skills/
Or install from Git with gemini skills install <git URL> --path <folder> --consent. Google replaced Gemini CLI with Antigravity CLI for free-tier and Google One users on 18 June 2026; Antigravity uses .agents/skills/ in a project and ~/.gemini/config/skills/ for you.
Cursor
.agents/skills/
.cursor/skills/
~/.agents/skills/
~/.cursor/skills/
Type / in Agent chat to pick a skill. Cursor also reads Claude Code's .claude/skills/ folders.
GitHub Copilot
.github/skills/
.agents/skills/
.claude/skills/
~/.copilot/skills/
~/.agents/skills/
Works in Copilot CLI, the cloud agent, and agent mode in VS Code, Visual Studio and JetBrains (IDE support depends on the version). Or run gh skill install OWNER/REPOSITORY SKILL (public preview, GitHub CLI 2.90.0 or later).
Only install skills you trust. Anthropic's advice is to use skills only from trusted sources, and to read every file of any other skill before using it: a skill can direct the agent to run commands, read files or send data in ways its description does not mention.

Sources for these steps

Checked against each vendor's documentation on 2026-11-14:

Input contract

Plain tools receive a query; structured tools validate named arguments. Match the schema to the actual incoming value and give the tool a descriptive name.

Tool boundary

Do not copy workflow Code-node boilerplate into a tool. Verify string output and ai_tool wiring with the kind of input the agent will actually send.

Questions about n8n-code-tool

Does this website execute the skill?

No. This is a source-based installation guide. Your agent runs the skill in its own configured environment.

Are full cloud workflows verified here?

No. Generic cloud upload and API execution steps are omitted; source-specific local requirements and host capabilities still apply.

Does a Code Tool return JSON items?

No. JavaScript reads query and Python reads _query. Return a string, using JSON serialization for structured results.

Can it use normal Code-node helpers?

No. $input, $json, $helpers and $fromAI are not part of this sandbox contract. Use a sub-workflow or HTTP Request Tool when needed.

More AI skills

Related skills

Skill categories