How to Automatically Re-Run a Scenario w/ an Error

I have a scenario that is a string of ChatGPT modules. There’s about 60 ChatGPT modules in a row. Every once in a while, one of the ChatGPT modules (any random ChatGPT module) gets this RunTime 500 error:

RuntimeError
[500] The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error.

I want to have Make automatically re-run the ChatGPT module that got the RunTime error complete the scenario. How do I do that?

60 in a row? That is some workflow!

I’m commenting partly because I’m interested in the response.

The only thing that comes to mind is to put an error handler at each call so it can retry X number of times until the call goes through before failing. That might be OK for a few calls, but 60…?

L

@L_Duperval I don’t mind putting an error handler after every ChatGPT module. When the scenario runs, there’ll probably only be an error on 1 or 2 of the ChatGPT modules, if any. But I need the error handler there just in case.

Which one of Make’s error handlers do I use to do that?

I’m new to Make, switching over from Zapier. Can you send me a screenshot of what that error handler setup looks like?

Hello @LaurenK,

You could add an error handler route that consists of Sleep → OpenAI Module (copy of the one that errored out) → Resume.

Resume will take the results of the duplicate OpenAI module then pass them along as the results of the original module that failed and the scenario continues as if there was no error.
The purpose of the Sleep (for like 60 seconds) is to give your rate limit time to reset but also could be used to retry a module that may have failed because the service was down.
Here’s a video that sort of explain the concept https://www.youtube.com/watch?v=yGHUN7alk2k

You may also be able to use the Break module on an error handling route. When Allow Storing on Incomplete Executions is enabled this should allow Make to automatically re-run until complete with an interval you specify.

This Make article also specifically mentions ChatGPT modules and how to handle this error with them https://www.make.com/en/help/errors/how-to-handle-errors-in-make/fixing-connection-errors#how-to-handle-the-connectionerror

As for you ~60 ChatGPT modules, are these inline because one is using the output from the previous? I don’t know the exact structure of your Scenario, but you might be able to use a Repeater and/or helper Scenario so that you only need to have one set of ChatGPT modules that you can run X number of times.

Hi @Donald_Mitchell

That’s really helpful, thanks. I’m going to try it out and I’ll let you know how it goes!

Yes, my ChatGPT modules are all in a single line and the output from 1 feeds into the next module.

In the image below the red arrows point to the ChatGPT modules. At the end of the scenario, all of the ChatGPT outputs are mapped into a single Google Doc template to create a report.