Restart At A Particular Node When Condition Met

Describe the problem/error/question

Hello. I’m new to n8n and looking for some guidance on how to correctly implement a piece of my first workflow. Apologies in advance if this is ridiculously simple.

A brief description, my original workflow started with a form that’s used to supply the URL to the golf tournament results from ESPN, it then extracts the page, parses out the players and their earnings, formats the results, saves it to a Google sheet and emails me when completed. This works great as long as the full results are posted (like from a previous tournament).

Now, what I’d like to be able to do is to start this shortly before the tournament ends, have it verify the full results are posted before proceeding and to recheck on a set time interval if not (currently I just sit there refreshing the page).

So, is it possible to pause and restart at a particular step? For me that would be after the form submission since I already have the correct URL. So far, I’ve added an If node to check if the array is empty (working) and a Wait node.

Thanks in advance for your time in responding!

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.111.1
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker Desktok
  • Operating system: WSL

Hey, simply connect the Wait node to any node before it (in your case the HTTP node). This creates a loop and it will check continuously until the IF node redirects it elsewhere. Do you need to also stop the workflow after X loops if the results never get posted?

1 Like

Thanks for the reply. Sorry, forgot to mention that I tried that. It errors out with: Problem in node ‘Get ESPN Results Webpage Data ‘ Cannot read properties of undefined (reading ‘startsWith’). Updated below.

Ah, yes, because it tries to read info from the IF node, but it’s not there, it’s in the Form node.

Replace the expression in the HTTP node with:

{{ $('Form To Provide ESPN URL').item.json['ESPN Results Webpage URL'] }}

Or adjust it to match, you get the idea :slight_smile:

It doesn’t like that. Replacing {{ $json[‘ESPN Results Webpage URL’] }} with {{ $(‘Form To Provide ESPN URL’).json[‘ESPN Results Webpage URL’] }} in the Get ESPN Results Webpage Data node does not provide the URL.

I have to run out for an hour or so but will check back in after. Thanks again. I really appreciate the help.

Sure, my bad on the code, it should be:

{{ $('Form To Provide ESPN URL').item.json['ESPN Results Webpage URL'] }}
2 Likes

That worked! Now that I understand how you did it, I’m sure I will use this again. Thanks again!!!

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