# n8n $('Node').item.json: Use Data from an Earlier Node

> How $('Node name').item.json reaches back to an earlier node in n8n, when $json isn't enough, and examples from Gmail, If and Slack steps.

Source: https://learn.ynteractive.com/content/blog/n8n-reference-previous-node · Updated 2026-10-20 · Free from Stepthrough (https://learn.ynteractive.com)

Quick answer

In n8n, `$json` only holds the output of the node directly before the current one. To use a value from further back, write `$('Node name').item.json.Field`, for example `{{ $('Get row(s) in sheet').item.json.Email }}`, and n8n finds the matching item in that earlier node. The free [n8n weekly client status email](https://learn.ynteractive.com/content/weekly-client-status-email-google-sheets-ai-n8n) lesson uses it to address each AI-written draft to the right client.

Last updated October 20, 2026

[Take the free module →](https://learn.ynteractive.com/courses/n8n-jump-start/8)Module 8 of the free [n8n Jump Start](https://learn.ynteractive.com/courses/n8n-jump-start) course, about 14 minutes. No account needed.

By [Robert Breen](https://learn.ynteractive.com/content/about) · Published October 20, 2026 · Updated October 20, 2026 · 3 min read

n8n · Expressions · Data mapping

## Why isn't `$json` enough?

Because each node replaces the data. After an AI node, `$json` holds the AI's answer, not the sheet row it was written from.

In the client status workflow, the order is **Get row(s) in sheet**, then **Message a model**, then **Gmail: Create a draft**. In the Gmail node, `$json` is the [OpenAI](https://learn.ynteractive.com/content/glossary/openai) output: `{{ $json.output[0].content[0].text }}` is the email text. The client's email and project name live two nodes back, in the sheet node.

## How does `$('Node').item` work?

`$('Get row(s) in sheet')` names the node, `.item` picks the item linked to the one being processed, and `.json.Email` reads its field.

n8n keeps track of which item came from which: the third AI email traces back to the third sheet row. So `.item` gives the right client for each draft, without a loop or an index. The node name must match exactly, including capitals and spaces. If you rename a node, n8n updates expressions that refer to it.

## Copy-ready examples from the lessons

| Where | Expression | What it gets |
| --- | --- | --- |
| Gmail Subject | `{{ $('Get row(s) in sheet').item.json.Project }}` | The client's project name |
| Gmail To Email | `{{ $('Get row(s) in sheet').item.json.Email }}` | The client's address |
| Gmail To (lead reply) | `{{ $('Webhook').item.json.body.email }}` | The lead's email from the website form |
| If value1 ([lead score](https://learn.ynteractive.com/content/glossary/lead-scoring)) | `{{ $('Information Extractor').item.json.output.score }}` | The AI's 1-10 score |
| If value1 ([invoice](https://learn.ynteractive.com/content/glossary/invoice)) | `{{ $('Information Extractor').item.json.output.total }}` | The invoice total |
| Slack text | `{{ $('Webhook').item.json.body.name }}, {{ $('Webhook').item.json.body.company }}` | Who the lead is |

In the [speed-to-lead lesson](https://learn.ynteractive.com/content/speed-to-lead-agent-n8n), the If node comes after Gmail, so `$json` there would be Gmail's response. That's why the score is read from `$('Information Extractor')`. The [invoice approval lesson](https://learn.ynteractive.com/content/invoice-inbox-to-google-sheets-approval-n8n) does the same after a Google Sheets step.

## What's the easiest way to write these?

Drag the field from the INPUT panel. On the left, earlier nodes are listed by name; drag a field from any of them into a box and n8n writes the full `$('Node').item.json...` expression for you. Then check the Result line under the box shows a real value.

## Try it free, step by step

**n8n: Weekly Client Status Emails from a Google Sheet, Written by AI**. Build an n8n workflow that wakes up every Monday, reads your client tracker in Google Sheets, has AI write a friendly update for each client and saves it as a Gmail draft. You do every step yourself in a practice copy of n8n, it checks your work as you go, and “Do it for me” finishes any step you get stuck on. Free, and nothing touches your real accounts.

[Start the free lesson](https://learn.ynteractive.com/modules/n8n-client-status-email)

[Or read the full step-by-step guide](https://learn.ynteractive.com/content/weekly-client-status-email-google-sheets-ai-n8n)

## What errors can this give?

- **"Referenced node doesn't exist".** The name is misspelled or the node was deleted.
- **"Can't get data for expression" / no linked item.** The earlier node hasn't run in this test. Click **Execute workflow** or execute previous nodes first.
- **An empty Result.** The field name is wrong; field names are case sensitive.

## When should I use `.first()` instead of `.item`?

When the earlier node returned a single item that applies to everything, such as one settings row. `$('Settings').first().json.Signature` reads that one item for every item processed. For per-row data, stick with `.item`.

## Key takeaways

- $json is only the previous node's output.
- $('Node name').item.json.Field reads the matching item from any earlier node.
- Drag fields from the INPUT panel to get the expression written for you.
- Use .first() for a single shared value, .item for per-row values.

## Frequently asked questions

**How do I get data from a previous node in n8n?**

Use $('Node name').item.json.Field in an expression, or drag the field from that node in the INPUT panel.

**What is the difference between $json and $('Node').item.json?**

$json is the current input item, from the node directly before. $('Node').item.json is the linked item from a named earlier node.

**Do I need to change expressions if I rename a node?**

n8n updates references when you rename a node in the editor. Check expressions written outside the editor, such as in pasted workflows.

**Where do I learn n8n expressions?**

[n8n Data Mapping Examples](https://learn.ynteractive.com/content/blog/n8n-data-mapping-examples), [n8n Expressions for Beginners](https://learn.ynteractive.com/content/blog/n8n-expressions-for-beginners) and the free [n8n Intermediate](https://learn.ynteractive.com/courses/n8n-intermediate) course.

## Free lessons in this post

- [n8n: Weekly Client Status Emails from a Google Sheet, Written by AI](https://learn.ynteractive.com/content/weekly-client-status-email-google-sheets-ai-n8n): Build an n8n workflow that wakes up every Monday, reads your client tracker in Google Sheets, has AI write a friendly update for each client and saves it as a Gmail…
- [Speed-to-Lead Agent: Answer Every Web Lead in 60 Seconds](https://learn.ynteractive.com/content/speed-to-lead-agent-n8n): Build an n8n workflow that scores every website lead with AI, emails a personal first reply within seconds, and pings Slack only when a lead is hot.
- [Invoices from Your Inbox to Google Sheets, with Approval](https://learn.ynteractive.com/content/invoice-inbox-to-google-sheets-approval-n8n): Build an n8n workflow that reads each vendor invoice PDF from Gmail with AI, logs the vendor, invoice number and total in Google Sheets, and emails the owner an Approve…

## Watch it in a free lesson: Speed-to-Lead Agent: Answer Every Web Lead in 60 Seconds

### Speed-to-Lead Agent: Answer Every Web Lead in 60 Seconds: video walkthrough

Full walkthrough · 3:28 · with captions

Build an n8n workflow that scores every website lead with AI, emails a personal first reply within seconds, and pings Slack only when a lead is hot. The whole lesson narrated step by step, recorded in Stepthrough’s simulated practice environment.

[Watch it with chapters and the full transcript](https://learn.ynteractive.com/content/speed-to-lead-agent-n8n#watch)

From the free lesson [Speed-to-Lead Agent: Answer Every Web Lead in 60 Seconds](https://learn.ynteractive.com/content/speed-to-lead-agent-n8n)

## Related terms

Plain-English definitions, each with an example from a free lesson.

[OpenAI](https://learn.ynteractive.com/content/glossary/openai) · [Lead scoring](https://learn.ynteractive.com/content/glossary/lead-scoring) · [Invoice](https://learn.ynteractive.com/content/glossary/invoice) · [AI data entry](https://learn.ynteractive.com/content/glossary/ai-data-entry) · [AP aging report](https://learn.ynteractive.com/content/glossary/ap-aging-report) · [Apollo.io](https://learn.ynteractive.com/content/glossary/apollo-io) · [Approval threshold](https://learn.ynteractive.com/content/glossary/approval-threshold) · [Customer health score](https://learn.ynteractive.com/content/glossary/customer-health-score)

[The full AI glossary](https://learn.ynteractive.com/content/glossary)

## Related prompts

- [Invoice approval request email prompt](https://learn.ynteractive.com/content/prompts/invoice-approval-request-email-prompt): A copy-ready prompt that writes a clear approval request for a large invoice, so the owner can say yes or no in one reply with…
- [Client onboarding questionnaire prompt](https://learn.ynteractive.com/content/prompts/client-onboarding-questionnaire-prompt): Copy this ChatGPT prompt to write a client onboarding questionnaire: only what you need before kickoff, grouped, short, nothing…
- [Weekly status email to manager prompt](https://learn.ynteractive.com/content/prompts/weekly-status-email-to-manager-prompt): A ChatGPT prompt for a weekly status email to your manager: wins with numbers, what slipped and why, what you need from them…

[All free prompt templates](https://learn.ynteractive.com/content/prompts)

## Keep reading

- [n8n Data Mapping Examples: 20 Expressions to Copy](https://learn.ynteractive.com/content/blog/n8n-data-mapping-examples): Twenty n8n expressions from real workflows: sheet columns, names with spaces, webhook body fields, AI output paths, earlier nodes, dates and defaults.
- [n8n Gmail Node Examples: Send, Draft, Wait for Approval](https://learn.ynteractive.com/content/blog/n8n-gmail-node-examples): Five n8n Gmail node setups from real workflows: send a message, create a draft, send and wait for approval, email type and the n8n footer.
- [n8n OpenAI JSON Output: Get Data Back, Not a Paragraph](https://learn.ynteractive.com/content/blog/n8n-openai-json-output): Make the n8n OpenAI node return usable JSON: the exact shape in the prompt, Output Format set to JSON Object, the output path and when to use Extractor.

[All blog posts](https://learn.ynteractive.com/content/blog) · [All free tutorials](https://learn.ynteractive.com/content)
