Agent skill · Documentation

n8n-code-javascript

Write JavaScript code in n8n Code nodes. Use when writing JavaScript in n8n, using $input/$json/$node syntax, making HTTP requests with $helpers, working with dates using DateTime, troubleshooting Code node errors, or choosing between Code node modes.

Nick44,086★ · +407/wk · 1 repos on radarProfile →
claude-codecodexcursorMIT
Install
npx skills add sickn33/agentic-awesome-skills --skill n8n-code-javascript --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 16 KB
Bundled scripts: none
Path: skills/n8n-code-javascript/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 44,414 · +328 this week
Language: Python
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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 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() --- ## Mode Selection Guide The Code node offers two execution modes. Choose based on your use case: ### Run Once for All Items (Recommended - Default) **Use this mode for:** 95% of use cases - **How it works**: Code executes **once** regardless of input count - **Data access**: `$input.all()` or `items` array - **Best for**: Aggregation, filtering, batch processing, transformations, API calls with all data - **Performance**: Faster for multiple items (single execution) ```java

What's inside
Steps it walks through
  1. Quick Start
  2. Essential Rules
  3. Mode Selection Guide
  4. Run Once for All Items (Recommended - Default)
  5. Run Once for Each Item
  6. Data Access Patterns
  7. Pattern 1: $input.all() - Most Common
  8. Pattern 2: $input.first() - Very Common
  9. Pattern 3: $input.item - Each Item Mode Only
  10. Pattern 4: $node - Reference Other Nodes
  11. Critical: Webhook Data Structure
  12. Return Format Requirements
  13. Correct Return Formats
  14. Incorrect Return Formats
More from agentic-awesome-skills
All skills →
About this skill
What does the n8n-code-javascript skill do?

Write JavaScript code in n8n Code nodes. Use when writing JavaScript in n8n, using $input/$json/$node syntax, making HTTP requests with $helpers, working with dates using DateTime, troubleshooting Code node errors, or choosing between Code node modes.

How do I install it?

Run `npx skills add sickn33/agentic-awesome-skills --skill n8n-code-javascript --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From sickn33/agentic-awesome-skills, a repository with 44,414 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going