Skip to content
SkillModel-led3,907 tokens in use

n8n Code Tool

A guide to the n8n Custom Code Tool that AI agents call: string in and string out, the query variable, input schemas, sandbox limits and the three signature errors.

6,686 stars on the repository MIT Licenseczlonkowski/n8n-skills · skills/n8n-code-tool
/plugin install czlonkowski/n8n-skills
View source

Install command as written in the repository's README

Skill label

measured from its files

What installing n8n Code Tool costs

220tokens idle
3,907tokens in use
7,360tokens, up to

Idle is what sits in context while the skill is installed. In use is its instructions, loaded when it runs. Up to adds the files its instructions link. Counts are approximate, made offline with cl100k_base.

Model dependence Model-led

Script-ledMixedModel-led

Mostly instructions, so how well it works depends on the model that follows them.

This describes the skill's structure, how much of it is scripts. It does not say how well it works.

Touches

Nothing detected: no shell, network, file writes, git or credentials in its files.

Declared tags come from the skill's frontmatter; detected ones from its scripts, its code blocks and the commands it names in inline code. This is detected, not audited.

How it scores

Quality

How well the skill is written, counted from its own files: its frontmatter, its steps, examples, stated output and constraints, its size and whether every file it ships is one it names.How we score it →
Excellent
  • Frontmatter12/15
  • Structure25/25
  • Examples15/15
  • Output10/15
  • Size13/15
  • Resources10/15

Security

Starts at 100 and loses points for each thing in the skill's files that a reader should look at first.How we score it →
Excellent

No findings.

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Good
  • Development activity88
  • Maintenance92
  • Community60
  • Maturity36
  • Momentum40

n8n Code Tool is a skill for Claude that covers the Custom Code Tool node (toolCode) an AI agent invokes. It looks like the workflow Code node but has a different contract: the input arrives as query (or _query in Python) and the result must be a string.

The skill covers unstructured input with a JSON string, structured input through specifyInputSchema, tool names and descriptions, the helpers missing from the sandbox, the common errors with their fixes and when a sub-workflow tool or HTTP Request Tool fits better.

What You Get

  • A side-by-side table of the Code node and the Custom Code Tool
  • Minimal JavaScript and Python examples for query and _query
  • Both input modes: a JSON string in unstructured mode and a validated object in structured mode
  • Fixes for Wrong output type returned, No execution data available and the object-returned-as-response error
  • A table of helpers the Code Tool sandbox does not have
  • A decision list for Code Tool, toolWorkflow and HTTP Request Tool

Common Use Cases

  • Adding a deterministic calculator or formatter to an AI agent
  • Fixing an agent that never calls its code tool
  • Switching a tool to a typed input schema so the model stops sending free text
  • Moving a tool that needs an API call or $fromAI into a sub-workflow tool

What Makes It Unique

It focuses on one node that is easy to confuse with the Code node and lists each place where the two differ. It gives error messages with causes, tells Claude to write error text for the model to read on retry, and states the rule that wanting $fromAI means choosing a sub-workflow tool.

Under The Hood

The skill is instructions and two reference markdown files, with no scripts. It tells Claude to inspect the toolCode node and validate configuration through the n8n-mcp tools against your n8n server. The code it teaches runs in a narrow sandbox with pure computation only, with no web requests, workflow items or stored state.

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers