@Danvers Thanks for your reply. i looked into that. the problem occurs when multiple runs of the same zap are initiated simultaneously, not in between the zap steps. so unfortunately the delay, will not resolve the issue.
nonetheless, thanks a lot for looking into this.
Those are both smart workarounds @donovanwatts and @amorevino!
You could also look at using the Delay After Queue action that Delay by Zapier uses.
When you add it to a Zap, you can set a delay between each item and the Zap will basically create a queue where it holds each item until the appropriate time and then releases it on to the next step of the Zap.
(View image larger)
sounds like a good solution for now. I've been experimenting more with Zapier storage and it sure is handy having it around vs always using my goto, Airtable.
Dear Donovan,
thanks for your reply. The waiting bit got me thinking.
as i am using custom javascript to do the third party api request, i added a sleep function like so, before doing the request.
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
let delay = Math.floor(Math.random() * 6000) + 1;
await sleep(delay);
This will not really make the zaps run sequentially but will spread out the requests over 6000ms in order to avoid the rate limit. theoretically, this will encounter a 429 when there are 13 simultaneous webhooks coming in. I prefer your idea with the zapier storage but i’ll have to experiment with that a bit more. i am not sure how the storage behaves if its called simultaneously by multiple zap runs. the sleep function will buy me some time for now... i hope (-:
i hope this might help anyone encountering a similar issue in the future.
thomas
I don’t have a solid answer but I did think of a potential solution you might want to explore. What if when you received a webhook, you check a value in Zapier Storage, which is initially set at zero. If zero, then set the value to ‘1’ and finish the task at hand. When done, reset the value to zero.
Then, whenever a webhook comes in, it checks to see if the value = ‘1’. If so, that means it needs to wait for the other task to finish up and reset the value. During this time, you can add a delay of a minute or whatever makes sense for the other task to finish.
I haven’t fully thought this through so it’s entirely likely I am missing something obvious here. Perhaps even if I don’t have a fully baked idea, this might spark some ideas for you on how you might tackle this challenge?