Retry node

The idea is:

A node that retries something (an HTTP call for example) a certain number of times after waiting x amount of time. This could be done with a combination of nodes but it would be convenient to have it as one node and I am also thinking non-programmers can have a hard time implementing it.

My use case:

I want to poll an endpoint until a task is done

assuming the HTTP call returns a task status, the basic logic would be something like this:

if (task === "done") {
continue with workflow
} else if (maxRetries <= retries) {
wait(time)
loop back to input node
} else {
do something else
}

Are you willing to work on this?

for sure! I can implement it but first want to validate the idea

Hey @CxGarcia,

Welcome to the community :doughnut:

I am not sure how generic this could be to work with all nodes, we do have some retry settings built into each node under the node settings but it doesn’t retry until it gets a certain value.

It is an interesting thought though.

1 Like

I feel like this is a really popular use case for working with OpenAI gpt API responses. There’s isn’t yet any kind of webhook that tells you when a response is ready (“when a run completed”).

  1. You create (POST) the thread
  2. You create (POST) the user message
  3. You create (POST) the run (at least for the Assistants API)
  4. You poll (GET) the run status for “complete.” It starts of in “queue”, then moves to “in progress”, and eventually it reached “complete”
  5. You retrieve (GET) the response of the run

I just want to be able to write a HTTP request for 4. or use some kind of Retry node, as the OP suggests, to check 4.'s output values (not necessarily an error). Until satisfied with the condition that status = “complete”, retry 4. (with optionally adjustable number of retries and duration between retries).

I see this thread was from 3 years ago, but I’m now searching for this solution myself. Please, anyone, let me know if I’m missing something obvious I should be using here.

Today is my first day trying out n8n (coming from being an avid Zapier userand giving make.com a shot until I realized they don’t even have a “Code by Zapier” equivalent).