Forum Academy Marketplace Showcase Pricing Features

Delete Scheduled workflow with a workflow

There is a User who clicks to delete own profile, workflow is trigger that deletes User’s data, but the Scheduled workflows are remained.

How to delete all related-to-User Scheduled workflows as well?

(We have User unique ID)

When you schedule a workflow, you get an ID as a result to identify the scheduled workflow. You can store this ID and use it to cancel the workflow if needed.

Otherwise, there’s no simpler way from what I know.

2 Likes

Yes. I can see the scheduled workflow ID, but how I can save the ID beforehand, or what do you mean exactly here? :thinking: :slightly_smiling_face:

Set a text field on a related datatype then, in the workflow where you schedule the backend workflow to run, refer to that step in a subsequent action to save the workflow ID on the related Thing’s workflow ID field (you could even create a new datatype especially for the purpose of storing workflow data - especially since you’re asking about how to cancel all scheduled workflows relating to a particular User).

2 Likes

Okay, thanks!

Will give it some time, as now I am between creating a new data type and adding additional steps in a workflow (as mentioned in this thread), or adding a condition to the existing workflows to execute the scheduled workflow only if condition is true, e.g. user’s profile is deleted (yes/no) = no.

If user’s profile is deleted = yes - only than to execute the scheduled workflow. Is this alright approach as well?