---
stable_id: skills/skills-sh-czlonkowski-n8n-skills-n8n-code-javascript
type: skills
title: skills-sh-czlonkowski-n8n-skills-n8n-code-javascript
summary: >-
  # Data Access Patterns - JavaScript Code Node

  Comprehensive guide to accessing data in n8n Code nodes using JavaScript.

  ---

  ## Overview

  In n8n Code nodes, you access data from previous nodes using built-in
  variables and methods. Understanding which method to use is critical for
  correct workflow execution.

  **Data Access Priority** (by common usage):

  1. **`$input.all()`** - Most common - Batch operations, aggregations

  2. **`$input.first()`** - Very common - Single item operations

  3. **`$input.item`** - Common - Each Item mode only

  4. **`$node["NodeName"].json`** - Specific node references
tags:
  - skills-sh
  - skills-sh-all-time
source_url: https://raw.githubusercontent.com/czlonkowski/n8n-skills/HEAD/skills/n8n-code-javascript/DATA_ACCESS.md
license: ""
upstream_ref: https://skills.sh/czlonkowski/n8n-skills/n8n-code-javascript
github_stars: null
github_forks: null
github_is_organization: null
retrieved_at: 2026-06-11T08:32:10.716Z
content_sha256: dabc7d5cc70d5647f1352e75686b4b41f33c123de97dccb8d3305e69de46682c
---
