# Undefined value in edit fields node

**URL:** <https://community.n8n.io/t/undefined-value-in-edit-fields-node/302658>\
**Category:** Questions\
**Tags:** node, edit-fields\
**Created:** [July 9, 2026, 2:52pm UTC](https://community.n8n.io/t/undefined-value-in-edit-fields-node/302658 "2026-07-09T14:52:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![flipflip](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/flipflip/32/157035_2.png) [@flipflip](https://community.n8n.io/u/flipflip)\
**Post date:** [July 9, 2026, 2:52pm UTC](https://community.n8n.io/t/undefined-value-in-edit-fields-node/302658/1 "2026-07-09T14:52:24Z")

</div>

Hello,

In a workflow, I store values ​​in an “Edit fields” node at the start of execution. The rest of the workflow runs for about two minutes, and at the end, I retrieve one of the values ​​from that “Edit fields” node. The problem is that I get an “undefined” message for the field —almost as if the stored value has a limited lifespan.

€# Information on your n8n setup

- **n8n version:** 2.29.9
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):** Docker
- **Operating system:** Linux Fedora

---

<div class="post-metadata">

**Author:** ![Ayomikun27](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ayomikun27/32/176885_2.png) [@Ayomikun27](https://community.n8n.io/u/Ayomikun27)\
**Post date:** [July 9, 2026, 3:02pm UTC](https://community.n8n.io/t/undefined-value-in-edit-fields-node/302658/2 "2026-07-09T15:02:58Z")

</div>

* * *

Hey! Values don’t expire in n8n, so that’s not it.

The real issue is you’re probably losing the reference across branches or after a merge. Try changing your expression to:

```auto
{{ $('Edit Fields').first().json.yourField }}

```

`.first()` forces n8n to always grab from the original output no matter where you are in the workflow. That fixes it most of the time!

---

<div class="post-metadata">

**Author:** ![Anshul\_Namdev](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/anshul_namdev/32/178229_2.png) [@Anshul\_Namdev](https://community.n8n.io/u/Anshul_Namdev)\
**Post date:** [July 9, 2026, 9:08pm UTC](https://community.n8n.io/t/undefined-value-in-edit-fields-node/302658/3 "2026-07-09T21:08:10Z")

</div>

Hi @flipflip  
If a Wait node is pausing the run for those two minutes, that is what produces the undefined: n8n saves the execution when it hits the wait and reloads it on resume, so a back-reference like `$('Edit Fields').item` to a node from before the wait does not reliably survive the reload. The Wait node passes its input straight through, so carry the field on the item instead of reaching back across the wait. Turn on Include Other Input Fields in the Edit Fields node so the value travels with the items into the Wait node, then read it after the wait with:

```auto
{{ $json.yourField }}

```

> **[Wait | Nodes | n8n Docs](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait)**
>
> Documentation for the Wait node in n8n, a workflow automation platform. Includes guidance on usage, and links to examples.

---

<div class="post-metadata">

**Author:** ![flipflip](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/flipflip/32/157035_2.png) [@flipflip](https://community.n8n.io/u/flipflip)\
**Post date:** [July 10, 2026, 8:28am UTC](https://community.n8n.io/t/undefined-value-in-edit-fields-node/302658/4 "2026-07-10T08:28:34Z")

</div>

Hi, thank’s for your response.

Here is a simplified version of my workflow. The “setVar” node is instantiated at the beginning without errors. The workflow runs smoothly, and it is only at the final node that I need the “mail” value specified in “setVar”. The two nodes preceding “setVar” are included solely for illustrative purposes.

Error

```auto
Problem in node ‘Send an Email‘

No recipients defined

```

---

<div class="post-metadata">

**Author:** ![Anshul\_Namdev](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/anshul_namdev/32/178229_2.png) [@Anshul\_Namdev](https://community.n8n.io/u/Anshul_Namdev)\
**Post date:** [July 11, 2026, 9:09am UTC](https://community.n8n.io/t/undefined-value-in-edit-fields-node/302658/5 "2026-07-11T09:09:48Z")

</div>

Hi @flipflip  
In the Send an Email node you have `{{ $('setVar').first().item.json.mail }}`. `.first()` already returns the item, so chaining `.item` onto it resolves to undefined, toEmail ends up empty and the node reports “No recipients defined”. Drop the `.item`:

```auto
{{ $('setVar').first().json.mail }}

```

If it still comes back empty, the address never landed in setVar: its `mail` assignment reads `{{ $json.mail }}` off `getMail`, so open setVar’s output and confirm the field actually holds the address there.

> **[Reference previous nodes | Build | n8n Docs](https://docs.n8n.io/build/work-with-data/reference-data/reference-previous-nodes)**
>
> Methods for working with the input of the current node and the output of previous nodes.

---

<div class="post-metadata">

**Author:** ![flipflip](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/flipflip/32/157035_2.png) [@flipflip](https://community.n8n.io/u/flipflip)\
**Post date:** [July 13, 2026, 6:54am UTC](https://community.n8n.io/t/undefined-value-in-edit-fields-node/302658/6 "2026-07-13T06:54:38Z")

</div>

Perfect, thank you.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [July 20, 2026, 6:55am UTC](https://community.n8n.io/t/undefined-value-in-edit-fields-node/302658/7 "2026-07-20T06:55:10Z")

</div>

Closed on July 20, 2026, 6:55am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
