Duplicate scheduled workflow events

Hello!

Has anyone ever ran into this before?

Background:

When a user clicks a button on my app, a workflow is scheduled to begin. The time for the workflow to begin is determined according to a date in the database. In other words, it doesn’t matter when the button is clicked, the process would always start at the same time. That time is changed every week.

The way it’s built is intended to create 1 API workflow per click, per user. In other words, users would only be able to click the button once (a week). That is achieved by a field called (submitted) in the user’s database entry. Clicking the button would schedule the workflow and change the submitted to =“yes”. If Submitted is “Yes”, the button would disappar.

In reality, for some users, I get duplicate workflows scheduled for the same time. I suspected it might be someone clicking the button multiple times, but I couldn’t replicate this so far.

Is there a way to prevent this from happening?

What I thought of / tried so far:

UI: So far, I’ve hidden the button once it’s clicked first, and then set up the rest of the actions (eg scheduling the workflow)
Backend: Is there a way to prevent a workflow from being scheduled twice by the same user, or perhaps going over all the scheduled workflows and programatically remove duplicates?

Thanks in advance

Maybe you can prevent the double scheduling of workflows by making the button not clickable, see “Another note” below. Option 2 might be to create a datatype (workflow and week (field Creator is autmatically created). When you start the workflow first check if there is an entry in the table for this user, workflow and week. If not, create an entry and plan the workflow and if there is, do nothing.

Note: When you plan a workflow, you get the unique ID of the planned workflow instance (result of…). With this ID you can cancel it later (action Cancel a scheduled API Workflow). So it might be smart to save it anyway, you can for instance save it in the table you created to prevent execution twice in the same week.

Another note: Maybe you can prevent the double scheduling of workflows by making the button not clickable. You can do this by creating a state (f.i. workflow_started type yes/no) and when the button is clicked set this state to yes. After the workflow is scheduled, you can set this state to No. On the button you add condition which makes it not clickable when this state is yes.

Example:

  1. State:

image

  1. Condition:

image

  1. Workflow action to set the state:

This topic was automatically closed after 70 days. New replies are no longer allowed.