How to reset $runIndex?

Describe the problem/error/question

I have a workflow where it will check if node fails 3 times it will go back to beginning of the workflow. I made it go back to beginning of the workflow so it can restart but the $runIndex doesn’t reset it will constantly match the condition. Is there anyway to reset $runIndex when it goes back to beginning of the workflow?

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

You can probably not reset the runindex.
You can do some stuff as a work around to check if it went back to the beginning by thecking runindex of a different node and such. I would probably recommend not doing that though.
To make it easy and managable, you will probably be best of to use a sub workflow. Runindex wil only be for as long as the subflow is running so that allows you to “reset” it for the next time you run a certain part of the flow.
Hope that makes sense.

1 Like

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