Tooluck logoTooluck
SKILL.md

n8n-code-javascript

Agent skill fromczlonkowski/n8n-skills

Write, review, or debug JavaScript in an n8n Code node. Use when a Code node is already in the workflow (editing it, fixing an error, choosing its mode, making it faster), or when a new one is justified: no native node fits (check the job-to-node table in using-n8n-mcp-skills first) and the job is on the closed list — loops or recursion no node expresses, state across runs, parsing no node handles, an allowlisted library, heavy all-items work, or one short node replacing 4+ glue nodes. Covers $input/$json/$node in code, this.helpers, Luxon, SplitInBatches loops, cross-iteration data, pairedItem, per-item performance, and the \"Why Code:\" note. Filtering, totals, dedupe, sorting, joins, file formats and API paging have native nodes (Filter, Summarize, Remove Duplicates, Sort, Merge, Extract From File, HTTP Request): see n8n-node-configuration. EXCEPTION — for the AI-agent-callable Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode), use n8n-code-tool; it has a different runtime contra

How to install n8n-code-javascript

install n8n-code-javascript
# install the n8n-skills pack with the skills CLI
npx skills add czlonkowski/n8n-skills

# or add only this skill to Claude Code: copy the folder

skills/n8n-code-javascript/

# into

~/.claude/skills/n8n-code-javascript/ (all projects)

.claude/skills/n8n-code-javascript/ (one project)

skills/n8n-code-javascript/SKILL.md

MITFull file
1# JavaScript Code Node
2
3Expert guidance for writing JavaScript code in n8n Code nodes.
4
5---
6
7## Before you write a Code node
8
9A new Code node has to pass this gate first:
10
111. **Is there a native node for the job?** Check the job-to-node table in `using-n8n-mcp-skills`: Filter, IF / Switch,
12 Summarize, Aggregate, Split Out, Merge, Compare Datasets, Remove Duplicates, Sort + Limit, Date & Time, XML / HTML /
13 Extract From File / Convert To File, HTTP Request (pagination, batching) and Crypto cover most reaches for Code.
14 Their configs are in `n8n-node-configuration` → NATIVE_NODES.md.
152. **Would a short expression in that node do?** One expression, no function body — the helper methods (`.pluck()`,
16 `.sum()`, `.unique()`, `$ifEmpty()`, `.diffTo()`) are in `n8n-expression-syntax` and, on n8n-mcp 2.97.0+, in
17 `tools_documentation({topic: "expression_helpers"})`. Several statements inside `{{ }}` count as code, so they belong
18 here rather than in an Edit Fields field.
193. **Is the job on the closed list?** Loops or recursion no node expresses, state across runs
20 (`$getWorkflowStaticData`), parsing no node handles, an allowlisted library, heavy all-items work (thousands of items,
21 stated or measured), or one short Code node (~15 lines) replacing 4+ glue nodes that only reshape data.
22
23If it passes, write the Code node and give it a note, so the next reader (and the review hooks) can see why:
24
25```json
26…

Excerpt shown under the repository's MIT license.

More skills in n8n-skills

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates