Deleting a User from the Backend Workflow

Hello Bubblers,

I’m trying to delete a user along with all its related data when the app receives a specific webhook event. As of now, I’m able to delete all the related data, such as its products, subscriptions, … etc.

However, the user itself is not deleted. Here are two screenshots of how I’m deleting the subscription, for example, which is working as expected, and how I’m trying to delete the user, which is not doing anything.

The merchant_id is a number that is added to all the data types. So it’s there in the Subscription and in the User, and it’s the same.

What am I doing wrong here?

Thank you!!

Have you checked your server logs to see what’s going on?

i.e. is the workflow action running, but not deleting the User? If so, why not?

Or is the workflow actin not running at all?

I just checked the Server Logs, which I didn’t know it exists until now.

All the delete actions worked as expected, except for the delete user. The message is “Action condition failed”.

However, all the delete actions had the same condition, so why deleting user has an issue?

Smart money says it’s the default privacy rule on the User data type that is getting in the way because that’s almost always the case in a situation like the one you are describing.

1 Like

Can I change the default privacy rule? And what are the consequences?

Thank you!

Of course you can change the default privacy rule, and the consequences are specific to the changes you make and the nature of your app. Instead of immediately firing back additional questions, you should learn about privacy rules and figure out how to use them correctly, and then apply what you learn to your app.

1 Like

Well then, there you go… the Only When condition on the workflow is not being met (so that action doesn’t run).

I don’t know what the Condition is (aside from being Request Data’s event is Arbritray Text)…

So what is the Arbritrary text?

But if it’s anything to do with The User’s merchant_ID field, then I expect @mikeloc is correct, and you have a privacy rule stopping that field (or the entire User object) from being accessible in the workflow.

So either change your privacy rules, or check the box to allow the workflow to Ignore Privacy Rules when running, depending of course on the specifics of your app, the data you need to protect, and the way your workflow is set up etc.

1 Like

Thank you dear!

I’ll experiment with the privacy rules and let you know how it’s going.

Thanks Adam!

Ok, mission accomplished. Not sure about the consequences yet though.

I found two ways to work around this, one is to add a privacy rule to the User type, as shown in the attachment. The other is to allow everyone to find this in search.

Thank you everyone!

@halmelaifi I wouldn’t recommend that privacy rule. If your problem is related to privacy rules, it might be better to check the checkbox “ignore privacy rules” when running that backend workflow.

1 Like

@oliviercoolen I just did that. I wasn’t sure that I wanted to play with the privacy rules honestly.
Thank you for the recommendation.

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