Agent skill · software engineering · sickn33
n8n-code-tool
Write and debug JavaScript or Python for the AI-callable n8n Custom Code Tool, including schemas, sandbox limits, and return formats.
Why this skill is useful
Provides specific guidance on writing and debugging JavaScript or Python for the n8n Custom Code Tool, including schemas and return formats that the AI wouldn't reliably generate on its own.
What it needs
About 9k tokens when loaded. Last updated 2026-08-07. 44,571 stars on the source repository.
What this skill does
n8n Custom Code Tool When to Use Use this skill specifically for code executed by the AI-agent-callable n8n Custom Code Tool. Use the separate JavaScript or Python Code-node skills for ordinary workflow Code nodes. Do not hardcode secrets or accept arbitrary executable code from untrusted input. Constrain inputs with a schema, validate outputs, allowlist any network destinations, and ask before testing a tool whose code can write data or invoke an external service. Expert guidance for writing code inside @n8n/n8n-nodes-langchain.toolCode — the tool an AI Agent can invoke, not the regular workflow Code node. --- ⚠️ This is NOT the Code node The Custom Code Tool looks like a Code node in the editor — same JavaScript editor, similar layout — but it is a completely different node from a different package with a different runtime contract. Code node Custom Code Tool --- --- --- Node type n8n-nodes-base.code @n8n/n8n-nodes-langchain.toolCode Package n8n-nodes-base @n8n/n8n-nodes-langchain Invoked by Previous node (workflow flow) AI Agent (LangChain) Input $input.all() — item stream query — string or object from LLM Return [{json: {...}}] (items array) A string $fromAI() N/A Not available (see Errors) HTTP helper this.helpers.httpRequest (auth helpers blocked) Not exposed to the tool sandbox State Per-run execution data No getContext, no $getWorkflowStaticData If you treat it like a Code node, it fails. The rest of this skill covers the Code Tool's actual contract. --- Quick Start Minimal JavaScript Code Tool Minimal Python Code Tool Essential Rules 1. Return a string. Numbers are auto-converted. Anything else throws "The response property should be a string, but it is an object". 2. Input variable is fixed: query (JS), query (Python). You cannot rename it. 3. Do NOT use $fromAI() inside the Code Tool sandbox — it throws "No execution data available". 4. Do NOT use [{json: {...}}] return format — that's for Code nodes. Throws "Wrong output type returned". 5. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills sickn33/n8n-code-tool--38e999