I have a loop that checks if the SSH outputs a certain message, if so then try the command again until it works.
Is there a way to count the number of times a loop has run?
When it gets to a certain number, I then plan to route it down an error path for someone to go and check why and kill the entire flow (which is triggered by a webhook).
Not sure I understand. Gets used like any other variable in n8n.
So if you want to for example exit a loop after a certain number of iterations you can set an expression like the following on the IF-Node: {{ $runIndex === 4 }}