We have an endpoint in our API that we are using with Zapier that if it takes to long requires a retry after a few seconds. How could we implement this flow?
Are you using a webhook within a zap, or are you building an application/integration on the Zapier platform?
Then this thread should be moved over to the Developer Discussion I think
Are you using the CLI (Code mode) or the GUI (form based) and do you know how promises work within javascript?
Once you switch to code mode you can edit the Javascript.
I'm not an advanced developer, but basically from my understanding you could build a "while" loop or an "if-then-else" statement with the promise of a result from an API endpoint. It's all javascript, so if you can build it in Javascript then you can build it on the Zapier platform.
Waiting for a promise in the code step like
Post your actual code here if you get stuck and we can help.
Are you in charge of the API, can you make changes like that so it has a callback URL which can be another Zap with a webhook?
Webhooks Best Practices | Stripe "If your webhook script performs complex logic, or makes network calls, it’s possible that the script would time out before Stripe sees its complete execution. Ideally, your webhook handler code (acknowledging receipt of an event by returning a 2xx status code) is separate of any other logic you do for that event."
Webhooks by Zapier - Integration Help & Support | Zapier "For High Availability and High Throughput reasons - we always return a success message with a payload of debugging information when collecting a webhook - regardless of whether there is a Zap behind the webhook or if it is paused or not. The only way to know if a URL is live is to visit the editor and look at the URL (which never changes for a Zap). There is no way to customize the response to the request you send to the Catch Hook URL, as the response is sent before the Zap triggers and runs on the webhook request."
I really think you need to change how your API handles requests. Even in these semi-rare situations.
But that aside, you can develop the javascript code to keep retrying, but if a specific api call will always take longer than 30 seconds it will never complete.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.