Agent skill · software engineering · davila7
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.
Why this skill is useful
Provides specific patterns and examples for writing JavaScript in n8n Code nodes, which the AI may not generate accurately on its own.
What it needs
About 9k tokens when loaded. Last updated 2026-08-06. 30,138 stars on the source repository.
What this skill does
JavaScript Code Node Expert guidance for writing JavaScript code in n8n Code nodes. --- Quick Start 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) When to use: ✅ Comparing items across the dataset ✅ Calculating totals, averages, or statistics ✅ Sorting or ranking items ✅ Deduplication ✅ Building aggregated reports ✅ Combining data from multiple items Run Once for Each Item Use this mode for: Specialized cases only How it works: Code executes separately for each input item Data access: $input.item or $item Best for: Item-specific logic, independent operations, per-item validation Performance: Slower for large datasets (multiple executions) When to use: ✅ Each item needs independent API call ✅ Per-item validation with different error handling ✅ Item-specific transformations based on item properties ✅ When items must be processed separately for business logic Decision Shortcut: Need to look at multiple items? → Use "All Items" mode Each item completely independent? → Use "Each Item" mode Not sure? → Use "All Items" mode (you can always loop inside) --- Data Access Patterns Pattern 1: $input.all() - Most Common Use when: Processing arrays, batch operations, aggregations Pattern 2: $input.first() - Very Common Use when: Working with single objects, API resp …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills davila7/n8n-code-javascript