# N8n Code Javascript

Write JavaScript code in n8n Code nodes.

- Repository: https://github.com/czlonkowski/n8n-mcp (23187 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-10-27
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add czlonkowski/n8n-mcp --skill n8n-code-javascript -g -a claude-code -y`
Codex: `npx skills add czlonkowski/n8n-mcp --skill n8n-code-javascript -g -a codex -y`
Cursor: `npx skills add czlonkowski/n8n-mcp --skill n8n-code-javascript -g -a cursor -y`
Gemini CLI: `npx skills add czlonkowski/n8n-mcp --skill n8n-code-javascript -g -a gemini-cli -y`

## Description

Write JavaScript code in n8n Code nodes. Use when writing JavaScript in n8n, using $input/$json/$node syntax, making HTTP requests with this.helpers / the $helpers global, working with dates using DateTime, troubleshooting Code node errors, choosing between Code node modes, or doing any custom data transformation in n8n. Always use this skill when a workflow needs a Code node, whether for data aggregation, filtering, API calls, format conversion, batch processing logic, or any custom JavaScript. Covers SplitInBatches loop patterns, cross-iteration data, pairedItem, and real-world production patterns. Also use when asked why a Code node or workflow is slow, which execution mode is faster, or how to cut per-item overhead on large datasets. EXCEPTION, for the AI-agent-callable Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode, a tool attached to an AI Agent), use the n8n-code-tool skill instead; it has a different runtime contract.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# JavaScript Code Node

Expert guidance for writing JavaScript code in n8n Code nodes.

---

## Quick Start

```javascript
// 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

The rest: https://github.com/czlonkowski/n8n-mcp/blob/HEAD/data/skills/n8n-code-javascript/SKILL.md
