What problem does it solve?
This Skill guides users to write correct, safe JavaScript in n8n Code nodes, addressing common pitfalls like incorrect return formats, webhook data access, and missing null checks, so workflows run reliably.
Core Features & Use Cases
- Code node data access: Learn to read data via $input.all(), $input.first(), and $input.item, and to reference other nodes with $node.
- Built-in utilities: Use $helpers.httpRequest() for API calls and DateTime (Luxon) for date handling.
- Error prevention: Understand and apply patterns that avoid common Code node errors and ensure robust workflows.
- Use case example: Build a small data transformation that aggregates inputs, enriches them, and returns a consistent [{json: {...}}] payload.
Quick Start
Use the code node to read all items from the input, transform them, and return the results in the required [{json: {...}}] format. Example: const items = $input.all(); const processed = items.map(item => ({ json: { ...item.json, processed: true, timestamp: new Date().toISOString() }})); return processed;