Deleting a user's created objects when account deleted?

I’m trying to use a backend workflow to delete everything a user created after they choose to delete their account. Accounts are being successfully deleted. However, their objects remain in the DB.

For the backend WF I have a database trigger event where “User before change doesn’t have an account.” I’ve also tried “User after change doesn’t have an account.” The WF then searches for and deletes a list of [Thing] that were created by the user. At least that’s what’s supposed to happen :wink:

Any tips or suggestions? I’m guessing I’m just missing something obvious?

Hey Matt,

When a user deletes their account, you can no longer reference that user, which makes it impossible to delete any objects associated with that account after it’s gone.

To handle this properly, a good solution is to schedule an API workflow when the user initiates the account deletion process. This workflow should first remove or handle any objects linked to the user (such as posts, data, or files), and then, as the final step, delete the user account itself. This way, all necessary cleanup happens before the user data becomes inaccessible.

Let me know if that works!

Gotcha, will give that a try!

Closing the loop → that worked like a charm, thanks!

1 Like

One quick solution is to delete a list of objects and do a search for those objects with the constraint: “Created By isn’t in” Search for Users.
That works if you don’t have to store objects created by non users. (you could add some privacy rules to take care of this case too).