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?
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:
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:
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.