# Variable Read/Write

**URL:** <https://community.n8n.io/t/variable-read-write/326283>\
**Category:** Feature Requests\
**Created:** [November 3, 2026, 2:26pm UTC](https://community.n8n.io/t/variable-read-write/326283 "2026-11-03T14:26:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vission1](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/vission1/32/157497_2.png) [@Vission1](https://community.n8n.io/u/Vission1)\
**Post date:** [November 3, 2026, 2:26pm UTC](https://community.n8n.io/t/variable-read-write/326283/1 "2026-11-03T14:26:46Z")

</div>

## The idea is:

I feel like it could be quite useful for Variables to have an optional Read Only/Read-Write option. Currently variables are Read-Only, but there are times where it would be useful to be able to update some variables.

## My use case:

My use case is that I simply want to start a Last Run Timestamp, seems a bit heavy to have to use a datatable to store a simply variable for this purpose.

## I think it would be beneficial to add this because:

I’m sure others would find this useful, and it should default to being read-only.

## Any resources to support this?

## Are you willing to work on this?

---

<div class="post-metadata">

**Author:** ![TaskToAgent](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@TaskToAgent](https://community.n8n.io/u/TaskToAgent)\
**Post date:** [November 3, 2026, 2:56pm UTC](https://community.n8n.io/t/variable-read-write/326283/2 "2026-11-03T14:56:31Z")

</div>

Until something like this exists, workflow static data covers a “last run” timestamp without a data table. A Code node at the start reads it:

```js
const data = $getWorkflowStaticData('global');
return [{ json: { lastRun: data.lastRun || null } }]; // null the first time

```

And a Code node at the end, after the rest of the run worked, saves the new value:

```js
const data = $getWorkflowStaticData('global');
data.lastRun = new Date().toISOString();
return $input.all();

```

Saving at the end matters: if a run fails halfway, the window doesn’t move forward and you don’t skip items.

Two catches: it’s only saved for production executions (active workflow on a trigger), not when you click Execute in the editor, so a manual test looks like it doesn’t work. And it’s per workflow, so if several workflows need the same value, a data table is still the better place.
