n8n-code-javascript
Skill by davila7
Guides an AI assistant in writing JavaScript for n8n Code nodes. It covers execution modes, data access, return formats and common Code node errors.
Install n8n-code-javascript
Built from the published package, never by AI.
git clone --depth 1 https://github.com/davila7/claude-code-templates /tmp/claude-code-templates && mkdir -p ~/.claude/skills && cp -r /tmp/claude-code-templates/cli-tool/components/skills/workflow-automation/n8n/n8n-code-javascript ~/.claude/skills/n8n-code-javascriptRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/davila7/claude-code-templates /tmp/claude-code-templates && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/claude-code-templates/cli-tool/components/skills/workflow-automation/n8n/n8n-code-javascript ~/.gemini/antigravity-cli/skills/n8n-code-javascriptAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install n8n-code-javascript in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill gives an AI assistant guidance for writing JavaScript in n8n Code nodes. It explains the two execution modes and recommends Run Once for All Items for most use cases. It shows how to read input with $input.all(), $input.first(), $input.item and $node, and how to return data as an array of objects with a json property.
It also flags common mistakes, such as webhook data sitting under $json.body and missing return statements. It covers HTTP requests with $helpers.httpRequest(), dates with DateTime (Luxon), and JSON queries with $jmespath(). It is aimed at people building n8n workflows who write Code node logic.
Written from the project's SKILL.md and checked against it.
What it can do
- Choosing a Code node modeExplains when to use Run Once for All Items or Run Once for Each Item.
- Data access patternsShows how to read input with $input.all(), $input.first(), $input.item and $node.
- Webhook data handlingExplains that webhook data is nested under the body property.
- Return format rulesDescribes the required array of objects with a json property.
- HTTP requestsShows how to call APIs with $helpers.httpRequest().
- Dates with LuxonShows date formatting and arithmetic with DateTime.
- JSON queryingShows how to filter and extract fields with $jmespath().
What you need
- n8n with a Code node
Try asking
- Write an n8n Code node that totals the amount field across all items.
- Fix my n8n Code node that returns undefined for webhook fields.
- Use $helpers.httpRequest in an n8n Code node to call a GET endpoint.
Good to know
- The source says Run Once for Each Item is slower for large datasets.
- Linked reference files such as DATA_ACCESS.md are not included in this source text.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: cli-tool/components/skills/workflow-automation/n8n/n8n-code-javascript/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
BUILTIN_FUNCTIONS.md16 KB -
COMMON_PATTERNS.md29 KB -
DATA_ACCESS.md16 KB -
ERROR_PATTERNS.md16 KB -
README.md9 KB
Show all 6 files
-
SKILL.md16 KB
Alternatives to n8n-code-javascript
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
n8n-code-javascript: common questions
Which Code node mode should I use in n8n?
The source recommends Run Once for All Items for most use cases. It suggests Run Once for Each Item only when each item needs a fully independent operation.
Why does my webhook field come back undefined?
The source says webhook data is nested under body, so $json.name should be written as $json.body.name.
What format must a Code node return?
It must return an array of objects with a json property, such as [{json: {...}}]. The source says other formats can make the workflow fail.
How do I install n8n-code-javascript?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is n8n-code-javascript free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is n8n-code-javascript safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to n8n-code-javascript?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
