I am currently on the 14 day trial version of web n8n. Maybe that’s why I’m having problems…
I’m having trouble setting the value of a global variable, but I have no problem reading the variable. My goal is to be able to save the most recent timestamp of one of the data items, to prevent reusing old data and only get what’s new. The workflow may run on a daily schedule.
The key location is the first Filter and Code nodes. The Filter removes items which are older than the current latest date ($vars.lastCveTimestamp). The Code updates the date for the next cycle.
$vars.lastCveTimestamp is set by default to 0 and represents milliseconds since January 1, 1970. Typical JavaScript date timestamp.
The Filter is working and it’s not throwing an error, but the Code is not updating that global variable.
What’s the correct way to do this?
The value of $vars.lastCveTimestamp after running this workflow when I go to the Variables tab on n8n:
"0"
Information on my n8n setup
- n8n version: 1.21.1
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): cloud / website
- Operating system: macOS