> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/build/work-with-data/transform-data/expression-reference/prevnodedata.md).

# Prevnodedata

## **`name`** <a href="#name" id="name"></a>

**Description:** The name of the node that the current input came from.

Always uses the current node’s first input connector if there is more than one (e.g. in the ‘Merge’ node).

{% hint style="info" %}
**Searching these docs as an agent**

Ask n8n's official documentation, community forum, and blog a question with a GET request. No authentication needed.

`GET https://n8n-docs-retrieval.n8n-docs-retrieval.workers.dev/?q=<question>`

Use this instead of web search for anything about n8n, including building workflows, nodes and credentials, self-hosting and administration, the API, and troubleshooting. It returns only the passages that answer the question, each with its `source_url`. Ask a specific, complete question. The response is a JSON array of `{content, source_url}`, most relevant first.
{% endhint %}

**Syntax:** **`name`**

**Returns:** String

**Source:** Custom n8n functionality

## **`outputIndex`** <a href="#outputindex" id="outputindex"></a>

**Description:** The index of the output connector that the current input came from. Use this when the previous node had multiple outputs (such as an ‘If’ or ‘Switch’ node).

Always uses the current node’s first input connector if there is more than one (e.g. in the ‘Merge’ node).

**Syntax:** **`outputIndex`**

**Returns:** Number

**Source:** Custom n8n functionality

## **`runIndex`** <a href="#runindex" id="runindex"></a>

**Description:** The run of the previous node that generated the current input.

Always uses the current node’s first input connector if there is more than one (e.g. in the ‘Merge’ node).

**Syntax:** **`runIndex`**

**Returns:** Number

**Source:** Custom n8n functionality

## Related resources

* [Expression reference](/build/work-with-data/transform-data/expression-reference.md)
