Dev & Engineering n8njavascriptworkflow-automationcode-nodeapi-integrationdata-transformation

n8n JavaScript Code Node Guide

Write reliable, efficient JavaScript for n8n Code nodes.

FollowSkills review · FSRS-2.0
Not recommended
47/ 100 5-point scale 2.4 / 5
Trust11 / 25 · 2.2/5

The document explicitly restricts authentication helpers, environment access, and require(), and recommends credentialed HTTP Request nodes, showing some least-privilege and data-flow awareness. However, it still presents arbitrary HTTP requests, manually propagated tokens, DELETE operations, and persistent static-data examples without user confirmation, sensitive-data redaction, external-effect warnings, or rollback guidance. Publisher identity is unverified, so points are deducted.

Reliability9 / 20 · 2.3/5

It covers execution modes, return shapes, common errors, abnormal inputs, and sandbox restrictions, making the happy path plausible. However, node-reference guidance is internally inconsistent, several examples assume unstated input schemas, empty-input and failure handling are incomplete, and key paths cannot be reproduced from a static read. The score stays within the static-review cap.

Adaptability11 / 15 · 3.7/5

The audience, Code-node scenarios, Custom Code Tool exclusion, and alternatives using native nodes are clearly described. However, the trigger is overly broad, version and instance-configuration boundaries are not sufficiently defined, there is no evidence of Chinese-language support, and compatibility across n8n versions is not established, so points are deducted.

Convention8 / 15 · 2.7/5

The documentation provides a quick start, topical layering, related files, checklists, examples, and limitation notes, with MIT license metadata. It lacks a clear maintainer, versioning policy, changelog, update path, and verifiable provenance; some referenced materials are incomplete in the supplied evidence, so points are deducted.

Effectiveness5 / 15 · 1.7/5

The skill supplies many directly adaptable JavaScript, data-access, performance, and error-handling patterns for common Code-node tasks. However, several examples depend on undeclared schemas or have potentially problematic runtime semantics, and there is no statically verifiable execution output or test evidence. It therefore receives only partial credit.

Verifiability3 / 10 · 1.5/5

The supplied material includes concrete code, error messages, configuration names, and version-specific assertions, providing limited auditability. Claims such as “production-tested” and measured performance lack committed tests, CI coverage, or independent corroboration, and static review cannot reproduce them, so the score is low.

Evidence confidence:Low Reviewed Jul 20, 2026 Reviewed revision 05eea4848c12
Before you use it
  • Do not place arbitrary HTTP requests, manually supplied Authorization tokens, DELETE operations, or $getWorkflowStaticData examples into production without reviewing data flow, credential scope, external effects, and recovery.
  • n8n versions, task runners, and instance environment variables can change API availability; validate helpers, return shapes, node references, and allowlist settings on the target instance.
  • Some examples are internally inconsistent or assume unstated input schemas; the “production-tested” and performance claims were not verified by this review.
Review evidence [1][2][3][4][5]
See the full review method →

What does this skill do, and when should you use it?

This skill provides focused guidance for writing JavaScript in n8n Code nodes, including data access, transformations, execution modes, and troubleshooting. It covers All Items versus Each Item execution, webhook payload structure, return formats, HTTP requests, date handling, and JMESPath queries. It also addresses batching loops, cross-iteration data, pairedItem, and production failure patterns. It fits users implementing non-trivial n8n logic, while simple mappings, basic filtering, and HTTP-only tasks are better served by native nodes.

Reads data through $input.all(), $input.first(), $input.item, and named node references; produces n8n-compatible JSON item arrays; explains use of this.helpers.httpRequest(), DateTime, $jmespath(), and workflow static data; guides selection between All Items and Each Item modes; covers aggregation, filtering, parsing, transformation, batching, loop accumulation, and structured error returns; diagnoses $json.body webhook nesting, invalid return values, sandbox restrictions, and pairedItem issues.

  1. An n8n developer needs to aggregate, sort, deduplicate, or calculate statistics across multiple input items.
  2. A workflow builder needs to parse webhook requests and correctly read fields nested under $json.body.
  3. A user needs custom data transformations, business rules, or multi-step conditional logic in a Code node.
  4. A user is troubleshooting return formats, execution modes, loop accumulation, or large-dataset performance.
  5. A developer needs a simple unauthenticated HTTP request or date, JSON-structure, and text processing inside n8n.

What are this skill's strengths and limitations?

Pros
  • Covers common n8n Code node data-access, return-format, and error patterns.
  • Explains when to use All Items versus Each Item and why their performance differs.
  • Documents production gotchas involving SplitInBatches, cross-iteration accumulation, and pairedItem.
  • Includes 10 production patterns plus input validation, error handling, and early-filtering guidance.
Limitations
  • It targets the regular n8n Code node, not the AI Agent Custom Code Tool runtime.
  • Complex authenticated, paginated, or retrying HTTP calls should generally use an HTTP Request node or another workflow design.
  • require(), $env, and some authentication helpers depend on n8n instance configuration or sandbox restrictions.
  • The source does not provide independent test results for this skill across platforms.

How do you install this skill?

This skill is distributed in the czlonkowski/n8n-skills collection. For Claude Code, run /plugin install czlonkowski/n8n-skills. For manual installation, run git clone https://github.com/czlonkowski/n8n-skills.git, then copy n8n-skills/skills/* to ~/.claude/skills/. The source also requires an installed and configured n8n-mcp MCP server and .mcp.json. For Claude.ai, download and upload the n8n-code-javascript skill folder; separate installation steps for other platforms are not specified.

How do you use this skill?

After installation, ask a targeted prompt such as “How do I access webhook data in an n8n Code node?” or “Write JavaScript for Run Once for All Items mode that aggregates all input amounts.” For an AI Agent Custom Code Tool, do not use this skill; use the n8n-code-tool skill because it has a different runtime contract.

How does this skill compare with similar options?

The source recommends Set/Edit Fields for simple field mapping, Filter for basic filtering, IF or Switch for simple conditionals, and HTTP Request for HTTP-only tasks. These cases may not require a Code node.

FAQ

Is this skill free?
The repository is licensed under MIT, but the source does not describe other costs. Use also requires an n8n-mcp MCP server and an n8n environment.
Can it handle authenticated API requests?
The skill recommends using an HTTP Request node with credentials. Authentication helper methods are deny-listed in the Code sandbox; a manual Authorization header is suggested only when the token already enters the workflow as data.
Why can returning a primitive fail in a Code node?
n8n expects item-shaped output, so the recommended form is `[{json: {...}}]`. A string, number, null, or undefined has no item structure to wrap and can trigger “Code doesn't return items properly.”
Is it suitable for every data-transformation task?
No. The source recommends trying expressions, Edit Fields, or native nodes first. Code nodes are better suited to cross-item aggregation, complex logic, recursive operations, and asynchronous work.

More skills from this repository

All from czlonkowski/n8n-skills

Dev & Engineering

n8n Python Code Node Guide

Write dependable Python for n8n Code nodes within their real runtime limits.

Dev & Engineering

n8n Expression Syntax Guide

Write, validate, and repair n8n expressions for reliable workflow data mapping.

Automation & Ops

n8n Workflow Architecture Patterns

Design, validate, and deploy reliable n8n workflows with proven architectural patterns.

Dev & Engineering

n8n AI Code Tool Guide

Write JavaScript or Python that obeys the n8n Custom Code Tool contract for AI-agent calls.

Automation & Ops

n8n Node Configuration Guide

Configure n8n nodes by operation and dependency to reduce validation errors and silent runtime failures.

Automation & Ops

n8n Binary & File Handling

Keep files intact in n8n workflows and move them safely through AI tools and chat interfaces.

Automation & Ops

n8n MCP Workflow Router

Routes n8n-mcp tasks to the right skills and reduces production workflow failures.

Automation & Ops

n8n MCP Tools Expert

A practical guide for reliably searching, validating, and managing n8n workflows.

Automation & Ops

n8n Error Handling

Make n8n workflow failures routable, visible, and recoverable.

Automation & Ops

n8n Multi-Instance Targeting

Safely select, verify, and switch the n8n instance targeted by an MCP session.

Automation & Ops

n8n AI Agent Architecture Guide

Design n8n AI agents with the right nodes, tool connections, memory, structured output, and human approval.

Automation & Ops

n8n Subworkflow Architect

Turn reusable n8n logic into explicit, testable sub-workflows that humans and AI agents can discover and call safely.

Automation & Ops

n8n Validation Expert

Explains n8n validation results and guides iterative fixes for problems that can stop workflows from running.

Automation & Ops

n8n Self-Hosting Deployment

Deploy production self-hosted n8n on Linux with Docker Compose, Caddy, and automatic HTTPS.

Related skills