n8n-code-javascript

n8n-code-javascript is a skill for Claude Code from neurawork-git/n8n-autopilot. It costs 63 tokens per session (1,765 once invoked), scanned A, original, MIT.

A guide for writing JavaScript in n8n Code nodes, which are workflow steps that run custom code. It covers n8n's input and output format and common built-in helpers.

In plain words
What is it for?
Use it to transform workflow data, make HTTP requests, work with dates, troubleshoot Code node errors, and decide when a built-in n8n node is more suitable.
Why use it?
It helps prevent common Code node mistakes, such as reading webhook data from the wrong place or returning data in an invalid format.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the n8n-autopilot plugin — 24 skills, 12 agents, 5 hooks shipped together

Good fit Use it to transform workflow data, make HTTP requests, work with dates, troubleshoot Code node errors, and decide when a built-in n8n node is more suitable.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/neurawork-git/n8n-autopilot/n8n-code-javascript
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add neurawork-git/n8n-autopilot --skill n8n-code-javascript
Clone the repo
git clone --depth 1 https://github.com/neurawork-git/n8n-autopilot

Made for: Claude Code.

Or install n8n-autopilot, the plugin that ships this one along with the rest of its 24 skills, 12 agents, 5 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for n8n-code-javascript

README.md
[![agentmods](https://agentmods.dev/badge/skills/neurawork-git/n8n-autopilot/n8n-code-javascript/github.svg)](https://agentmods.dev/skills/neurawork-git/n8n-autopilot/n8n-code-javascript)
Your own site
<a href="https://agentmods.dev/skills/neurawork-git/n8n-autopilot/n8n-code-javascript"><img src="https://agentmods.dev/badge/skills/neurawork-git/n8n-autopilot/n8n-code-javascript/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for n8n-code-javascript

Your own site · 80×15
<a href="https://agentmods.dev/skills/neurawork-git/n8n-autopilot/n8n-code-javascript"><img src="https://agentmods.dev/badge/skills/neurawork-git/n8n-autopilot/n8n-code-javascript.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,765 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00063 $0.01765
Opus 5.5 $0.00025 $0.00706
Sonnet 5.5 $0.00013 $0.00353
Haiku 4.5 $0.00006 $0.00177

Measured 24d ago against content hash 0fc8e7e1e79f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

n8n-code-javascript scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 24d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/n8n-code-javascript/SKILL.md · 246 lines

How it starts

The opening of the file, as written. The whole thing — 246 lines — stays where its author put it; the contents beside it link to each section on GitHub.

JavaScript Code Node

Expert guidance for writing JavaScript code in n8n Code nodes.


Quick Start

// Basic template for Code nodes
const items = $input.all();

// Process data
const processed = items.map(item => ({
  json: {
    ...item.json,
    processed: true,
    timestamp: new Date().toISOString()
  }
}));

return processed;

Essential Rules

  1. Choose "Run Once for All Items" mode (recommended for most use cases)
  2. Access data: $input.all(), $input.first(), or $input.item
  3. CRITICAL: Must return [{json: {...}}] format
  4. CRITICAL: Webhook data is under $json.body (not $json directly)
  5. Built-ins available: $helpers.httpRequest(), DateTime (Luxon), $jmespath()

When NOT to use a Code node (native-first)

Reach for a native node before writing JavaScript — Code nodes are harder to read, review, and they run V8 in-process (OOM risk on large data, see below). In a real production audit, Code nodes outnumbered native conditional nodes ~2.5:1 — much of it avoidable:

If you are doing… Use this native node, NOT Code
Branching on a condition IF (2 branches) / Switch (n branches)
Dropping items by a rule Filter
Setting / renaming / mapping fields Set (Edit Fields)
Merging / combining streams Merge
Aggregating into one item Aggregate / Summarize
Looping over large batches Loop Over Items (SplitInBatches)

Memory / OOM (real production incident): a Code node that loads or iterates a large dataset — especially a full DB result set (>~10k rows), binary, or file contents — can spike the V8 heap (~3 GB cap) and crash the n8n pod (OOM). For large data: page/limit at the source, process in SplitInBatches, or push the work into the database/native node instead of materializing it all in JS.

Use a Code node when the logic genuinely has no native equivalent (custom parsing, multi-field computation, shaping a bespoke payload).

Read the full file on GitHub · 246 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 24d ago Changed · +14 lines 0fc8e7e1e79f
  2. 1mo ago First seen · 232 lines · 63 tokens per session scan A 3fa2574c1d6e

Subscribe to this mod's changes

n8n-code-javascript is a skill published in the GitHub repository neurawork-git/n8n-autopilot (18 stars, last pushed 10d ago), licensed MIT. It adds 63 tokens to every session and 1,765 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

better-auth

Skill for integrating Better Auth - comprehensive TypeScript authentication framework for Cloudflare D1, Next.js, Nuxt, and 15+ frameworks. Use when adding auth, encountering D1 adapter errors, or implementing OAuth/2FA/RBAC features.

secondsky/claude-skills · 53 tokens

cloudflare-workers-multi-lang

Multi-language Workers development with Rust, Python, and WebAssembly. Use when building Workers in languages other than JavaScript/TypeScript, or when integrating WASM modules for performance-critical code.

secondsky/claude-skills · 45 tokens

craftcms

Craft CMS 5 plugin and module development — extending Craft with PHP. Covers elements, element queries, services, models, records, controllers, migrations, queue jobs, console commands, field types, native fields, events, behaviors, Twig extensions, widgets, filesystems, permissions, project config, GraphQL, testing…

michtio/craftcms-claude-skills · 70 tokens

outsystems-custom-code

Beta Feature. This skill is a Beta Feature: a non-final OutSystems capability provided to collect customer feedback. It can change significantly, including through breaking changes, or be discontinued. The first time you use this skill in a conversation, tell the user it's a Beta Feature and share .

OutSystems/outsystems-mcp · 187 tokens

functions-development

Build serverless Go or Python functions for Falcon Foundry apps. TRIGGER when user asks to "create a function", "write a serverless function", "build backend logic", runs foundry functions create, or needs help with FDK handler patterns, function testing, or collection integration from functions. Also TRIGGER when…

CrowdStrike/foundry-skills · 195 tokens

python-services

Python patterns for CLI tools, async parallelism, and backend services. Use when building CLI apps, async/parallel Python, FastAPI services, background jobs, or configuring Python project tooling (uv, ruff, ty).

iliaal/whetstone · 48 tokens