How to create variables within scope of workflow

Describe the problem/error/question

I need a variable that can update/persist through each loop run. Right now, it doesn’t look like there is a way unless we use 3rd party storage like Redis. This is very inefficient and I’m hoping there is a native way to do this. Is this something in the works? It seems like something basic, but I’m sure it can benefit many users. Here is an example workflow (maybe im missing something here).

Please share your workflow

Information on your n8n setup

  • n8n version: 1.66.0
  • Database (default: SQLite): Postgres
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: MacOS

Hi @jtoh

Yes you can set and update variables within workflows - use the builtin getWorkflowStaticData function for this.

See more in our docs

And for a demo workflow here

Hope that helps :slight_smile:

2 Likes

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