Set a value and update each time the workflow runs

I want to have a variable or state called Identifier that starts at 1. Every time the workflow is executed I want that value to be incremented plus 1. That is, Identifier changes to 2, then to 3 and so on.

Even more complicated, I want each beginning of the year to return to the value 1 again and follow the same flow as previously indicated.

1 Like

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

@Ivy_Saskia_Notion_IS , I think what you are looking for is static workflow data. It allows saving data directly in the workflow and persisting it in between the workflows.

OK I read it.
Would u mind to show me an example of this being updated every day to be a little example, please? because I want it to be updated every year

@Ivy_Saskia_Notion_IS , here’s a demo. It runs every minute so that you could observe how the Identifier is incremented with each run. Surely, you have to activate the workflow to get it working. Running it manually will not show its proper work. Leave it to run for a few minutes and check the logs of the executions. Assuming the workflow runs daily the Identifier will be reset to 1 on the New Year day.

3 Likes

Thank u so much for ur time! @n8n give this men a prize! :sunglasses: :sunglasses: :sunglasses:

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