n8n-code-javascript

Reference n8n JavaScript Code node variables, execution modes, and patterns.

Updated Jan 29, 2026
One-click install
npx skills add https://github.com/fabiomilennials1234-a11y/v8milennialsb2bv2 --skill n8n-code-javascript-fabiomilennials1234-a11y
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-code-javascript
Source: https://github.com/fabiomilennials1234-a11y/v8milennialsb2bv2/tree/main/.claude/skills/n8n-code-javascript
Command: npx skills add https://github.com/fabiomilennials1234-a11y/v8milennialsb2bv2 --skill n8n-code-javascript-fabiomilennials1234-a11y

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing JavaScript Code nodes in n8n can be error-prone without a centralized reference. This guide clarifies the available variables, execution modes, and common patterns to speed up development and reduce mistakes.

Core Features & Use Cases

  • Variables: Lists built-in variables such as $input.all(), $json, $now, and $env to access and manipulate data in Code nodes.
  • Execution Contexts: Explains Run Once for All Items and Run Once for Each Item modes with guidance and examples.
  • Patterns & Examples: Provides reusable code patterns for data extraction, transformation, and error handling in n8n Code nodes, plus practical implementations.
  • Use Case: When building a multi-item workflow, this reference helps standardize data flow and outputs across items.

Quick Start

Use this guide to write and test n8n JavaScript Code nodes by referencing available variables, execution modes, and common patterns.

Frequently Asked Questions about n8n-code-javascript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What built-in variables are available in n8n JavaScript Code nodes?

n8n JavaScript Code nodes support built-in variables including $input.all() for item access, $json for data extraction, $now for timestamps, and $env for environment variables to manipulate workflow data.

How do I transform data for multiple items in n8n Code nodes?

Transform data for multiple items in n8n Code nodes by using the Run Once for All Items execution mode, which standardizes data flow and outputs across items with reusable extraction and transformation patterns.

What is the difference between Run Once for All Items and Run Once for Each Item in n8n?

The difference is that Run Once for All Items processes the entire dataset in a single execution, while Run Once for Each Item iterates individually, with the n8n reference providing guidance and examples for both execution contexts.

How do I handle errors and edge cases in n8n JavaScript Code nodes?

Handle errors in n8n JavaScript Code nodes by applying reusable patterns for error handling and data transformation from the reference guide, ensuring deterministic and safe code execution across workflow items.

Can I use n8n Code nodes for decision logic in CRM workflow automation?

Yes, you can use n8n Code nodes for decision logic and data transformation in CRM workflow automation by leveraging built-in variables and execution modes to ensure deterministic and safe code across items.