What problem does it solve?
Many developers make subtle mistakes when authoring JavaScript inside n8n Code nodes—wrong return formats, misuse of expression syntax, improper webhook body access, and fragile null handling—that break workflows or produce silent failures. This skill consolidates best practices, clear access patterns, error-prevention techniques, and built-in helper usage so scripts run reliably in production automation pipelines.
Core Features & Use Cases
- Data access patterns: Clear guidance on when to use $input.all(), $input.first(), and $input.item and how to reference other node outputs safely.
- Return format & error prevention: Rules and examples ensuring code returns arrays of {json} objects, plus guard clauses, optional chaining, and try/catch patterns.
- Built-ins & production patterns: Practical recipes using $helpers.httpRequest, DateTime (Luxon), $jmespath, static storage, and 10 production-tested coding patterns for aggregation, parsing, ranking, and reporting.
- Use Case: Parse a webhook payload, normalize and deduplicate items, call external APIs for enrichment, and return a validated array for downstream nodes.
Quick Start
Use the n8n-code-javascript skill to convert an incoming webhook payload into a validated, normalized array of items and return them in the required [{json:{}}] format.