Simply put, I have some users who double or triple-click on webhook links and it’s causing my Scenarios to run 2 or 3 times, when only 1 is necessary.
The flow is this:
User clicks a button, which is the webhook URL
The Scenario runs
However, some impatient users are either double-or-triple clicking the link, and it’s causing the scenario to run multiple times, unnecessarily. Sometimes the clicks are seconds apart, and sometimes it’s up to 20-30 seconds apart.
My options are as follows:
I can put in the scenario to delete the button immediately on click, but that won’t stop the double-clicks as they are only seconds apart
I can put in some form of UUID into the link, and write the scenario to ignore duplicate UDIDs (I think?)
I can put in some form of rate limiting, but then these clicks will be enqued, and run anways.
I suppose you could devise a way that a webhook can only be processed once every X minutes. So that if a webhook is triggered, it will run the first time but ignored every extra trigger for the next X minutes. That wouldn’t be foolproof, though, if two different users will click the button in the same window.
But don’t make it hard on yourself. You are receiving double clicks out of frustration. A visual indicator that something is happening will cut down frustration clicks enormously. If you add a loader animation, this visual feedback will let the user know that his action triggered something.
I’m somewhat limited in what I can do with respect to loading animations etc. as the webhook button resides inside a google spreadsheet, so javascript etc. is off the table.
I switched the settings to sequential processing instead of parallel, which is a start, but I’m still a bit hung up on how to prevent subsequent processing based on a UUID.
Do you think it would be:
Webhook contains a UUID
Scenario runs, checks a database to see if the UUID is unique or not
When clicking the link, does a new browser window or tab open up?
If so, you can add a webhook response module to serve back a simple message or even a webpage, or javascript to close the window or tab that just opened.
If there is something unique in the webhook URL, another option is maybe adding a Data Store in the beginning of the scenario.
Add a record to the Data Store using that unique data as the key to indicate the process has begun.
If that record already exists, end the scenario.
If not, proceed.
At the end of the scenario, delete that record, if they’re allowed to run it again.
If there isn’t a unique piece of info in the URL, then you can enable headers and read the IP Address that the click came from and maybe restrict multiple runs that way?