Hello all,
I would like to run an automated workflow every month that checks when a user last logged in. If the user has not logged in for 6 months I would like a field on the user data type “is active” to change to “No” otherwise leave as “Yes”. From there I would like to create a list of all inactive users “No” and delete all records related to those users and their accounts automatically. I am just learning about backend workflows but I’m still not exactly sure how to apply them and whether this is the type of situation where backend workflows should be used as opposed to a standard workflows. If standard workflows are the way to go I have no idea which page of my app to apply them to or if it even matters. Appreciate any guidance that can be provided on this.
Thanks.
In this case I’d suggest that you create a scheduled workflow on a list of items, where you do a search for these users filtering by these conditions. You’ll have to create a backend workflow that will do that for one user and then schedule a list to repeat the workflow.
Try creating a backend workflow which when called changes User’s is active to “no” if Current date/time is greater than User’s Modified Date + 6 months (for more accurate login date, create a Last Login field in User Database which stores User’s Last login date)
Create 2nd backend workflow which when called deletes the user from the database
Create a 3rd backend workflow (Schedule API Workflow on a List) which goes through the list of users, apply constraint (is_Active is no), then it will call the 2nd backend workflow which will delete all the inactive users
For monthly recurrence, you might have to use plugin